### gojira's blog

By gojira, 10 years ago, translation,

Hello everyone!

The Codeforces Round #164 for Div.2 participants will start in several hours. Traditionally, the other participants can take part out of competition.

The hero of today's problems is Manao, which has been straining Georgian fellow programmers' minds for several years already. He made it to Codeforces pages thanks to Gerald and Delinur, who have assisted me in round preparation. The problems were also tested by Seyaua, sdya and Aksenov239.

The scoring system will be a little unusual: 500-1000-1500-2500-2500.

Good luck :)

UPD: The contest is over, congratulations to the winners:

You can find the tutorial here.

• +189

 » 10 years ago, # | ← Rev. 3 →   -41 get(PlaceinRound); while(TimeLeft > 0) { SuccessfulHacks++; PlaceInRound--; ProblemsSolved += min(TimeLeft / 30,1); } ProblemsSolved = min(ProblemsSolved,5); Cout<<"Good Luck!"; 
•  » » 10 years ago, # ^ |   +24 Infinite while, place in round decrement with only one when winning 100(successfull hack)+nb_point_of_problem, Problems solved over 9000 before "ProblemsSolved = min(ProblemsSolved,5);" and "good luck" after the end of the contest... And yes, I am very fun at parties.
 » 10 years ago, # |   -12 A codeforces competitor does not simply get upvotes.
 » 10 years ago, # |   0 Hi , gojira First contest at codeforces written by you :) , Looking forward for it. Some day I believe I will also write a contest for codeforces :)
 » 10 years ago, # |   0 Who is eligible for round preparation?
•  » » 10 years ago, # ^ |   +3 They have not mentioned any age restriction on the FAQ page. So I believe that there is no constraint except your problems should be interesting.
•  » » » 10 years ago, # ^ | ← Rev. 2 →   0 Yes but I saw somewhere Mike saying that they usually trust orange or orange+ users.
•  » » » » 10 years ago, # ^ |   +4 I really do not have such idea , Only Mike could clarify that whether there is some strict rating policy for writing a contest.
•  » » » » » 10 years ago, # ^ |   +4 I had previously tried to submit problems for div 2 only contest , But as far as I think they were not as good standard as it should be.
•  » » » » 10 years ago, # ^ |   +3 http://codeforces.com/blog/entry/6290#comment-116753But still if you are purple I don't think there is a problem .
•  » » 10 years ago, # ^ |   +2 Let me know when you get the answer
•  » » 10 years ago, # ^ |   +2 and what we will get in return...?
 » 10 years ago, # |   -15 GL all :)
 » 10 years ago, # |   -14 Round 164 'A' - 1 (Div 2) 164 == 2 * 82 == 2^1 * (1^2 + 9^2) == 2^2 * (4^2 + 5^2)) == 2^3 * (4.5^2 + 0.5^2) == 2^4 * (2.5^2 + 2^2) == 2^5 * (2.25^2 + 0.25^2) == 2^6 * (1.25^2 + 1^2) == 2^N * (a^2 + b^2) 1 < N < 60; a,b = ? 
•  » » 10 years ago, # ^ |   +2 164 = 74 + 74 + 4 + 4 + 4 + 4
•  » » » 10 years ago, # ^ |   0 what does it mean?
•  » » » 10 years ago, # ^ |   -9 too difficult, 164 = 74 + 74 + 4*4
•  » » » » 10 years ago, # ^ |   +2 164 = 47*4 + 4 — 7*4, palindrome :)
•  » » 10 years ago, # ^ |   +10 No, Round 164 div 2 == Round 82 == 82.
 » 10 years ago, # |   -23 when i became a red coder :(
•  » » 10 years ago, # ^ |   0 compile yourself first)
•  » » 10 years ago, # ^ |   +1 never give up :)
 » 10 years ago, # |   -11 This is round 164 & 164 = 12^2 + 4^2 + 2^2 = 10^2 + 8^2 Here , 12+4+2=10+8=18 Again , 164 = 13^2 — 2^2 — 1^2 = 14^2 — 6^2 +2^2 Here , 13-2-1=14-6+2=10 What a combination :D
•  » » 10 years ago, # ^ |   -10 As, 164 = 12^2 + 4^2 + 2^2 = 10^2 + 8^2 , the problem points could be distributed like this --> 3000,1000,500,2500,2000 , as 3000:1000:500:2500:2000 == 12:4:2:10:8
 » 10 years ago, # |   +6 pages of in queue. judges are down?
•  » » 10 years ago, # ^ |   +5 I am waiting in queue 3+ minutes.
•  » » 10 years ago, # ^ | ← Rev. 2 →   +2 everything is ok now.
 » 10 years ago, # |   +2 I hope I wasn't the only one who didn't know what expected value is :(
 » 10 years ago, # |   0 Combinatorics round with nice problems, I liked it! Thanks to the creators!
 » 10 years ago, # |   0 Can anybody help me in understanding the reason behind using comparision function ??
•  » » 10 years ago, # ^ | ← Rev. 5 →   +4 The change in expected total length from swapping the order of adjacent tracks [i] and [i-1] is equal to  track[i ].length*track[i ].chance*(1-track[i-1].chance) - track[i-1].length*track[i-1].chance*(1-track[i ].chance) since [i] might now be repeated due to [i-1], but [i] can no longer cause [i-1] to be replayed. Swapping has an effect on the expected playtime of these two tracks alone, so it's always best to swap pairs for which such a change is positive.You could intuit that continuing to make such swaps would look a lot like bubble-sort (or rather, is bubble-sort); more rigorously, use some simple algebra to show that the expression above is consistent as a comparator.
•  » » » 10 years ago, # ^ |   0 and how do we calculate the expected total length?
•  » » » » 10 years ago, # ^ | ← Rev. 3 →   +4 A song will be replayed every time it is liked but a later song is disliked, plus the once the first time it is seen. We take the chance of being liked multiplied by expected number of later dislikes and add one:
 » 10 years ago, # |   0 I am new to codeforces , can anyone tell by when my rating willbe update :) ?
•  » » 10 years ago, # ^ |   0 very soon, be patient ;-)
 » 10 years ago, # |   +5 nice problems, enjoyed the contest
 » 10 years ago, # |   +18 Hi gojira,I really enjoyed the problems, thanks for the contest. I saw a lot of hacks for 3rd problem, that's good, thanks again ;-)B.
 » 10 years ago, # | ← Rev. 3 →   +2 Love win =) результаты(смотреть среди официальных участников)
 » 10 years ago, # | ← Rev. 2 →   +6 9 successful hacks in problem C :D it was really funny :D
•  » » 10 years ago, # ^ |   +8 9 down votes incoming!
•  » » » 10 years ago, # ^ |   0 :D :D
 » 10 years ago, # |   +4 whew,that was really lucky for me,first time contest writer from my country first time div 1 ^_^
 » 10 years ago, # |   0 Could not understand Problem B — Buttons. Can anyone explain it? words "push" and "press" are same? "some" does it mean single button or can be group of buttons?
•  » » 10 years ago, # ^ |   +1 Yes the words "push" and "press" mean the same. You can only push one button at a time and you need to output the maximum value of the number of times you can push the button, before getting the right permutation.
 » 10 years ago, # |   0 My submission with id 3029515 got wrong answer on first test case. But its giving the correct answer in my system
•  » » 10 years ago, # ^ | ← Rev. 2 →   +2 How is that possible?http://codeforces.com/contest/268/submission/3029515It really returns 2 on your system?
•  » » » 10 years ago, # ^ |   0 It returns 3 on my system which is the correct answer. On the judge it returns 2. It is pretty weird.
•  » » » » 10 years ago, # ^ |   +1 return pow(sqrt(ds),2)==ds; Are you sure? This line doesn't really do anything except check for floating-point error...
•  » » » » 10 years ago, # ^ |   +1 On my PC it works too, but on ideone it does NOT — http://ideone.com/ooqeopIn debug mode there is different output:ideone: a=(0, 1) b=(0, 2) (pow(sqrt(ds),2)==ds)=1 a=(0, 1) b=(1, 0) (pow(sqrt(ds),2)==ds)=1 a=(0, 1) b=(1, 1) (pow(sqrt(ds),2)==ds)=1 a=(0, 1) b=(1, 2) (pow(sqrt(ds),2)==ds)=1 a=(1, 0) b=(1, 2) (pow(sqrt(ds),2)==ds)=1 a=(0, 1) b=(2, 0) (pow(sqrt(ds),2)==ds)=1 a=(0, 1) b=(2, 1) (pow(sqrt(ds),2)==ds)=1 a=(0, 1) b=(2, 2) (pow(sqrt(ds),2)==ds)=1 2 0 1 1 0 my PC: n=2, m=2 a=(0, 1) b=(0, 2) (pow(sqrt(ds),2)==ds)=1 a=(0, 1) b=(1, 0) (pow(sqrt(ds),2)==ds)=0 a=(0, 1) b=(1, 1) (pow(sqrt(ds),2)==ds)=1 a=(0, 1) b=(1, 2) (pow(sqrt(ds),2)==ds)=0 a=(1, 0) b=(1, 2) (pow(sqrt(ds),2)==ds)=1 a=(0, 1) b=(2, 0) (pow(sqrt(ds),2)==ds)=0 a=(1, 0) b=(2, 0) (pow(sqrt(ds),2)==ds)=1 a=(0, 1) b=(2, 1) (pow(sqrt(ds),2)==ds)=1 a=(0, 1) b=(2, 2) (pow(sqrt(ds),2)==ds)=0 a=(1, 0) b=(2, 2) (pow(sqrt(ds),2)==ds)=0 3 0 1 1 0 2 2 
•  » » » » » 10 years ago, # ^ |   0 Thanks for the information. but this is very strange.
•  » » 10 years ago, # ^ |   0 In 268A, I submit 3 times and get WA on test 6, which have the right answer is 6, but the system returns 83. Anyone can explain that for me ?
•  » » » 10 years ago, # ^ |   0 lines 27-28: instead of long n, res; long a[mxn][2]; should be long n, res = 0; long a[mxn][3]; 
•  » » » » 10 years ago, # ^ |   0 Thank for your suggestions
 » 10 years ago, # |   0 please can someone tell the way to solve problem C...
•  » » 10 years ago, # ^ |   0 You can view all the sources here: http://www.codeforces.com/contest/268/status/C . To solve the problem, you must think of a greedy algorithm based on a mathematical observation. Good luck !
•  » » 10 years ago, # ^ |   +1 Editorial is already available.
 » 10 years ago, # |   0 Editorial published in English here