### Edvard's blog

By Edvard, history, 5 years ago, translation,

Hi, Codeforces!

Educational Codeforces Round #1 will take place on 13 ноября 2015 года в 18:00 MSK for the first and second divisions. You can read about educational rounds here.

The round will be unrated for all users and it will be held with extented ACM ICPC rules. You will have two hours to solve five problems. After that you will have one day to hack any solution you want. You will have access to copy any solution and test it locally.

Educational rounds are (and would) be prepared by me, Edvard Davtyan from Saratov SU Daemons team. Problems was invented by me and MikeMirzayanov. Thanks to my teammate dans for testing problems and MikeMirzayanov for Codeforces, Polygon and idea of the educational rounds.

I hope you will enjoy the problems. If they will be too simple for you, you are welcome to the second educational round, problems there should be harder.

Good luck and have fun!

UPD: The first phase of round is over. I remind that the results is not final and you can hack any solution during the day.

UPD2: Please use only deterministic generators. For example you should not use srand(time(NULL)) with calling rand() function in C++. Your generator should always generate the same test.

• +231

 » 5 years ago, # | ← Rev. 2 →   -87 HAHA homo_sapiens is wrote blog,but his blog till +1:)
•  » » 5 years ago, # ^ | ← Rev. 2 →   +36 This is what happens when people use a bad translator. or smoke too much pot.
 » 5 years ago, # |   +80 Added problem F to the problemset. Now the contest will be interesting for nearly all Div 1 participants too. Let's have fun!====Добавил в контест задачу F — теперь даже Div 1 участникам будет интересно. Готовы?
 » 5 years ago, # |   +8 After that you will have one day to hack any solution you want. Can we also hack during the contest after locking a problem?
•  » » 5 years ago, # ^ |   +9 No, only after the contest finished.
•  » » » 5 years ago, # ^ | ← Rev. 2 →   0 Are there any penalty for wrong hacks, and bonus for correct ones?
•  » » » » 5 years ago, # ^ |   0 will there be rooms in contest ? i mean after contest we can hack anyone ?!?!?!
•  » » » » 5 years ago, # ^ |   +6 Only +x/-y in standings.
•  » » » » » 5 years ago, # ^ |   0 it seems even +x/-y not appearing
•  » » 5 years ago, # ^ |   0 It will be round with ACM ICPC rules, so you can't lock problem.
 » 5 years ago, # |   +26 Please don't delay it today. I have a tight schedule today. Please!
 » 5 years ago, # |   0 Great ^_^
 » 5 years ago, # |   -9
•  » » 5 months ago, # ^ |   +8 so memes were there 5 years ago as well!
 » 5 years ago, # | ← Rev. 2 →   +2 How to solve E with DP?
•  » » 5 years ago, # ^ |   +9 Screw hacking. Discuss solutions. Because of 24 hrs hacking, we can't even discuss solutions? -_-
•  » » » 5 years ago, # ^ |   0 Its ok. I will solve E on my own, because the test cases are also visible.
•  » » 5 years ago, # ^ | ← Rev. 3 →   0 dp[i][j][k] = minimum cost to eat k squares of some i * j chocolate bar.
•  » » » 5 years ago, # ^ | ← Rev. 2 →   +1 AAHHHH!!!! 2 idiotic errors ;_; . Codeforces makes me cry a lot.
 » 5 years ago, # |   0 There is a typo ... are (and would) be ... it should be ... are (and would be) ...
 » 5 years ago, # |   +1 Damn, I wish this contest was a rated one :3
•  » » 5 years ago, # ^ |   0 It would not be like that if it was rated :)
 » 5 years ago, # |   -16 Again
 » 5 years ago, # |   +32 what is unexpected verdict
 » 5 years ago, # | ← Rev. 4 →   +93 Successful hacking attempt!Now try to hack 14233270! chegor got it! Try 14242942. alexey.shchepin got it. Those were interesting puzzles — would make an okay problem I guess.I guess the real impossible one would be the first one with a bigger input. Less brute force would work probably. Any other ideas?
•  » » 5 years ago, # ^ |   +6 Sorry, but I don't understand what are you doing. Can you explain it?
•  » » » 5 years ago, # ^ |   +29 I originally thought there would be hacking during the round, and knew I wanted to try hacking a in-contest solution afterwards. The reasonable solution would be to submit in the last second, but I had class and could only get only at small times. I wanted to submit something that was hackable, but no one else would really be able to hack. The way I did this was by hashing the input, and if the hash is equal to a certain predefined value, the solution fails. For example this solution fails on "thisisahacktest".It didn't end up mattering since there was no contest hacking, but it was fun.
•  » » 5 years ago, # ^ | ← Rev. 2 →   0 you hacked your own solution :p that doesnt make any sense :/
•  » » » 5 years ago, # ^ |   +5 But your handle makes perfect sense ;)
•  » » » » 5 years ago, # ^ |   0 who cares :D
•  » » 5 years ago, # ^ | ← Rev. 2 →   +21 Easy. I made it with binary search. 13 1 19 31 19 19 92 74 69 32 32 91 42 73 
•  » » » 5 years ago, # ^ |   +5 I noticed. Nice job! Just random tries until it worked? (fix all but last couple)Try this one: 14242942. Hopefully more constrained. :)
•  » » » » 5 years ago, # ^ |   +13 You know, that your MOD is 1016 + 60, not 1016 + 61?
•  » » » » » 5 years ago, # ^ |   0 Oh what. I saw before on CF that it worked to do it that way. I guess not above 1e9. Okay that's a useful find. x.xAnyway probably doesn't make it much easier here.
•  » » » » » » 5 years ago, # ^ |   +8 It's not allowed to hack not the latest submission for the problem. Anyway, here is your hack.
•  » » » » » » » 5 years ago, # ^ |   0 Nice job! That's like the same as mine.Maybe you just make them all the same and express the difference in base 3 I guess.Okay that was fun; I'm done now :P
 » 5 years ago, # |   0 does unsuccessful hack reduce point????
•  » » 5 years ago, # ^ |   0 no
•  » » 5 years ago, # ^ |   +1 No.
 » 5 years ago, # |   +10 i am getting unexpected verdict over and over again
•  » » 5 years ago, # ^ |   0 Fixed now.
 » 5 years ago, # | ← Rev. 2 →   +3 I wonder why it takes the first accepted submission's time as penalty when you have more than one accepted submissions :O
 » 5 years ago, # |   +37 The checker is evil. Check out the smileys.
 » 5 years ago, # |   0 Why is the source limit only 256 KB? I wanted to test a case for problem D, where n=1000,m=1000, and k=1. But, when I input my 1000*1000 grid, the file becomes 956 KB. Anything I can do to fit the memory?
•  » » 5 years ago, # ^ |   +14 You can submit code that will generate your test to standard output.
•  » » » 5 years ago, # ^ |   0 Thank you.
 » 5 years ago, # |   +4 I think all that solutions for well-known problems stuff is good but the "24 hours hacking" is just a waste of time.
•  » » 5 years ago, # ^ |   -8 2 hours after contest over is best option i think
•  » » 5 years ago, # ^ |   -11 It is becoming more like Codechef Long Challenges, of which i'm not a fan definitely :(
 » 5 years ago, # |   +24 Liked this round very much.
 » 5 years ago, # |   0 E was nice w.r.t the way in which DP table had to be filled :D
 » 5 years ago, # |   0 Are we allowed to discuss the problems? I am really interested in problem C
•  » » 5 years ago, # ^ |   +4 find every vectors angle with X axis and sort them and get the minimum value of distance(i , (i+1)% n)
 » 5 years ago, # | ← Rev. 4 →   -28 int main() { if (I get high standing)  return  return  } 
•  » » 5 years ago, # ^ |   0 Nice ads bro.
 » 5 years ago, # |   +13 What is atan2 in c++ ?!i used atan! it was hard because of checking some conditions! is atan2 easier?THANKS!
•  » » 5 years ago, # ^ |   +9 atan returns a result in [-pi/2,+pi/2] while atan2 gives in [-pi,+pi]. You cannot determine the exact quadrant in atan. For example; given p1(1,0), p2(-1,0), atan gives 0 for both p1 and p2. You need to do extra work to see that they are not the same vectors. But atan2 gives 0 for p1 and PI for p2 which is what we are exactly looking for.
 » 5 years ago, # | ← Rev. 2 →   +2 Why the resubmission after hack is not tested on the hack input?! I hacked the same person using the same case twice xD
•  » » 5 years ago, # ^ |   +12 I think, the system doesn't test the successful hacks because all of them will be added to the main tests and will be retested after the hacking phase. xD
 » 5 years ago, # |   +19 When showing the scoreboard with Div.2 only participants, It shows only users with 1700- rating only.Looks like it is still working with old limit for div2 before colors revolution.
•  » » 5 years ago, # ^ |   +19 I'll fix it soon. Thanks.
 » 5 years ago, # |   +26 Wow, really learnt a lot from this round, especially problems E and F. Please keep more of these rounds in future. Very nice initiative :D
 » 5 years ago, # |   +8 The checker for problem F seems incorrect. It is saying this case: 17 1 0 1 0 2 8 2 8 -2 0 -2 0 -1 1 -1 2 0 3 -1 4 -1 5 0 6 0 5 1 4 0 3 0 2 1 1 0 7.12 0 1 0 is 4.00, but manually drawing it out gives me 3.12. Can you double check your solution against this case?
•  » » 5 years ago, # ^ | ← Rev. 2 →   +12 Firstly, we cross LINE with polygon not SEGMENT.So answer is 4 : 8-6 inside poly, 6-5 and 4-3 along side.
 » 5 years ago, # |   0 I am Curious about to ask you Guyz that " Will All the Submissions be Rejudged after adding the Hack Cases after 24 hours Hacking Phase . Let me Know .Thanks in Advance .
•  » » 5 years ago, # ^ |   0 Yes they will be rejudged with old tests + hacks.
 » 5 years ago, # | ← Rev. 2 →   +19 i am got unexpected verdict when i hack problem F using n = 700, m = 100.
•  » » 5 years ago, # ^ |   0 Give me please the hack id.
•  » » » 5 years ago, # ^ |   0 OK now! thx
 » 5 years ago, # |   0 why aren't there any points for hacking?
 » 5 years ago, # |   +78 Successfully challenged myself :) :(
 » 5 years ago, # |   +6 I am a Div 2 participant but why isn't my handle shown on the Div 2 Standings?
•  » » 5 years ago, # ^ |   +3 Standings by divisions is not working correct. It will be fixed soon.
 » 5 years ago, # | ← Rev. 2 →   +8 Problem CHard work, but finally I did it :|
•  » » 3 years ago, # ^ |   0 i have the same problem (WA on test 116 ). i didn't understand why!? can u help me :D submission id 30388279
 » 5 years ago, # |   +7 Hello homo_sapiens and MikeMirzayanov . I love the idea of educational rounds. I have a request. I am very bad at finding corner cases, and debugging. Can we have an educational round where the focus is on corner cases and debugging. If we have such a round in rated contest, I'll be scared to take part, and I don't like missing rounds. Besides, losing ratings because of one missed test case hurts real bad. If I practice such problems, then its not the same as solving in an actual contest. So, I request, that you prepare a round focussed on problems with lots of scope for Wrong Answer because of test cases. It will help me improve my debugging skills, because some times, I make silly errors, but give up on my solution thinking something's wrong with my approach, and I need to come out of that mindset. When I face this problem in practice, I procrastinate thinking I'll debug it later. As a result, if I code something in 15 minutes, I take 1.5hrs+ just to debug silly errors. I need to practice in contest environment and virtual contests are not the same. So, Please! Also, maybe 24hrs for hacks is maybe too much... but that's a secondary concern to me. :)Thank you and have a wonderful day!
•  » » 5 years ago, # ^ |   0 I think it may be better if you can practice problems where there are a lot of hacks in virtual contests or mushups with your friends, which will make it much more interesting and motivational.Although I agree with your idea someway, frankly speaking, it’s hard for the organizers to meet the minority’s demond.
•  » » » 5 years ago, # ^ | ← Rev. 3 →   0 But I can still see the test cases, and virtual contests are not as serious as real contests. This makes all the difference. I can sure, get all cases covered after 20 attempts and a bit of peeking at the test cases, but that is what I don't want to do, because it doesn't help at all during real contests. Besides, I am a lone coder, my friends not interested :(EDIT: If you don't make the whole contest case handling, then make the first three such, and the last two so hard, that I can't solve it :D . That way, I will be forced to try the first three.These are educational contests. Please help me learn the art of debugging :)
 » 5 years ago, # |   0 and now the time when hackers are more scary than system tests became ....
 » 5 years ago, # | ← Rev. 2 →   +11 I was wrong(
 » 5 years ago, # |   +16 I'm not sure if this has been discussed yet, but since this is an educational round, the editorial will be much more detailed while teaching us the concepts right?
•  » » 5 years ago, # ^ |   0 Has an editorial been published yet?The editorial is probably the most educational part of any CF round, so I really hope they do publish it, and that it is thorough and complete.
 » 5 years ago, # |   +13 For anyone wondering: Hacking E is pointless, testcase 4 enumerates all possible inputs.
•  » » 5 years ago, # ^ |   0 Yes you are right :-)
 » 5 years ago, # |   0 Will the educational contest be rated?
•  » » 5 years ago, # ^ |   +3 No. Quote of the original post: "The round will be unrated for all users and it will be held with extented ACM ICPC rules. "
•  » » » 5 years ago, # ^ |   0 Alright,thanks!
 » 5 years ago, # | ← Rev. 6 →   +25 Umm, both mine and Jury's answers are the same. Why does the code fail at #119?
•  » » 5 years ago, # ^ |   0 They are not the same: the difference according to wolfram alpha
•  » » » 5 years ago, # ^ |   0 Okay, I didn't verify with wolfram;I had taken a look at the Checker Log. Thanks!
•  » » » » 5 years ago, # ^ |   0 #define double long double Accepted. :/
 » 5 years ago, # |   +14 any idea why so many codes including mine fails on testcase 119 for C?
 » 5 years ago, # |   +3 That moment when your solution is 2ms away from time-limit :D
 » 5 years ago, # |   0 Was problem C so difficult to get right because it required to use long double? Changed mine solution from double to long double and got AC: http://codeforces.com/contest/598/submission/14258763
 » 5 years ago, # |   0 Can somebody explain what is wrong with #127 testcase ?
•  » » 5 years ago, # ^ |   +1 Two angles different by 2e-17 radians which is much smaller than double precision.
 » 5 years ago, # |   0 homo_sapiens Is there an editorial for this round ?
 » 5 years ago, # |   -8 I am a beginner programmer and want to start with Basic C programming programs problems.
 » 5 years ago, # |   0 Please share editorial for problem F.
 » 5 years ago, # |   0 Hi. Where I can find the tutorial for this educational round ??
 » 4 years ago, # |   0 can anyone share the editorial link?
 » 3 years ago, # |   0 can any one plz tell me how to solve problem E in less than O(n * m * k * k * (n+m)) time
•  » » 3 years ago, # ^ |   0 Essentially, you can remove one k factor by observing that, when you make a cut horizontally or vertically, it is always less costly to use one of the portions in full if possible, than further cutting both portions. Hence, now instead of looping over how much of the k to distribute into the two portions, you take the best of two options.