### Berezin's blog

By Berezin, 8 years ago, translation,

Hi! Soon Codeforces Round #234 (Div. 2) will take place, i am the author, Dmytro Berezin :)

Thanks to Gerald Agapov (Gerald) for the help in round preparation, Maria Belova (Delinur) for tasks translations, Mike Mirzayanov (MikeMirzayanov) for perfect system, and Sergii Nagin (Sereja) for his agreement (to share his evening with me) to help in testing.

Distribution will be announced as soon as found :) Standard :)

Good luck!

• +121

 » 8 years ago, # | ← Rev. 4 →   0 Sorry for my bad english.:D
•  » » 8 years ago, # ^ | ← Rev. 2 →   -11 "didn't" happen again !
•  » » 8 years ago, # ^ | ← Rev. 3 →   0 Hope that accident like in the last contest won't happen again. :)
•  » » 8 years ago, # ^ |   -8 You right
 » 8 years ago, # |   +1 This is the first round after CF crashed, I'm very excited with this round, also number 234 have several nice coincidence with primes numbers!!!! I Hope be a good round for everyone!!! let's go to upgrade ranking!!! Good luck to everyone!!J
 » 8 years ago, # |   +18 Glad to see Codeforces back on its feet.
 » 8 years ago, # | ← Rev. 2 →   0 This is my first contest on codeforces,I like ACM. I think it will be successful for me. Good luck for everybody!!!
•  » » 8 years ago, # ^ |   0 Same feel :)
 » 8 years ago, # |   0 Wish to become Candidate Master again.
•  » » 8 years ago, # ^ |   0 Hope codeforces don't be such a problem again.After all,I really like it.
 » 8 years ago, # |   +3 After accident ,i think problems in round will be about crash of the system. Good luck for everybody "Fixing" the system.
 » 8 years ago, # |   +7 Last contest people here were saying that 233 is a very lucky number and the website crashed. Stop saying "hope the contest will be lucky". Anything that you say will not affect the contest.
 » 8 years ago, # |   -9 I scare we will lost CF forever. Sorry Mike but all thing can happen. Just try all your best, Mike.
 » 8 years ago, # |   +17 in russian version of this blog it is written "to share delicious potatoes and becon with me" instead of "evening", also there is "potatoes" among the tags (prooflink)maybe this will help you solve more problems during contest, gl :)
•  » » 8 years ago, # ^ |   +8 That would only happen if VK servers will fail too.
 » 8 years ago, # |   +27 Distirbution Distribution will be anounced announced as soos soon as found decided
•  » » 8 years ago, # ^ |   +16 Thank you, sorry for that typos. "Found" was a small joke about lost distribution :)
 » 8 years ago, # |   +1 Hope this contest would be about Inna and Dima. :)
•  » » 8 years ago, # ^ |   0 Guess your wish came true :P
 » 8 years ago, # |   0 Dark week of codeforces ending after 234(round)2(div) seconds...
 » 8 years ago, # |   -17 hellow world!! good luck for all
 » 8 years ago, # |   -8 Problem B: simultaneously instead of simulaneously. Please fix it.
•  » » 8 years ago, # ^ |   -7 I cannot distinguish between these two words. :D
•  » » » 8 years ago, # ^ | ← Rev. 5 →   0 simultaneouslysimulaneously (t is missed)
•  » » » » 8 years ago, # ^ | ← Rev. 2 →   +1 simul-t-aneously vs simul-aneously
 » 8 years ago, # |   0 Problem D: The way with number i can be described with integers ui, vi and xi mean that this way allows moving energy from bacteria with number ui to bacteria with number vi or vice versa for xi dollars.ui can go to vi with xi dollars. Does it mean vi can go to ui with xi dollars?
•  » » 8 years ago, # ^ | ← Rev. 2 →   +1 I think so. That is what "vice versa" means, I guess.
•  » » » 8 years ago, # ^ |   0 Yeah, and the problem didn't say whether ui,vi <= n. Actually, it should describe clear this point.
 » 8 years ago, # |   +7 i submitted peoblem B wrongly 3 times before the announcement was made. will i get +150?
 » 8 years ago, # |   -7 Easy problems.
•  » » 8 years ago, # ^ |   +29 Especially the two which you couldn't solve, right? :D
•  » » » 8 years ago, # ^ | ← Rev. 2 →   +16 Yes! :D
 » 8 years ago, # |   +2 A sad day for hackers :(
 » 8 years ago, # |   0 Problem B solution, before the announcement is NP-Complete ?!
•  » » 8 years ago, # ^ |   0 Yeah, i think so
•  » » 8 years ago, # ^ | ← Rev. 5 →   -8 first i will answer ur question. no, it is still solvable in . i solved it well before the announcement was made (albeit after one wrong submission due to problem statement not being very clear).the problem asked to find minimum number of moves, and we can easily observe that choosing all rows where dwarf has not yet reached candy is the minimum answer. so i don't think the announcement really changed anything about the solution. in fact it just gave us a hint as to how to solve the problem.EDIT: sorry, my mistake! please ignore this post!
•  » » » 8 years ago, # ^ | ← Rev. 2 →   +32 Wrong, consider example: G....S G.S... G..S.. The minimum number of moves is 2, not 3.
•  » » » » 8 years ago, # ^ | ← Rev. 3 →   0 i don't think u understood the problem correctly. in each move, the player must choose a set of rows and move the dwarf in all these rows to the right, until one of them reaches the candy (or the end of row).EDIT: sorry, my mistake. i couldnt visualize ur example properly when i wrote the original comment as it wasnt displayed like a matrix then.
•  » » » » » 8 years ago, # ^ | ← Rev. 2 →   +1 That's right, and we can do it in two steps: rows 1 and 2; rows 1 and 3.
•  » » » » 8 years ago, # ^ |   0 I think you are wrong the answer is 3
•  » » » 8 years ago, # ^ | ← Rev. 2 →   +9 look at this sample :3 7 ....G.S..G...SG.....Sby your algorithm answer is 3 but answer is 2.
•  » » » 8 years ago, # ^ | ← Rev. 3 →   0 I don't think so. Consider this test case: 3 4 G**S *G*S **GS Before the announcement, the optimal way to play will be to pick row 1 and 3 in the first move, thus "eating" the candy on the third row and changing the first row to be the same as the second row. Then pick row 1 and 2 in the second move. The answer is 2.But after the announcement the answer is clearly 3.I also wasted a lot of time because of this problem.
•  » » » 8 years ago, # ^ |   +4 That's not true. For example, consider the testcase: 3 4 **GS *G*S G**S The optimal solution is to choose row 1 and 3 in the first move and then rows 2 and 3 in the second.
•  » » 8 years ago, # ^ | ← Rev. 5 →   +1 Official test from task B : 4 8 G*S***** ****G*S* G*****S* **G***S* Answer: 3But the answer is 2: firstly choose 3 and 4 lines, then 1,2,3.
 » 8 years ago, # |   +4 Announcement for B problem was too late i thought every step is move not every "lets go " is a move !
•  » » 8 years ago, # ^ |   -26 I solved problem C, D, E first.
•  » » » 8 years ago, # ^ |   +10 & ?
•  » » » 8 years ago, # ^ |   +4 who cares!
•  » » » » 8 years ago, # ^ |   -9 You apparently care enough to post a response.
 » 8 years ago, # |   +10 The problem statement for Problem B was corrected too late.
 » 8 years ago, # |   0 Impressed with amazing testing speed
•  » » 8 years ago, # ^ |   0 Testing does not have unusual speed... The speed you see is because of low number of submissions...
•  » » » 8 years ago, # ^ |   0 but there were many users registered :/
•  » » » » 8 years ago, # ^ |   +3 Just 1800 of them participated...
 » 8 years ago, # |   +15 Was it just me or were the problem statements this time pretty difficult to understand (in English)?
•  » » 8 years ago, # ^ |   +4 I spent long time in understanding problem D
•  » » 8 years ago, # ^ | ← Rev. 2 →   0 especially problems B and D!
 » 8 years ago, # |   0 In problem D can someone explain why the answer for 7 test "yes"?
•  » » 8 years ago, # ^ |   +3 There is only one bacteria for each type. So all bacterias in one type can gain energy with cost = 0 from a bacteria with same type .
•  » » » 8 years ago, # ^ |   0 "Dima's Chef (Inna) calls the type-distribution correct if there is a way (may be non-direct) to move energy from any bacteria of the particular type to any other bacteria of the same type (between any two bacteria of the same type) for zero cost."there is 0 operation,so bacterias can not move energy from any bacteria to any other bacteria,am i right?
•  » » » » 8 years ago, # ^ |   0 ...to any other bacteria of the same type...Any other. This condition's satisfied if there's no other bacteria of the same type.
•  » » » » » 8 years ago, # ^ |   0 thanks :)
 » 8 years ago, # |   +1 The descriptions of five problems are too lengthy and so difficult to understand...
 » 8 years ago, # |   +5 Horrible problem statements ... :/ :(
 » 8 years ago, # |   0 May someone tell me why this submission get WA, i don't know why it is printing -1 on test 8http://codeforces.com/contest/400/submission/5944310
•  » » 8 years ago, # ^ |   0 It is because u declared tab[1010][2] as charI replaced it with int and got accpeted Submission
•  » » » 8 years ago, # ^ |   0 thanks
•  » » 8 years ago, # ^ |   0 In most implementation, the range of char type is between -128 and 127.
 » 8 years ago, # |   -10 Nice problems... Thanks to author....!!!
 » 8 years ago, # |   +13 In problem E, I submitted this code at first. 5935260But, I easily found the case which make my code TLE. (n=m=10^5 , a1=a2=...=an=65535, question are repetition of "0 0" and "0 65535")So, I wrote another code and submiited. And I lost about 900 pts :(But, I submitted first solution after contest, it passed systest and execution time is less than my second submission!!!To avoid such things, I want writers to make testcases more powerful...
•  » » 8 years ago, # ^ |   +6 I agree, it should TLE...
 » 8 years ago, # | ← Rev. 2 →   0 For problem B, why my submission code1 got WA, but another code2 got AC, but I do think they are the same. Plz help me, thanks much.
•  » » 8 years ago, # ^ | ← Rev. 2 →   +1 In the first code, you use char p[1005] to store the distance between 'G' and 'S' It will overflow.
•  » » » 8 years ago, # ^ |   0 Oh, I see it. What a stupid mistake. Thanks very much.
 » 8 years ago, # | ← Rev. 2 →   +1 How can the answer for the following test case be 3?? 3 4 **GS *G*S G**S Clearly it is 2: 1st move: select 1st row and 3rd row. 2nd move: select 2nd row and 3rd row. but the accepted answer is 3. Can anyone explain why this is so?? Was it a fault or I'm not understanding the problem correctly. Because I wasted a lot of time thinking otherwise. :(
•  » » 8 years ago, # ^ |   0 i have the same problem and The author had a mistake: "Problem B. Inna and New Matrix of Candies ***** In problem B was mistake in the statement you must choose all line with dwarf that is not in candy location, not several. Now the statement is correct. Sorry for that."
•  » » » 8 years ago, # ^ |   0 But the announcement said "you must choose all line with dwarf that is not in candy location, not several" So "all line" means that we can choose several lines in which dwarf is not present on the candy. Isn't it??
•  » » » 8 years ago, # ^ |   0 Never mind. I got it. Although the announcement was also ambiguous. First saying "all line" and then "not several". Confusing. :(
•  » » 8 years ago, # ^ |   0 You are right, answer was 2 before the announcement. But they changed problem in middle of contest to this version : In a move you must chose all of row that G is not arrived to S , but the first problem was a set of rows.but don't worry, this is just another mistake in codeforces. :)
•  » » 8 years ago, # ^ |   0 After your first move ('O' indicates G and S are in the same position): ***O **GS *G*S After your second move: ***O ***O **GS So you need a third move: select the 3rd row
•  » » 8 years ago, # ^ |   0 The problem statement has been changed at the later stage.You have to move in each row where G and S have different index. In the above case — 1 move , 1st row G and S have same index.2nd row **GS.3rd row **G*S 2nd move ,1st row work is already over, 2nd row G and S have same index now.3rd row **GS 3rd move,3rd row G and S have same index now.1st and 2nd row already over.
•  » » 8 years ago, # ^ |   0 The statement says that you are not allowed to exclude any possible movement, so, by saying "select 1 and 3", you are excluding a possible movement (moving on row 2), which is not correct according to the final statement. Your point is correct regarding the original statement, tough.
 » 8 years ago, # |   0 Problem B was so cute. I spent more than an hour to try to figure it out bur failed...Hahahahaha~
 » 8 years ago, # | ← Rev. 2 →   0 Thanks for the testing speed.Hope it will be continued in future contests...
 » 8 years ago, # |   +55 We had some interesting friends join our competition today :DMr. dibil, I applaud your determination, but why have you forgotten about 06? It ruined my beautiful rectangle :(
•  » » 8 years ago, # ^ |   0 So Mr dibil, how many brothers are u?
•  » » » 8 years ago, # ^ |   +7 Dibil can be family title too... :PMr. dibil, his father, his uncle, his son, his grandfather... everyone is in codeforces ... :P
•  » » 8 years ago, # ^ | ← Rev. 3 →   +5 i think the real owner of all these accounts is Beket. midway through the contest, i saw that he had hacked dibil03's solution for problem A 6 times! i guess the admins saw this, analyzed the codes of the hacked solutions (probably they all contained hard-coded wrong output for the hack cases having checked the codes, i can now confirm that this is indeed true), and discounted all hacks except the first one.
•  » » » 8 years ago, # ^ |   +8 Should be banned!
•  » » » 8 years ago, # ^ | ← Rev. 3 →   +8 See these solutions, both are exactly the same except for a special hack case in dibil03's solution! "Should be disqualified!" 
 » 8 years ago, # |   0 was it an unrated contest? when the rating will be changed? or won't change?
•  » » 8 years ago, # ^ | ← Rev. 2 →   +1 its updated now
 » 8 years ago, # |   0 In the beginning I thought the data for B is too weak ....And I also wrote a wrong code , and want to hack somebody .....and I get -50 .....
 » 8 years ago, # |   +7 no server error seen in today's contest :) ...... good work codeforces :)
 » 8 years ago, # |   0 Can anyone tell why this code for problem A is giving runtime error on ideone and wrong answer on codeforces while it is working fine on my laptop: http://ideone.com/V6GaTw
 » 8 years ago, # |   -7 Omg, with such a lot of bugs this round is still rated.
 » 8 years ago, # | ← Rev. 2 →   0 Ratings have changed!
 » 8 years ago, # | ← Rev. 2 →   0 my rating changed from 1694 to 1697! not sure if i should be happy that it increased, or sad that i was so close to going back to Candidate Master!!
 » 8 years ago, # |   0 کصصصصااافطاا آنریت کنیییین.عوضیا "بی" غلط بووووود in english : nice contest,nice questions
 » 8 years ago, # | ← Rev. 4 →   0 I need help with understanding problem E. Doesn't procedure look like this: 1 2 1 3 3 3 And the sum is 13? What didn't I understand correctly?
•  » » 8 years ago, # ^ |   +15 It's bitwise AND, not bitwise OR. . So we have 1 2 1 0 0 0 and the sum is 4.
•  » » » 8 years ago, # ^ |   -19 i think u mean 1&2 = 0, not 1^2 = 0.
•  » » » » 8 years ago, # ^ |   +14 He is using the mathematical notation, not C++.
•  » » 8 years ago, # ^ |   +6 (1 AND 2) = 0
•  » » 8 years ago, # ^ |   0 Ups, thank you both! ;-)
 » 8 years ago, # |   +5 Poor English translation in this round.
 » 8 years ago, # |   0 http://codeforces.com/contest/400/submission/5935405 I think it strange,for I compiled the program with my native compiler "GNU GCC Compiler 4.8.2", which seemed to be correct(there is "1x12").However on the onlinejudge, it failed with the same compiler at a lower version.Why is there such a difference?
•  » » 8 years ago, # ^ |   0 something stranger:http://codeforces.com/contest/400/submission/5947329 I changed the compiler to MS C++ 2010,while the answer seems to be correct.But there is a runtime error after the output of the answer.I checked it out and found it was because of the wrong exit code.
•  » » » 8 years ago, # ^ |   0 I also faced a similar kind of problem with this code, on ideone it is showing runtime error and on codeforces WA while it is working fine on my laptop: http://ideone.com/V6GaTw
•  » » » » 8 years ago, # ^ |   0 Do you have a clue of that?
•  » » » » » 8 years ago, # ^ |   0 So, I asked a question regarding this problem on stack overflow based on my code and I got a satisfactory answer. If you wish to see it, here is the link: http://stackoverflow.com/questions/22218002/how-can-changing-the-size-of-the-string-to-be-scanned-affect-the-output-complete/22218366?noredirect=1#22218366
•  » » » 8 years ago, # ^ | ← Rev. 2 →   +8 Here: char t[12]; cin >> t; 13 symbols are getting read into t (12 letters plus a zero as the end of line). Change to t[13] and it will get accepted.
•  » » » » 8 years ago, # ^ |   0 Thank you!I did forget the end of string token, and it get accepted now.
•  » » » » 8 years ago, # ^ |   0 Thank you, my problem also got solved by adding 1 to the size of w....
•  » » 8 years ago, # ^ |   +1 In char t[12], you have to leave space also for the terminating null character. See 5948774.
 » 8 years ago, # | ← Rev. 2 →   0 Hi everyone, can anyone explain me why the output of the following input is 9?10 10 G********S G******S G****S G**S ****G****S *****G***S ******G**S *******G*S ********GS G********SBecause according with the problem you need the number of steps to solve the problemStep 1: Say Let's go and end when row 8 arrive the candy cell.Step 2: Say Let's go and end when row 7 arrive the candy cell.Step 3: Say Let's go and end when row 6 arrive the candy cell.Step 4: Say Let's go and end when row 5 arrive the candy cell.Step 5: Say Let's go and end when row 4 arrive the candy cell.Step 6: Say Let's go and end when row 3 arrive the candy cell.Step 7: Say Let's go and end when row 2 arrive the candy cell.Step 8: Say Let's go and end when row 1 and row 9 arrive the candy cell.So, it is giving me 8 for best answer, what I am missing?Thanks in advances J
•  » » 8 years ago, # ^ |   0 At the very least, there are 10 rows, and you mention only 9.
•  » » » 8 years ago, # ^ |   0 In step8 row1 and row9 arrive the candy cell, row8 it is not counting because S and G are in the same cell
•  » » » » 8 years ago, # ^ |   +3 Still only rows 1–9 in your explanation...There are 9 rows with numbers from 1 to 9, inclusive.There are 10 rows in the input, according to the first line.
•  » » » » » 8 years ago, # ^ |   0 Sorry the row is missing is the one with the S and G in the same cell, *In step8 row1 and row10 arrive the candy cell, row9 it is not counting because S and G are in the same cell
•  » » » » » » 8 years ago, # ^ |   +4 Initially, S and G can not be on the same cell.Otherwise, what is the one single character you read from standard input for that cell?
•  » » » » » » » 8 years ago, # ^ |   0 if that can't happen how you understand row 9:********GS?I though that means they are in the same cell, this is the test3
•  » » » » » » » » 8 years ago, # ^ |   +4 Quoting the problem statement:The field for the new game is a rectangle table of size n × m....Next n lines each contain m characters — the game field for the "Candy Martix 2: Reload". Character "*" represents an empty cell of the field, character "G" represents a dwarf and character "S" represents a candy.Each character in the input corresponds to exactly one cell. So, the string "SG" represents two adjacent cells.
•  » » » » » » » » » 8 years ago, # ^ |   +5 Ohhh, ok now I got it!! Thank you very much!!
 » 8 years ago, # |   0 "can choose all lines of the matrix where dwarf is not on the cell with candy", it is just 'can', not necessary 'must'. And actually, problem means 'must choose all lines'. This is another point that problem didn't describe clearly.
 » 8 years ago, # |   0 What's the meaning of "judgement failed" ? I tried to submit a solution of problem C (for practice) but the verdict is like that : submission
•  » » 8 years ago, # ^ | ← Rev. 2 →   0 If you go to the ProblemSet Status, you'll see many submissions with verdict "Judgement failed".
•  » » » 8 years ago, # ^ |   0 technical problem ?
•  » » » » 8 years ago, # ^ |   -13 Та же problem,
•  » » 8 years ago, # ^ |   0 I am not sure, but last time I got that was because I used a huge array. Here you are using a vector of size 10^5 * 2 so I guess it should be fine.
•  » » » 8 years ago, # ^ | ← Rev. 2 →   0 It seems that there is a technical problem in Codeforces , all recent submissions are getting "judgement failed", check this page
 » 8 years ago, # |   0 When I register for practice, my submission's verdict is Judgement failed. What was happened?
•  » » 8 years ago, # ^ |   0 Just try submit again. It's only temporary
 » 8 years ago, # |   +15 In fact ,I think the problems in this round is very good.But some problem's description is too long too difficult for some Chinese senior high school students,it cost me and my friends a lot of time to understand the meaning of the problems(We not very good at English). So I prefer more problems with simpler description. Thanks.
 » 8 years ago, # |   0 Up for next Round (#234) !
 » 8 years ago, # |   +5 Can anyone explain me in short steps their solution to problem E? Thanks :)
 » 8 years ago, # |   0 any editorial? :D
•  » » 8 years ago, # ^ |   +12
 » 8 years ago, # |   0 Please give the problem E solution