### Edvard's blog

By Edvard, history, 6 years ago, translation,

Hi, Codeforces!

Codeforces Round #325 will take place on October 12, 2015 at 09:00 UTC for the first and second divisions. Please note that the round will start at unusual time!

The problems of this round are taken from the Regional stage of the All-Russian school team programming olympiad that will be at the same time in Saratov, Russia. Lets wish school teams good luck on competition!

The problemset for school olympiad differs from problems that will be on round. In addition in problemset for school olympiad there will be some problems, which are not included in the round and vice versa. So don't be frightened by the difficulty of problems given for school teams :-)

The process of problems preapring was very interesting: we were reworking problem statements many times, adding tests, changing limits, even managed to change fully prepared problem with another (we had to stop the conveyor already printing problem statements :-)) Let's thank all who were preparing, helping in preparing, reading the problem statements, writing solutions: Adilbek adedalic Dalabaev, Roman Roms Glazov, Vladimir vovuh Petrov, Oleg Oleg_Smirnov Smirnov, Alexey Perforator Ripinen, Maxim Neon Mescheryakov, Ilya IlyaLos Los, Vitaliy gridnevvvit Gridnev, Danil danilka.pro Sagunov, Alexander fcspartakm Frolov, Pavel HolkinPV Kholkin, Igor Igor_Kudryashov Kudryashov, Elena elena Rogacheva, Dmitriy Nerevar Matov, Vitaliy kuviman Kudasov. Chairman of the jury of the Olympiad is Mikhail MikeMirzayanov Mirzayanov (also he is the author of some of tasks). I (Edvard Edvard Davtyan) prepared some tasks and coordinated the work of the authors. So we are a large team of writers (I hope I did not forget anyone)!

Also let's thank Max Akhmedov (Zlobober), The-One-Who-Must-Not-Be-Named (if I am not wrong, he or she is right now solving the round problems) for their help in problems preparing, Maria Belova (Delinur) for translating problems in English and again Mikhail Mirzayanov (MikeMirzayanov) for the Codeforces and Polygon systems.

You will have only two hours to solve six problems. The scoring distribution will be anounced a little before the round. I wish high rating to all participants! Good luck and have fun!

P.S.: Also I want to wish good luck to the participants of the ACM ICPC Southern Subregional Programming Contest that will be held on Wednesday.

UPD Due to technical reasons round is delayed by 10 minutes.

UPD: In problem Subway roller there were tests with trains of length one. At this moment authors are discussing how much it troubled the round results. We are apologize to participants who had problems with that. We will announce our decision about this problem soon.

UPD2: There were trains with length equal to one in tests for problem Subway Roller. Jury decided to accept the first right solution of each user that passed all tests except the wrong, also other submissions were ignored. In addition we accept all successed hacks, although the hack is not correct and the hacked solution passed all other tests. Contest will be rated, but any user who think that this situation is cardinally affected to his/her result can send me in 24 hours a message and jury will discuss the question to make round unrated only for that participant. We are apologize to participants one more time for this situation.

UPD3: Editorial

• +192

 » 6 years ago, # |   +74 What a large team! Maybe it is the largest team for a contest in CF up to now. Isn't it?
•  » » 6 years ago, # ^ | ← Rev. 3 →   +70 LARGE team = LARGE amount of troubles?
•  » » » 6 years ago, # ^ |   +28 Perhaps they are still busy discussing now? Just wait is OK~
 » 6 years ago, # |   0 acm/icpc rules or codeforces rules?
•  » » 6 years ago, # ^ | ← Rev. 6 →   0 .
 » 6 years ago, # |   0 Why can't I see this post on my homepage?
 » 6 years ago, # | ← Rev. 2 →   +9 Only before the contest 1 hour,we can see it on the homepage.So strange.
•  » » 6 years ago, # ^ |   +39 Because it's not there :))
 » 6 years ago, # |   +15 We should expect quality problems, since so many people are involved in the preparation.
 » 6 years ago, # | ← Rev. 3 →   +9 .
 » 6 years ago, # |   +7 Score distribution ?
 » 6 years ago, # |   0 Why delayed again?
 » 6 years ago, # | ← Rev. 2 →   +6 where is the scoring distribution ?!
•  » » 6 years ago, # ^ |   +6 scoring
 » 6 years ago, # |   +15 seriously what is the reason behind cf round delays!?
•  » » 6 years ago, # ^ | ← Rev. 2 →   +5 I think it is related to the sudden massive requests. They prepare slave servers based on the number of initial massive requests and they will be ready after the delay.
 » 6 years ago, # |   +13 what is this? 10 mints delay again :v
 » 6 years ago, # |   +29 It wouldn't be a normal codeforces round if there is no delay :)
 » 6 years ago, # |   +70
 » 6 years ago, # |   0 the contest start at a special time and we have delay 10 min -_-
 » 6 years ago, # |   +6 I'd be 10 mins late if that didn't happen :p
•  » » 6 years ago, # ^ |   +7 i will be 10 min late because this happened :D
 » 6 years ago, # |   0 its time to revolution of delays . 2 hours !
 » 6 years ago, # |   +192  int n = 4000; cout << n << "\n"; for (int i = 0; i < n; ++i) { cout << "1000000 1000000 1\n"; } 
•  » » 6 years ago, # ^ |   +14 Pleople like me.
•  » » 6 years ago, # ^ |   0 Hope, that this thing will not be in system tests...
•  » » » 6 years ago, # ^ |   +24 No need to worry. It will because popular hacks are included to systests
•  » » 6 years ago, # ^ | ← Rev. 3 →   0 Input 6 3 1 1 1 3 2 10 4 6 1 1 2 1 1 2 1 1 14 Output 2 1 3 
•  » » 6 years ago, # ^ | ← Rev. 3 →   +17
•  » » 6 years ago, # ^ |   0 Someone hacked my solution with this test, but when I ran this program in my PC it gave correct answer. Strange but true.
 » 6 years ago, # |   0 so lucky contest for me )) -_- #rank666 #C hacked ...
 » 6 years ago, # |   0 C kills me today -_- how to solve C?
•  » » 6 years ago, # ^ |   +4 Just model everything in O(n^2).
 » 6 years ago, # | ← Rev. 2 →   -18 I really Liked the Div 2 Problems :) They were simple to understand and focused more on fast implementation :) My favourite contest so far :)
 » 6 years ago, # | ← Rev. 2 →   -32 I think that this round should be unrated for div 2.I was trying to specify a valid input in task B: 11In output specification there was no constraint that the 2 routes must be different (it was mentioned in the task only, but output specification is more important). And I was getting invalid input message.
•  » » 6 years ago, # ^ |   +13 Well you cannot make the whole contest unrated just because you did not read the problem statement properly. WTHThe output specification will mention what to print, not the whole problem statement.
•  » » » 6 years ago, # ^ |   -11 How can you solve the problem if not by printing what are you supposed to print? I think that the task B should be judged correctly without this information about 2 different routes but there was no explanation during the whole contest. Besides valid hack input was considered invalid.
•  » » » » 6 years ago, # ^ |   +14 It was clearly given n>=2.
•  » » » » 6 years ago, # ^ |   +1 The Sample Input Tests show you exactly what you need to print.Sample test(s) input 4 1 2 3 3 2 1 3 2 2 3 output 12Did you not see this ?
•  » » 6 years ago, # ^ |   +6 1 1 is not valid.2 ≤ n ≤ 50
•  » » 6 years ago, # ^ |   +8 The last sentence of the statement says : The boy would get bored if he had to walk the same way again, so he wants the way home to be different from the way to the store in at least one crossing.Read carefully next time, it's your fault.
 » 6 years ago, # | ← Rev. 2 →   0 I have no idea what goes wrong in my code for C. I wrote a checker for it and ran it on large stresstests, but it seems to work... yet, pretest 8.For the record, it's based on finding a correct pair of final states of both players using something like extended Euclid, then simulating backwards. The only bugs I have in mind are overflows and flipping A/B, but I thought I should've taken care of it.
•  » » 6 years ago, # ^ |   +27  string num; while(ans0[i].ss > 0) { num +=('0'+ans0[i].ss%10); ans0[i].ss /=10;} ans +=num; :)
•  » » » 6 years ago, # ^ |   0 Oh, reversing.
•  » » 6 years ago, # ^ | ← Rev. 2 →   +8 Could you describe your solution in more details? At first glance, for me it looked like simulating backwards, because I have seen similar problems, but it seemed to me that this is not a good approach here and it turned out that we can simulate it forward by using geometrical approach.However, whatever the simplest solution is, this problem seemed pretty hard to me, I'm kinda surprised that 92 people have solved it. Maybe I am missing something easy?
•  » » » 6 years ago, # ^ | ← Rev. 2 →   +11 You're missing that this is well-known problem. Here
•  » » » » 6 years ago, # ^ |   0 The link is not working
•  » » » » » 6 years ago, # ^ |   +3 Sorry, fixed.
•  » » » 6 years ago, # ^ |   +8 I found it pretty hard, too.I made a DP for x, y ≤ 100, found all the final pairs from which it's possible to make such (x, y) (of course, coprime, since two independent vectors will never give two collinear vectors) and noticed that there are exactly two such pairs, which give only one possible decomposition (let's call then (a1, b1) and (a2, b2); a1 + a2 = x, b1 + b2 = y).Then, I used my magical intuition, looked at a screen full of numbers and noticed that aky - bkx =  ± 1 (one sign for k = 0, the other for k = 1). ...because.Then, I noticed that adding one pair (a, b) to another (c, d) keeps the value ad - bc (cross product, basically) invariant: a(b + d) - b(a + c) = ab + ad - ba - bc = ad - bc. But that's not actually necessary (and a known identity for cross products).If I have this decomposition, reconstructing the game is easy — it's always just subtracting the smaller pair from the larger one and can be sped up with modulos, just like GCD.There's just one thing to watch out for: we may reconstruct the game in such a way that the final cross product is  - 1 — Alice starts with an apple. Which of the letters A,B we write depends on this.
 » 6 years ago, # |   +13 Implementation, implementation, implementation.
 » 6 years ago, # |   -16 You destroyed the contest by swaping C with D...
•  » » 6 years ago, # ^ |   -13 Div 1 or Div 2 ?
•  » » » 6 years ago, # ^ |   +8 Div1
 » 6 years ago, # |   +15 Just missed by few seconds for submitting working exponential solution for prob e.I hope my solution turned out to be WRONG when I will run on all test cases after system testing..otherwise I will regret whole day that I was not able to solve prob
 » 6 years ago, # | ← Rev. 3 →   +184 Look like the constraint checker for hacking of Div 1B is wrong. My friend used the test below and had 3 successful hacks: 1 5 3 ..A.. s.B.. ..C.. Although in the statement: "Each train consists of two or more neighbouring cells in some row of the field."
•  » » 6 years ago, # ^ |   +10 I spent the last ~20 minutes trying to code something that pass this case, and I failed -_- I have to read the statements more :'(
•  » » 6 years ago, # ^ |   +73 Yes, it also seems pretest 3 had trains of length 1. I couldn't pass it for half the contest..when I couldn't find bug in my solution I tried allowing such trains and it worked.
•  » » » 6 years ago, # ^ |   +34 Sounds like the contest has to be unrated. Apparently, I only passed due to randomly adding a lucky condition.
•  » » » 6 years ago, # ^ |   +46 My solution fails the above test with trains of length 1, but passed all pretests.
•  » » » 6 years ago, # ^ |   +46 Huh, how is it possible to use this condition in any way?
•  » » » » 6 years ago, # ^ |   +81 Checking that ith and i+2nd columns are free in given row
•  » » » » » 6 years ago, # ^ |   +20 So, the conclusion is "checking ith and i+2nd cols are free is OK because this case is invalid" ?
•  » » » 6 years ago, # ^ |   0 yeah, I use whole rest time to find bug in these problem. I hope it to be unrated.
•  » » 6 years ago, # ^ |   +25 Answer should be NO for this testcase, right? My solution prints YES, I am failing system test :(.
•  » » » 6 years ago, # ^ |   +20 This test is incorrect.
•  » » » 6 years ago, # ^ |   +23 The test is wrong, it should not be in system test. And it should not have been allowed in a hack.
•  » » 6 years ago, # ^ |   0 My code actually Passes this :)
 » 6 years ago, # |   +9 What was purpose of prob a and b...to test programming skills or English knowledge :)
 » 6 years ago, # |   0 Very interesting problems!
 » 6 years ago, # |   -41 Because of onsite competition, you will not be able to view other's submissions and test details for ~1 hour. Sorry for inconvenience.===По причине официальной олимпиады, около часа будут недоступны просмотр решений и тестов. Приносим извинения за неудобства.
•  » » 6 years ago, # ^ |   +120 What about systests?
•  » » 6 years ago, # ^ |   +31 Will we be able to submit our solutions and will the scoreboard be updated in the meanwhile?
•  » » 6 years ago, # ^ |   +24 А системное тестирование сейчас будет?
•  » » 6 years ago, # ^ |   +10 What time it will start system testing? It passed 1 hour and 2 minute. I'm still waiting.
 » 6 years ago, # |   +32 Rekt by long long again. I'm so dumb ;_;
 » 6 years ago, # |   0 Has anybody tried exponential solution for div 2 prob e..apple/orange...did system accepted it ?
 » 6 years ago, # |   0 Div 2 prob e..last test case "3 2" output was wrong
 » 6 years ago, # |   0 My rating will BOOM today!But the problems are really wonderful....I am too weak.....
 » 6 years ago, # |   0 I feel pretty silly. The constraints for 2D looked so small that I didn't even think about whether a naive recursive solution would time out. Next time, next time...
 » 6 years ago, # |   0 Pending system testing.............?
 » 6 years ago, # |   +1 still w8ing for system test !!!!
 » 6 years ago, # | ← Rev. 2 →   +3 Oh man, I feel so dumb T_T!, I spent a lot of time implementing a DP Overkill solution for div2B, and then I realized it was easier than that :(
•  » » 6 years ago, # ^ |   0 = = ..So do I :(
 » 6 years ago, # |   +159
•  » » 6 years ago, # ^ |   +26 MikeMirzayanov Sir already said the reason for the late System testing. So keep waiting and Be patience
•  » » 6 years ago, # ^ |   +8 The struggle is real, fellow doge.
 » 6 years ago, # |   +2 I´m so sleeping right now!!! ggg I hate starting in "unusual time"! Hurry up please :)
 » 6 years ago, # | ← Rev. 2 →   0 why does the system test still not get started now? is there any technical reasons?
•  » » 6 years ago, # ^ |   +13 MikeMirzayanov Sir already said the reason for the late System testing. So keep waiting and Be patience
•  » » 6 years ago, # ^ |   +6 Because of onsite competition, you will not be able to view other's submissions and test details for ~1 hour. Sorry for inconvenience.
 » 6 years ago, # |   +121 I highly suggest that all English problem statements should be read by someone who didn't know the problem before. That is a very easy way to prevent things like this (which are pretty severe of course):Btw of course lack of word "equal" is most important thing here, but even I am not able to produce sentence which is that bad as second one.
•  » » 6 years ago, # ^ |   0 I understood that the numbers are equal, because in this context if the numbers are even between them it means that the numbers are equal. I think it's proper english.
•  » » » 6 years ago, # ^ |   +8 But 'even' has a very clear mathematical meaning already. If anything, the incorrect interpretation is more valid than the intended interpretation.
•  » » » 6 years ago, # ^ |   0 Lol, I didn't even notice that possibility. It has some sense, but I assigned that "even" to "even after completing" not to "attitude" xD. I thought that this sentence completely lacks any meaning, even wrong one :P. And yes, what rnsiehemt said is also valid.
•  » » 6 years ago, # ^ |   +14 Well, I'm a bit sad I only have to read this now. First, I interpreted the 'even' as: "The total attitude for each character is even (i.e. not odd; divisible by 2)." This didn't work with the samples, so I decided it meant: "The attitude of each character is TOWARDS the hero, i.e., positive (or maybe non-negative, wasn't sure of that)."Most of the time these English errors aren't really a problem, but in this case, there are (at least) two other possible interpretations that make at least some sense. Also, the samples shouldn't be necessary to understand the problem, unless the problem explicitly refers to them.
•  » » » 6 years ago, # ^ |   0 I had the same interpretation! All attitudes to be positive.
 » 6 years ago, # |   +5 what a wonderful contest,but my rating is still falling...
 » 6 years ago, # |   +37 The-One-Who-Must-Not-Be-Named = Lord Voldemort ??? :O :S
 » 6 years ago, # |   +22 I have been waiting for one hour in nervous. Could systests be quicker?
 » 6 years ago, # |   +3 why still waiting for system test? what is happening?
•  » » 6 years ago, # ^ |   +18 UPD: In problem Subway roller there were tests with trains of length one. At this moment authors are discussing how much it troubled the round results. We are apologize to participants who had problems with that. We will announce our decision about this problem soon.
•  » » » 6 years ago, # ^ |   -16 Hey even output of test case "3 2" of Div2/Prob. E was wrong
•  » » » 6 years ago, # ^ |   +3 I spent last 20 minutes of competition looking for one error due to "Wrong answer on pretest 3" ... now I´m guessing "this is the reason"!!!
•  » » » 6 years ago, # ^ |   +2
 » 6 years ago, # |   +8 I really beg that the data about trains of length one could be canceled. After all,the problem says that length>=2.
•  » » 6 years ago, # ^ | ← Rev. 2 →   +6 But some people waste time on this problem.So I hope this contest will be unrated.
•  » » » 6 years ago, # ^ | ← Rev. 2 →   +50 No No No DONT DO THAT. Its not fair for everyone else who worked so hard.
 » 6 years ago, # |   +8 I think it's better to be unrated.
•  » » 6 years ago, # ^ |   -25 Agree.
•  » » 6 years ago, # ^ |   +34 Both rated and unrated are OK, I don't like "partly unrated".
•  » » » 6 years ago, # ^ |   -13 Why don't you?
•  » » 6 years ago, # ^ |   0 Agree.
•  » » 6 years ago, # ^ |   +10 Rated is okay:-),but it's to slow......
 » 6 years ago, # |   +26 It would be overkill to not rate the whole competition because of this issue. Yes, some people may have wasted time which would create some noise in the end results, but I think the signal (from a signal processing perspective) would still be very strong. This would at least apply to Div 2 where this was problem D.
•  » » 6 years ago, # ^ |   -9 Agree making the whole contest unrated because a few people couldnt solve D is just sad.
 » 6 years ago, # | ← Rev. 2 →   +39 I have spent my whole evening waiting for the system test hungry and nervous :(
•  » » 6 years ago, # ^ |   +5 If this contest started at 0:30 as usual and get a problem like this...
•  » » » 6 years ago, # ^ |   +7 Oh I can't stand it >.<
 » 6 years ago, # |   0 How long will the system testing take???
 » 6 years ago, # |   +11 Div2F's time limit is so strict :(
 » 6 years ago, # |   +32 The scoring distribution will be anounced a little before the round. :D
•  » » 6 years ago, # ^ |   +10 Lol.!! Hahaha :D
 » 6 years ago, # | ← Rev. 2 →   +26 contest is rated or unrated nothing matter to me . But as some people has issue with some problems its better to arrange a complementary contest very soon :D As its Regional time everywhere , everyone should be happy to participate more contest :) btw am i the only one who have trouble to understand the problem statement clearly :( . Hope for a better translation next time .
•  » » 6 years ago, # ^ |   +12 yeah the statements were not clear and u had to read the problem 3 4 times to understand it
•  » » 6 years ago, # ^ |   +51 Yes, statements were bad today.
•  » » » 6 years ago, # ^ | ← Rev. 3 →   0 Am I the only one who misinterpreted B?With regards to this statement: "First, the hero moves one cell to the right, then one square up or down, or stays idle."I interpreted it as: either moving right and down, moving right and up, or staying still. Apparently it passes given pretests but not pretest 4.
•  » » » » 6 years ago, # ^ |   0 That is rough. I had not considered that interpretation, but I can see how you could be misled. For me the use of 'First,' clarified the meaning, because this indicates there are at least two steps to a move, while under your interpretation there is only one step (of two possible). But I commiserate!
 » 6 years ago, # | ← Rev. 3 →   +46 To be rated or not to be this is problem !
 » 6 years ago, # |   +22 Does anyone have any predictions for the start of system test?
 » 6 years ago, # |   -17 Consider those people as out of competition who got wrong answer in that problem for train length 1
•  » » 6 years ago, # ^ |   -6 this idea kinda sucks :)
•  » » » 6 years ago, # ^ |   0 Agree... what if you solved all the problems except D, or if you have a high rating in the contest even without solving problem D.
 » 6 years ago, # |   +4 I must go to sleep now,but system test doesn't start,so I can't wait for it today.
•  » » 6 years ago, # ^ |   +40 You might wake up before it starts
 » 6 years ago, # |   -6 Also the explanation of sample test in div2 problem d was wrong initially so i don't think rating this round will be fair for someone who wasted his whole time reading the problem statement again and again.
 » 6 years ago, # | ← Rev. 3 →   -35 Also I had pp ABCDE in div.2, but I also want it unrated. Cause if not, there will be a godlike people called yuts will be nearly driving me mad!
 » 6 years ago, # |   -71
 » 6 years ago, # | ← Rev. 2 →   +22 This round should be unrated for several reasons: Many people got Wrong Answer on problem A because of unclear statement(before the announcement). In testcases of B there was train with size 1. Statements (specially for D) were very very unclear. My solution for A will fail the system tests :(
•  » » 6 years ago, # ^ |   +52 4th is the best reason.
•  » » 6 years ago, # ^ |   +1 Sorry for 4.but glad to know that im not the only one who was troubled by the statements...
•  » » 6 years ago, # ^ |   +21 Only the forth reason is your thinking I guess. -v-
•  » » 6 years ago, # ^ |   -172 I think this round should be rated.All the problems & test for everyone is equal..If your solution can not deal with the train of size 1, your solution may not good enough~~
•  » » » 6 years ago, # ^ | ← Rev. 2 →   +9 This suck ... you simple make your code assuming that trains with size 1 are not in the input.If solution fails, then you spent a lot of time looking for some mysterious error in your solution before you can imagine that limits are wrong and none one noted it during preparation.UPD: I thinks that contest should be rated for DIV2 contestants, after removing cases for DIV2-D problem which should not be used originally. I guess that all solutions accepted will remains the same.
•  » » » 6 years ago, # ^ |   +61 " If your solution can not deal with the train of size 1, your solution may not good enough~~ "
•  » » » » 6 years ago, # ^ |   -91 Different standpoint between pure ACMer and worked people.
•  » » » » » 6 years ago, # ^ |   +95 Statement: "Program should read two integers up to 1e9 and print their sum."Your program: "int a, b; scanf(a, b); printf(a + b);"Verdict: WA for test "1e500 1e500". Your program was not good enough and doesn't deal with big integers.
•  » » » » » » 6 years ago, # ^ |   -92 "may not" in my statement.I'm just kidding. Why you are so serious..
•  » » » » » » » 6 years ago, # ^ |   +84 So we may not like your sense of humor.
 » 6 years ago, # |   0 can anyone tell me why a naive memorized recursion solution for Div2 D / Div1 B will TLE?
•  » » 6 years ago, # ^ |   0 it wont
•  » » » 6 years ago, # ^ |   0 If you handle all the cases properly it won't get tle.
 » 6 years ago, # |   +6 I have to go to sleep now,and I hope I can see "Finished" tomorrow morning.
 » 6 years ago, # |   +6 Please, rated or not, just run system tests.... this delay kill me....
•  » » 6 years ago, # ^ |   +6 Same here!
 » 6 years ago, # |   +6 well well well :D RIP System Test -_-
 » 6 years ago, # |   0 What is happening? When will the system testing be done?
 » 6 years ago, # | ← Rev. 3 →   0 Problem D: Rejudging
 » 6 years ago, # |   +1 when will the solutions be judged ?? it's already 3 hrs since the contest has ended...
 » 6 years ago, # |   0 How to solve Div 1 C?
•  » » 6 years ago, # ^ |   +7
•  » » 6 years ago, # ^ |   +4 Dont know if my solution is right, but i ran a brute force for small input and observed a pattern in the output based on which i observed the following while(true) { ll mi = min(x,y),ma = max(x,y); if(ma%mi == 0) { ll times = ma/mi - 1; cout<y) cout<<"A"; else cout<<"B"; return 0; } ll times = ma/mi; cout<y) cout<<"A"; else cout<<"B"; ma = ma%mi; if(x>y) { x = ma; y = mi; } else { x = mi; y = ma; } } Also, if the gcd of A and B is greater than 1, then its Impossible.
 » 6 years ago, # |   +15 I think rating is not very important. What is important is to test yourself and compare with others.
 » 6 years ago, # |   +17 After The Second Revolution of Colors and Titles, now we got the First revolution of delay in system test... :)
 » 6 years ago, # |   +23 What happened to tests in Div2 D? They changed the pretests !!!(I had pretests passed before, now wrong answer on pretest 4). I think that this is something unjust because if I had seen the WA4 I might have corrected my solution! I know that with this my program would have failed the system tests (or maybe not because that means changed tests, who knows what it would have been), but still — changing the pretests after the competition ends?
•  » » 6 years ago, # ^ |   +4 The same here. But I guess it's some mistake. Let's say these added tests are normal tests, not pretests. Then everything is ok, right? So it's only a matter of naming.
•  » » 6 years ago, # ^ |   -13 I think they are running pretest with train of size 1. This is not fair as it is clearly mentioned in the problem statement that train size can be 2 or more. Either rejudge this problem or cancel it.
•  » » » 6 years ago, # ^ |   0 Nothing reveals that they are testing size 1...
•  » » » » 6 years ago, # ^ |   0 I am assuming that because my code didn't handle train size 1 case.
•  » » » 6 years ago, # ^ |   +17 They are probably trying to detect how much the messed up pretests affected the whole competition to make a decision. Don't worry about those pretests, just wait for systest.
•  » » 6 years ago, # ^ |   +20 We updated tests and made pretests to be equal to tests. After it we rejudged all attempts and chosen the first passed pretests (that means system tests because they became equal). This trick helped to accept all submissions which are correct. As a side-effect you can see now "Wrong answer on pretest X" rather than before system tests you saw "Pretests passed". It means that your solution anyway would fail on system tests.
 » 6 years ago, # |   +19 !!
•  » » 6 years ago, # ^ |   +3 Run for the hills!!!
•  » » 6 years ago, # ^ |   0 :-|
 » 6 years ago, # |   0 I got pretests passed during the contest for Div 1 B, but now it says that I failed pretest 8. So did the pretests change or something?
 » 6 years ago, # |   +3 Atlast the systest !!! :|
 » 6 years ago, # |   +1 Is there any change on pretest 8 on problem B div 1? My code went WA and I think it's little unfair to regrade the pretest after the end of the contest, x(
 » 6 years ago, # |   0 Why the problem D which I passed the pretest before but I got a "Wrong on pretest 4" in the system test?
•  » » 6 years ago, # ^ |   0 Testcases in contest were incorrect, so they were replaced.
•  » » » 6 years ago, # ^ |   0 so will it be unrated contest?
•  » » » » 6 years ago, # ^ |   +22 I hope no
•  » » » » » 6 years ago, # ^ |   0 Me too !!
 » 6 years ago, # |   0 I got a good rank after a long time. Now I'm sure this round will be unrated :P
 » 6 years ago, # |   +5 So good problemset, so sad trouble..
 » 6 years ago, # |   +13 In my opinion, the problems themselves were very good, but some of the statements required more scrutiny.Also, yay — after two failed GCJs, one failed FBHCup and who-knows-how-many failed CF rounds — I didn't trip on 64-bit integers.
•  » » 6 years ago, # ^ |   0 You code in C++. Why then you can't use #define int long long to prevent int overflows?
•  » » » 6 years ago, # ^ |   +8 Because this is (in my opinion) not good style. Also, what if you want to define a potentially very large int vector? (Such that 4x as much would exceed the memory limit)
•  » » » » 6 years ago, # ^ |   0 I had MLE only 2-3 times in total, and none of them was on the contest. They were because of algo, not because of the macro. Also, it's way too easy to get tripped with int overflow.
•  » » » » » 6 years ago, # ^ |   +40 It's better to improve skill, rather than using hacks to hide your imperfection.Btw, I can guarantee you that I have used > 1/2 memory limit of problems dozens of time, which would lead to MLE if I use #define int long long
•  » » » » » » 6 years ago, # ^ |   -29 Hacks? Oh, really? Competitive programming is about algorithms, not about paying attention to everything (and this "skill" can't be improved, I suppose).
•  » » » » » » » 6 years ago, # ^ |   +13 Of course this skill can be improved. It is just 1 amongst dozens of stupid things that can make you fail stupidly, e.g. wrong array bounds, mixup variable names, forgot to memset... Train yourself to pay more attention will solve everything.
•  » » » » » » » » 6 years ago, # ^ |   0 Actually, I avoided int overflow trap two times during last 4 contests, so it could be two another fails instead of wins. It's a large trap comparing with other ones. May be, I'm too old, but my attention is my greatest weakness(and, therefore, implementation, I like math problems) and I did not found it improved last two years.
•  » » » » » » » » 6 years ago, # ^ | ← Rev. 2 →   +6 "Next time be more careful" is worst conclusion ever you can draw from problem failed because of a bug. Better question is "What can I do to prevent this in future, so that I don't have to worry about this anymore?". I have created habits which prevent me from failing a problem for every particular reason you mentioned :).And btw I am a huge fan of #define int long long and I can confirm that it saved me definitely much more times than it caused any harm.
•  » » » » » » » » » 6 years ago, # ^ |   0 Agree. So, I am trying to prevent bugs, and the best way is to don't allow the bug appear technically. For example, use long long macro or insert sync with stdio in your code template.
•  » » » » » » » » » 6 years ago, # ^ |   0 No, it's not as simple as what you put "next time be more careful". I believe in "training yourself in most difficult conditions, so you can become perfect". And IMO making yourself believe that you don't have to worry about basic stuff will just slowly make you lose the level of attention needed.Of course, my belief is probably biased because I was trained by people who could write hundreds lines of code without any bug thanks to perfect attention & other people who could find bugs with just reading code (i.e. no printing stuff / debugger).
•  » » » » » » » » » 6 years ago, # ^ |   0 I simply don't believe that it could be trained, at least simply by writing more and more programs. Across 6 years of my experience in CP I managed to make less bugs, but that is because my programming skills improved a lot and I think my attention didn't improve at all.
•  » » » » » » » » » 6 years ago, # ^ |   0 Yeah, it can't be trained simply by writing more code, so we have tricks & habits for attention too :)
•  » » » » » » » » » 6 years ago, # ^ |   0 http://www.youtube.com/watch?v=Ahg6qcgoay4That's the problem. People's attention is limited(especially mine) and majority of people just can't focus on big amount of things. I think, you and your trainers are among the minority. What you advice to do for all other people? Find a mistake and abandon to correct it forever? Such approach never will lead to perfection. I like to feel proud because of fast creative elegant solutions, not because of paying attention to tricky moments. I suppose, the majority of competitive programmers are the same. If you are going to play on attention you can find a lot of another games or sports.
•  » » » » » » » » » 6 years ago, # ^ |   0 I'm glad that this has sparked a constructive debate on approaches.Honestly, I wasn't trying to say that all approaches other than mine are "wrong". I just find the presumption that whenever I write "int" I could as well have written "long long" to be wrong — exactly for the reasons I_love_Hoang_Yen given — and that's why I would never write that as part of a fixed template.I even used to take the "more hacky" approach myself early on. Now I'm less of a competitive programmer, more like a computer scientist who likes to keep his algorithmic skills somewhat polished. :)
•  » » » » » » » » » 6 years ago, # ^ |   0 Interesting. I think my attention / focus on coding has been improving along competitions. In fact, once I told myself that I'll pay more attention to what I'm writing and not just think that whatever I write is going to pass, because it can lead to a lot of penalty during ACM-style contests, and I think it worked.I've noticed that I have less trouble competing with a lot of activity around me than before after competing more often in such conditions (also, after generally competing more often). It's really that I pay more attention to what I'm doing and not to what joke someone around me is telling or how my place on the scoreboard could be changing.I'd say it varies from person to person; some people may have an easier time training meta-thinking than others. And it definitely depends on what one's actually tried.
•  » » » » » » 6 years ago, # ^ |   -8 It's not a hack at all because everyone can use that even in ACM
•  » » » 6 years ago, # ^ |   0 Because of time and memory.Long longs are much more fat and much more slow to process.
•  » » » » 6 years ago, # ^ |   0 I have used this macro for a long time with C++. But then I decided to use C# and I wrote special "longificator" that substitutes all ints with longs int C# program. I had not problems with time and memory because of it with C++ and even with C#.
 » 6 years ago, # |   +8 What's wrong with div 2C? Quite a lot of people(including me) got WA on main test 12... :|
•  » » 6 years ago, # ^ | ← Rev. 3 →   0 I failed on that test because I didn't really remove the patients from the queue, resulting in that v_i decreases faster than it should. I fixed it by checking if the patient has been removed from the queue.
•  » » 6 years ago, # ^ |   0 Did you use 64-bit integers (long longs) to store intermediate values?
•  » » » 6 years ago, # ^ |   0 No :| was that the reason?
•  » » » » 6 years ago, # ^ | ← Rev. 2 →   0 Probably — the sum of all loudness levels could exceed the range of 32-bit integers.
•  » » » » 6 years ago, # ^ |   +3 That too. But you also did not remove children not from the beginning of the queue.
•  » » » » 6 years ago, # ^ | ← Rev. 3 →   +3 I have hacked 8 solutions which were not removing kids from the queue but tripped on 32-bit overflow myself :) Arghhh :)
•  » » » 6 years ago, # ^ |   0 Stupid me: noticed the possible overflow but decided to keep using long and bound the confidence decrease. long sum_d = 0; /* be careful, don't let it overflow */ for (int j = i+1; j < N; j++) { if (gone[j]) continue; p[j] -= sum_d; if (p[j] < 0) { gone[j] = 1; sum_d += d[j]; if (sum_d > maxV) sum_d = maxV + 1; /* XXX p == 0 won't make the kid run */ } } However, I forgot the +1...
•  » » 6 years ago, # ^ |   +12 5 3 1 10 3 1 10 1 5 1 1 1 5 1 1 8 output 2 1 2 You should remove patients from the queue when they cry, because then the crying from the cabinet can affect someone behind him, which was not affected before his removal.
 » 6 years ago, # | ← Rev. 7 →   -12 Div1D was a nice problem! Thank you for these interesting problems.
 » 6 years ago, # |   +3 What?? This contest will be rated?? Really?
 » 6 years ago, # |   +3 Wow, the slower goes systesting, the faster goes the rating change!
 » 6 years ago, # |   0 in div 2 pC it says vi, di, pi (1 ≤ vi, di, pi ≤ 10^6)whats the problem when i use int to store these numbers?
•  » » 6 years ago, # ^ |   0 the problem is when u add 4000 numbers each up to 10^6 which is 4e9
•  » » » 6 years ago, # ^ |   0 i used minus, but it would also cause overflow then. nice trap
 » 6 years ago, # |   +27 The next time I compete, I'm going to get +4 rating.
•  » » 6 years ago, # ^ |   +2 The Volatility has reduced a lot. In a way a good thing as well. We wont loose our hard earned rating by a few bad performances.
 » 6 years ago, # |   0 first two-digit rank for me!
 » 6 years ago, # |   0 Why are there only 9 people mentioned as writers of this contest and not all 16? :D
 » 6 years ago, # |   0 It's crazy that I got a 'pretests passed' for Div2D during the contest and now what I see is that WA on pretest 4.Anyone having the same problem?
•  » » 6 years ago, # ^ | ← Rev. 3 →   +16
•  » » 6 years ago, # ^ |   0 Assume pretest 4 after system test was a main test during contest and everything it's OK. :)
 » 6 years ago, # |   0 Can anyone help me debugging my [submission:13576753]solution for Div2 C?
•  » » 6 years ago, # ^ | ← Rev. 2 →   0 they should cry when p < 0 not when they are [ (going to see the dentist) and p < 0 ]
 » 6 years ago, # | ← Rev. 6 →   +1 Div 2. Problems A and D solved using regexes: A — 13557081, D — 13577562 (shorter version 13577591)
 » 6 years ago, # |   0 any editorial ?
 » 6 years ago, # |   +1 Could someone give me D div 2 test 3 third testcase fully, I just can't understand what's wrong with my code, thanks in advance
•  » » 6 years ago, # ^ |   0 Test on 2 3 0 ... s.. ... 3 3 AAA sBB CCCAnd fix :3
 » 6 years ago, # |   0 I am happy to see that my relative movement is succeed in Div2.D .I just make the hero 3 steps/second ,and judge during the move:D
•  » » 6 years ago, # ^ |   +8 I wonder what the usage about the number of trains. = =
 » 6 years ago, # |   +3 Link for editorial is invalid, it should be http://codeforces.com/blog/entry/20898 rather than http://codeforces.com/blog/entry/blog/entry/20898.
•  » » 6 years ago, # ^ |   0 Fixed. Thanks.
 » 6 years ago, # |   +14 ¸NICE ROUND!!!!!!!!!!!!!!! VERY NICE PROBLEMS
 » 6 years ago, # |   0 I think alongside the contest, there should be another way to judge a person's ability or rating, not by the number the acmer accepted, but the number of hard problems the acmer accepted, or the average difficulties, one friend of mine is the best coder I ever see, he is not a quickhand, but he can always solve the hardest problem of a contest, his id is Los_Angelos_Laycurse ,you can checkout the problems he solved. for example http://codeforces.com/gym/100725/attachments Problem J, and his solve it.13485846
 » 6 years ago, # |   -7 nice problems
 » 6 years ago, # | ← Rev. 6 →   0 Really nice Div1 E! Haven't solve it during the contest and figure out what's wrong in my solution now. Wait to submit it.Oops, WA on #5.Got it right finally.Just found I post these at a wrong post, LOL.