Perhaps today and/or tomorrow due to a power outage there may be disruptions in the work of Codeforces and Polygon. Please do not plan any important events during this time. If there are details or the exact time, we will definitely publish them. ×

### Igor_Kudryashov's blog

By Igor_Kudryashov, 9 years ago, translation,

Good afternoon, friends)

We introduce you Codeforces Round #126 (Div. 2). Please note, Codeforces Round #126 (Div. 2) will be only today and only today you will have unique opportunity to raise your rating in this competition (certainly, you will be able to solve problems virtually after round, but this doesn't change your rating). Also round will be unrated for participants from first division.

This round was prepared by students of Saratov State University: Nicolay Kuznetsov (NALP), Pavel Kholkin (HolkinPV), Igor Kudryashov (Igor_Kudryashov) and Gerald Agapov (Gerald). Also we thank creator of Codeforces Michael Mirzayanov (MikeMirzayanov) for amazing system, member of staff of Codeforces Mary Belova (Delinur) for great translation and Alexander Kuprin (Alex_KPR) for help in preparation of this round.

Also problems will be placed in random order, it means they aren't sorted in increasing order of difficulty.

More right ideas and fine solutions to you.

UPD. Competition is over. Thanks for all who participated. We hope you enjoyed the participation, and round not passed in vain. Editorial will be posted soon. Congratulations to the winners:

• +104

 » 9 years ago, # |   +12 I didn't find how many problems we'll have in contest . |-(((
•  » » 9 years ago, # ^ |   -20 as usual
 » 9 years ago, # |   -33 wow.. this is the 200th contest on codeforces(taking Div-1 Div-2 separtely) .. Kudos to the Codeforces family :) : )
 » 9 years ago, # |   -10 I dont know why I am getting the runtime error on pretest 1 for Problem D. I was getting correct answers in my system which works with EgorK's plugin. .Somebody please see my code and tell me where I was wrong
•  » » 9 years ago, # ^ |   0 Use this link.
•  » » » 9 years ago, # ^ |   0 I changed and used BufferedReader instead of Scanner and it got accepted .. code
•  » » 9 years ago, # ^ |   +9 http://www.codeforces.com/blog/entry/4696#comment-95880You're repeating the same bugs, with almost two similar input formats :SYou have a bad memory, Dude!
•  » » » 9 years ago, # ^ |   0 But I did not understand that comment as why it is happeneing.. Could you please explain it.
 » 9 years ago, # |   0 Hm, no AC for A problem in Java? What was the idea?
•  » » 9 years ago, # ^ |   0 I didn't solve it at the end, but my idea was to register the number of filled seats for every diagonal in a Fenwick Tree. This would give me the number of filled seats at a distance d from the preferred position in logarithmic time for every d.With that value I can check if there is a free spot at minimum distance, and then just look for it with brute force.This would give a O(log(n) n k) algorithm, I guess it should fit in time.
 » 9 years ago, # |   0 What about constraints for problem C? I really think problems should be written more carefully.
•  » » 9 years ago, # ^ |   0 The names of teams team1 and team2 are non-empty strings, consisting of uppercase English letters, with length of no more than 20 characters; goals1, goals2 are integers from 0 to 9. What else do you need?
•  » » » 9 years ago, # ^ |   0 Man, I don't even see that in the statement!
•  » » » » 9 years ago, # ^ | ← Rev. 2 →   0 There are less than 10 lines on the part "Input", are you kidding me?
•  » » » » » 9 years ago, # ^ |   +1 Hehe, my bad. Somehow I missed that part. Should not compete after a bad last night, I guess.
•  » » » » » » 9 years ago, # ^ |   0 Np ;)
 » 9 years ago, # |   0 Can someone tell if the testcase 9 for problem A was 2000 2000 100000 and then 100000x 552 1028or were there also some different chosen seats?thanks
•  » » 9 years ago, # ^ |   +4 No. The 66668th is 551 1028. You can see my submission: 1830110
•  » » » 9 years ago, # ^ |   +5 :) nice idea, thank you very much
 » 9 years ago, # |   0 Did O(nklog n) worked for problem A. I wrote O(n*n*n) and got TLE. I figgured out O(nklog n) but did not have time to finish during contest. Is there a better way?
•  » » 9 years ago, # ^ |   0 K*(N+M) may work in time.
•  » » » 9 years ago, # ^ |   -12 мы старались завалить любое такое решение :) авторское имеет время
•  » » » » 9 years ago, # ^ |   -13 Плохо старались значит:) Думаю, что такое легче было валить ограничениями, а не тестами. Как не крути — 2*10^8 на КФ за 3 секунды работает. Мое решение зашло за полторы.
•  » » » » » 9 years ago, # ^ |   -12 ну миллион неправильных решений не угадаешь... а ТЛ как всегда ставится с запасом, ведь уж лучше пройдет так, чем не пройдет правильное, но не очень аккуратно написанное решение.
•  » » » » » » 9 years ago, # ^ |   +15 come on! You're writing in russian and the people still giving u points?? Wow... red is a powerful color!!!
 » 9 years ago, # |   0 someone could tell me how giving this input for the problem C and why?EIYLBZCLPBGXJRT BERLAND 7:9 MWVSPZD BERLAND 4:7 MWVSPZD EIYLBZCLPBGXJRT 4:8 VRGN EIYLBZCLPBGXJRT 3:6 VRGN MWVSPZD 6:0sorry by my english
•  » » 9 years ago, # ^ |   0 X > Y, that is, Berland is going to win this game; X must be greater than y
 » 9 years ago, # |   -15 I think Problem C Div 2 is incomplete .. The problem only asks to find the min (X-Y) but does not specifies that X should be as less as possible.. For eg: In test case 1-> ans is 6:0 but what if I give 50:44 . I got a WA because of that
•  » » 9 years ago, # ^ |   +1 No, You are wrong: "if it is still impossible to come up with one score, you should choose the score where value Y (the number of goals Berland misses) is minimum."
•  » » » 9 years ago, # ^ |   0 Sorry .. my bad
 » 9 years ago, # |   0 When will the editorial be uploaded
 » 9 years ago, # | ← Rev. 4 →   -11 hacked by hackers
 » 9 years ago, # |   0 When will the editorials be posted?
•  » » 9 years ago, # ^ | ← Rev. 2 →   0 here: http://codeforces.com/blog/entry/4769 edit. fixed link
•  » » » 9 years ago, # ^ |   0 Sorry, but I asked when not where.
•  » » » » 9 years ago, # ^ |   0 my bad, wrong link http://codeforces.com/blog/entry/4769
•  » » » » » 9 years ago, # ^ |   0 Ok, thanks man. It seems this link is not so visible as it was supposed to be.