### gridnevvvit's blog

By gridnevvvit, 7 years ago, translation,

Hello!

A few hours later, on May 19th at 17:00 MSK, you are lucky to participate in Codeforces Round #184 for Div. 2 participants. Traditionally, Div. 1 participants can take part out of the competition.

Problems have been prepared by: Gridnev Vitaliy (gridnevvvit), Ignatyev Alexander (dudkamaster). It’s our second round and I hope not last. We want to thank Gerald Agapov(Gerald) for help in preparation of this round, Michael Mirzayanov(MikeMirzayanov) for marvelous Codeforces and Polygon systems, Mary Belova(Delinur) for translating the problems.

We hope you will like these problems, and that it will be fun to solve them.

Also we strongly recommend you to read all the problems.

We wish everyone good luck and high rating!

UPD1: Scoring will be standart: 500, 1000, 1500, 2000, 2500.

UPD2: Editorial

UPD3: Congratulations to winners:

• +147

 » 7 years ago, # |   0 I like the previous contest of gridnevvvit. i hope this contest is similar to previous.
•  » » 7 years ago, # ^ |   +1 window is open, you can easily jump out.
 » 7 years ago, # |   -15 I think it will be interesting. :)
 » 7 years ago, # | ← Rev. 2 →   +16 I hope that contest would be easier than last time(181 round)
•  » » 7 years ago, # ^ |   -7 I'm hope too :D
 » 7 years ago, # |   0 try it
 » 7 years ago, # |   +12 two successive rounds that starts at 17:00(MSK) I hope this starting time keeps on.
 » 7 years ago, # |   +2 "pretest 3" what a pretest!
•  » » 7 years ago, # ^ |   0 Problem A ?... i can't imagine what is wrong in my code :(
•  » » » 7 years ago, # ^ | ← Rev. 5 →   0 in problem A,  Vasya can only sum pairs of integers (a, b), such that for any decimal place at least one number has digit 0 in this place it means you cant get sum of (10, 20) but you can get sum of(1,0), (100, 11), ... Maybe it's the 3th test
•  » » » » 7 years ago, # ^ | ← Rev. 2 →   0 it says at least so I assumed that if both numbers had a digit that was 0 we could add them.also what exactly does this refer to?
•  » » » » » 7 years ago, # ^ |   +3 For each digit p in number a and number b, at least one of a_p and b_p has to be 0.e.g.: a = a_2 a_1, b = b_2 b_1 => a and b can be added if a_1 equals 0 or b_1 equals 0 (or both) AND [same condition for a_2, b_2] (=> a and b both have 2 digits, so a_2 and b_2 are non-zero => they can not be added)
•  » » » 7 years ago, # ^ | ← Rev. 2 →   0 In problem A, the maximum number of the chosen integers is between 0 & 4. Because if you choose a 2 digit integer, you cant get another one( If you choose another 2 digit number, the first digit of both of them is !0 & you cant sum that pair). And you cant choose more than one of 1 or 3 digit numbers with same reason. So in maximum case, Vasya can choose 4 numbers a,_b_,_c_,_d_, a=="0", b = a one digit integer, c = a 2 digit integer, d = a 3 digit integer & d = "100" Sorry for my terrible English!
•  » » » » 7 years ago, # ^ | ← Rev. 2 →   0 this is not always true. what about the input 1 0 0 0? he can choose all the 4 integers!UPD: just re-read the problem statement. the input i mentioned is invalid, because all the integers must be distinct! sorry about that!
 » 7 years ago, # |   -9 I_Love_WJMZBMRThis handle made my day.
•  » » 7 years ago, # ^ |   0 Jump from the window.
 » 7 years ago, # | ← Rev. 2 →   0 I do not understand problem A's statement!!! Can Anybody explain to me what problem A means? Thanks in advance.
•  » » 7 years ago, # ^ | ← Rev. 2 →   0 Problem A is weird.
• »
»
»
7 years ago, # ^ |
0

Can you please explain this test case:

 3 2 70 3

•  » » » 7 years ago, # ^ | ← Rev. 5 →   0 Can you explain with an example?I thought that having two numbers A and B, then if and only if either of those numbers has at least one digit that is equal to 0, then the two numbers can be added.So for example 90 18 can be added, 11 99 can not be added and 10 100 can be added.
•  » » » » 7 years ago, # ^ | ← Rev. 2 →   0 Sorry I also misinterpreted the question!
•  » » » » 7 years ago, # ^ |   0 actually 90 and 18 cannot be added because at 10's place there are 9 and 1 and none of them is 0.
•  » » » 7 years ago, # ^ |   0 Yeah, this was my worst contest ever, A problem was very strange
•  » » 7 years ago, # ^ |   +1 It seems like I will never understand what the author wants to get in Problem A. Problem Statement: "...pairs of integers (a, b), such that for any decimal place at least one number has digit 0 in this place ..." Step 2 of tutorial: "If we got number greater than 0 and less than 10, we take it." I really do not understand then test case 2.
 » 7 years ago, # |   +3 The Round #184 is displayed "finished" here. What happen?
 » 7 years ago, # |   +3 what was the pretest 3 in problem A?
 » 7 years ago, # |   0 Horrible !!!!What a case is pretest 3 !!!! :/
 » 7 years ago, # |   +8 This was a hard contest.
 » 7 years ago, # | ← Rev. 2 →   +11 worst contest ever for me.... :(
 » 7 years ago, # |   +11 I can't connect to "yandex.st" website. This issue increases time of loading each page to 4-5 minutes for me. I should have waited a long time for reading problems or to see the result of my submitted code during contest. Anybody else having the same problem? Can the moderators fix this?
•  » » 7 years ago, # ^ |   0 What? yandex.st?
•  » » » 7 years ago, # ^ | ← Rev. 3 →   0 Codeforces get js from jandex.st. You can view the source code of this page and you can find yandex.st there.
•  » » 7 years ago, # ^ |   0 Iraninan users have the same problem, but today I used mozilla and I didn't have the problem
•  » » 7 years ago, # ^ |   +1 I think in these cases, you should go to codeforces.com through a proxy, just a simple proxy could be fine since we don't need any JS in codeforces ;) : here is mine : www.jabeja.tk/p/index.php
 » 7 years ago, # |   0 ideas for solving C ??
•  » » 7 years ago, # ^ |   +1 Think of the binary representation of the sum and the binary representation of a 2^v -1 decimal number.
•  » » 7 years ago, # ^ |   +4 2^V-1=2^0+2^1+2^2+...+2^v-1 if array consist of distinict elements ans=MAX(a1,a2,...an)+1-n; there is only one problem if you have same powers in array.In this situation you need to transform your powers in such way that get distinict powers, for example: if you have 2^8,2^8,2^8 you can tranform it and get 10^8,10^9 if you have 2^4,2^4 you can tranform it and get 2^5sorry for my poor english
•  » » 7 years ago, # ^ |   +3 2^0 + 2^1 + . . . + 2^n = (2^(n+1)) — 1 Your task was just to find the biggest power of 2 and count how many of the powers from 0 to the biggest are not shown in the sequence. but dont forget to change two a s to one a + 1 for example : 2^3 + 2^3 = 2^4...
 » 7 years ago, # |   +4 During system testing it showed that my C got accepted. Now, it shows that it failed on test case 26. What happened?
•  » » 7 years ago, # ^ |   +1 It was retested, but i don't know the reason
•  » » » 7 years ago, # ^ |   +3 Maybe they saw my solution and decided to add a new case. :(
 » 7 years ago, # |   0 Dynamic scoring would work better!
 » 7 years ago, # |   0 How to use long arithmetic in this solution?
•  » » 7 years ago, # ^ |   0 Don't think you eally need it. What about d=gcd(p,q); p=p/d;q=q/d? :)
•  » » » 7 years ago, # ^ |   0 WA43. I think that we need long arithmetic because of p = big prime number and q = big prime number => their gcd equal to 1 and it doesn't change our p and q.
•  » » » » 7 years ago, # ^ |   0 I am not talking about overflow. For example you have p=100, q=50. And your algo will find Pn=2 and Qn=1 which is quite the same.
•  » » » 7 years ago, # ^ |   0 And another question. Why thistakes AC and WA43? What is the difference?
•  » » » » 7 years ago, # ^ |   +1 In first one you use BigInteger by default so it is OK.
 » 7 years ago, # |   0 Can someone please explain this testcase for problem A: Input: 2 1 2 Output: 1 1
•  » » 7 years ago, # ^ |   0 consider answers: (0), (1 1), (1, 2), if you can choose (0), you can choose(1 1), in both answers you couldn't choose two numbers that can add together.
 » 7 years ago, # |   0 Could someone, please, help me? I can't find mistake in my solution for C problem. Here is my code.
•  » » 7 years ago, # ^ |   0 I think you need to delete (or count) elements that become 0 again.
•  » » » 7 years ago, # ^ |   0 Oh, damn. You're right, thank you! Such a stupid mistake :)
 » 7 years ago, # |   -6 cool bug in the codeforces! http://nic.p.ht/up/c70903297fe1.png
•  » » 7 years ago, # ^ |   0 it means that your solutions is in a queue and not now accepted :)
•  » » » 7 years ago, # ^ |   0 But I didn't pass the pretest of problem C :(
•  » » 7 years ago, # ^ |   0 Jump from the window.
 » 7 years ago, # |   -15 Conteste fogholade chert!! Maskhare bud...
•  » » 7 years ago, # ^ |   +1 what!?!?
•  » » 7 years ago, # ^ |   0
•  » » 7 years ago, # ^ |   0 Thanks. I am a setter of this problem, but there was another statement. There were no initial edges in graph. But Gerald gived idea to add initial edges in graph
 » 7 years ago, # |   0 for problem a test 3, the array of my output is :[70, 40, 30, 100, 50, 60, 0, 16]why it's get WA, if we sum from 70 until 0, the total is 350, and 350 + 16 is valid operation, i think...thx
•  » » 7 years ago, # ^ |   +6 30, 40, 50, 60 and 70 can't be in the same output. Vasya can only sum pairs of integers (a, b), such that for any decimal place at least one number has digit 0 in this placeIn the second decimal place, none of them has 0
•  » » 7 years ago, # ^ |   0 You cannot sum 40 and 30, for example
•  » » » 7 years ago, # ^ |   0 why ? isn't one of them has digit 0 ?
•  » » » » 7 years ago, # ^ |   +3 "Vasya can only sum pairs of integers (a, b), such that for any decimal place at least one number has digit 0 in this place."
•  » » » » » 7 years ago, # ^ |   0 oohhh, took so long to understand that important sentence,at first glance what crossed in my mind is, vasya can sum pair of integer (a,b) if a has at least one 0 or b has at least one 0
•  » » » » » » 7 years ago, # ^ |   0 I made the same mistake and got two wrong answers. Two of my friends also misunderstood the statement. I think it would be better if there were more clear examples or sample tests
 » 7 years ago, # |   +4 I wonder why updating ratings takes a lot of time!
•  » » 7 years ago, # ^ |   0 Checking solutions is a way easier problem than updating the ratings I guess
•  » » » 7 years ago, # ^ |   +4 You know, they have to change colors of nicknames at every single subdirectory. Manually. It takes time.
 » 7 years ago, # |   0 In Problem A. How can a single number form a pair?
•  » » 7 years ago, # ^ |   0 We're looking for such numbers that if we choose any pair, their addition is allowed. But if there's just 1 number, there are no pairs, so we never get a situation which is not allowed, so 1 number is a valid output :D
•  » » » 7 years ago, # ^ |   0 But there is no addition as well if there are no pairs :/
•  » » » 7 years ago, # ^ |   0 Vasya wants to choose some integers from this set so that he could sum any two chosen numbers.But the set dosn't contain two numbers! So the output cannot be a single number i guess.
•  » » » » 7 years ago, # ^ |   +1 Read "so that he can sum any 2 chosen numbers" as "there are no 2 chosen numbers that he can't sum". 1 number satisfies that.
•  » » » » » 7 years ago, # ^ |   -6 I think sometimes CF expects us to read the mind of the problem setter. :/ no more arguing.
•  » » » » » » 7 years ago, # ^ |   +7 Sorry, but that's the standard convention in mathematics. I've encountered it several times (once with the warning that the problem statement uses strict mathematical logic :D).
•  » » » » » » 7 years ago, # ^ |   +3 hang yourself
 » 7 years ago, # |   0 taking long time to update ratings!!!
•  » » 7 years ago, # ^ |   +1 Congratulations!:)
 » 7 years ago, # |   -6 Rating?
 » 7 years ago, # |   0 The contest time is too early for me! It's better if the contest starts two or three hours later.
•  » » 7 years ago, # ^ |   -7 Yeah, For me too!
 » 7 years ago, # |   -12 The best contest ever... Problem C was easier than A!
•  » » 7 years ago, # ^ |   +3 Повесься
•  » » » 7 years ago, # ^ |   0 what does it mean?? "Повесься"