By tourist, 18 months ago, translation, ,

Hi everyone!

The last elimination round of VK Cup 2017, Round 3, will take place on May 7 at 18:35 MSK (check your timezone here), along with separate Codeforces Round #412 for both divisions. All three rounds will be three hours long, and all three rounds will be rated.

The contest "VK Cup 2017 — Round 3" is for teams qualified from Round 2 or Wildcard Round 2. The top 20 teams will advance to the final which will be held in July 2017 in Saint Petersburg!

Huge thanks to KAN, qwerty787788, PavelKunyavskiy, AlexFetisov, MikeMirzayanov, and VK company for making this round possible.

Codeforces will be the main character of most problems. Don't forget that it's useful to read the statements of all the problems.

Good luck!

As we're in year 2017, the scoring will obviously be static. The exact scoring distribution will be announced before the round.

UPD 1. The scoring distribution is:

Div. 1 and VK Cup Round 3: 500 — 1000 — 1750 — 2500 — 2750 — 3500

Div. 2: 500 — 1000 — 1500 — 2000 — 2750 — 3500

UPD 2. Due to yesterday's registration troubles the start of the contest is delayed by 10 minutes.

UPD 3. Congratulations to the winners!

VK Cup Round 3:

Div. 1:

Div. 2:

UPD 4. Tutorial is now available.

•
• +2247
•

 » 18 months ago, # | ← Rev. 2 →   +1009 My first reaction to round author:
•  » » 18 months ago, # ^ |   +183 My first reaction to number of upvotes!
•  » » » 18 months ago, # ^ | ← Rev. 3 →   +60 Yes. Now tourist is in the Top 10 Contributor! EDIT: Now he's 7th contributor. Actually this is the first time to see blog with 2000+ upvotes... Wow!
•  » » » 18 months ago, # ^ |   +44
•  » » » 18 months ago, # ^ |   +12 These upvotes prove how much people love tourist
•  » » 18 months ago, # ^ |   0 That's my first reaction when I saw that tourist can't take first place in a contest for once.
 » 18 months ago, # |   -36 What does this mean "maybe someone else"?
•  » » 18 months ago, # ^ |   +53 maybe to himself but he did not like to thank himself
 » 18 months ago, # |   -7 How many problems there will be ?
•  » » 18 months ago, # ^ |   0 Yes, how many?
•  » » 18 months ago, # ^ |   0 I think, 7 like in the past years.
 » 18 months ago, # |   +75 Boss(tourist) is back in business after a long time .
 » 18 months ago, # |   +77 Why can I register for both contests at the same time?
 » 18 months ago, # |   +146
•  » » 18 months ago, # ^ |   -74 poor english :/
•  » » » 18 months ago, # ^ |   +105 "Y U NO" is customary for that meme...
 » 18 months ago, # |   +738 I'll go to a trip the day after tomorrow (i.e., get up early) and I was planning to skip this round (it's late night), but the writer is tourist. I must change the sleeping schedule.
•  » » 18 months ago, # ^ |   +8 that's beauty :D Good luck to You :D
•  » » 18 months ago, # ^ | ← Rev. 2 →   +158 Go to a trip and become a tourist :)
•  » » 18 months ago, # ^ |   +16 I have an exam tomorrow and I was planning to skip this round too but now I am planning to study hard now to attend the contest.
•  » » 18 months ago, # ^ |   +13 i'm am participating after 2 months and the writer is tourist :(
 » 18 months ago, # | ← Rev. 4 →   +87 What does this mean ?! UPD: Fixed :)
 » 18 months ago, # | ← Rev. 4 →   +9 Poor connection :( I'm so sorry for repeating the comment. (edited)
 » 18 months ago, # |   +42 is there a qualification required to participate in the div2 and div1 rounds? , because it says "Registration is private" ... thank you
•  » » 18 months ago, # ^ |   +71 No, there was a bug in registration settings, we are fixing it, the registration will soon be open again.
•  » » » 18 months ago, # ^ |   +21 thanks , we are expecting a very nice round
•  » » » 18 months ago, # ^ |   -26 Why it shows "Registration is private"?
 » 18 months ago, # |   +268 DIV 2 people right now
 » 18 months ago, # | ← Rev. 4 →   -16 I hope Statement.CLEAR && Statement.SHORT() always return true! :)Good luck everyone!
 » 18 months ago, # |   +29 Register again, to take part in contest.
 » 18 months ago, # | ← Rev. 2 →   0 The round writer is tourist . Do not miss the round!
 » 18 months ago, # | ← Rev. 5 →   -53 ...
 » 18 months ago, # |   +618
 » 18 months ago, # |   -32 I can break negative contribution record with this comment down votes coming
•  » » 18 months ago, # ^ |   0 Nice way of increasing the contribution points...
•  » » » 18 months ago, # ^ |   +32 Nice picture xP
•  » » » » 18 months ago, # ^ |   +94 Mine is probably even better
•  » » » » » 18 months ago, # ^ |   +11 And I thought I was evil!
 » 18 months ago, # |   -11 Boss(tourist) is back in business after a long time .Yeah.
 » 18 months ago, # |   +8 what does it mean that the score will be static?
•  » » 18 months ago, # ^ |   -20 A-500 B-1000 c-1500 D-2000 E-2500 F-3000
•  » » 18 months ago, # ^ | ← Rev. 2 →   +22 Points don't depend on number of people who solve task.
•  » » » 18 months ago, # ^ |   0 thank you.
 » 18 months ago, # |   +78 If you want to be "Tourist" , Please visit my country Nepal. Very Beautiful and We welcome Tourists :P
•  » » 18 months ago, # ^ |   +1 ahahah lol.)))
•  » » 18 months ago, # ^ |   +155 Carry out an open programming competition with the onsite final there
 » 18 months ago, # |   0 Into my mind the problems will be very interesting(and soulves too).
 » 18 months ago, # |   0 Amazing
 » 18 months ago, # |   -20 Why everyone so excited that the round is by tourist?! it doesn't mean that you participate a round by tourist and you become tourist also :P Go to visit somewhere and do the contest, you'll become a tourist participant of a contest by tourist!
 » 18 months ago, # |   0 I really hope that tourist could say hello to me.I would be happy all the night,maybe all the year.
•  » » 18 months ago, # ^ |   0 work hard all that year and you will become ( or close to ) a tourist :)
•  » » » 18 months ago, # ^ |   0 Thank you for you encouragement,I try my best to develop myself
 » 18 months ago, # |   -35 I am Arab :| downvotes please
•  » » 18 months ago, # ^ |   +2 something else, do you have problems with Arabs, because of you people hate Arabs and Afghans, please don't do this "Stupid acts".
•  » » » 18 months ago, # ^ |   -25 everything I want is downvote And I'm also arab :/ They are great people but maybe it is a way for increasing downvotes
•  » » » 18 months ago, # ^ |   0 He can do anything to get upvotes :| !
•  » » 18 months ago, # ^ |   -48 You've got it wrong. People usually hate jews, but not arabs =)
•  » » » 18 months ago, # ^ |   +18 In fact people here hate ethnicity-related comments most of all, I think.
•  » » » » 18 months ago, # ^ |   0 so why no downvotes¿
•  » » » » » 18 months ago, # ^ | ← Rev. 3 →   +49 SpoilerA sadist and a masochist were put into the same jail cell and soon found out about each other.The masochist cried, "Oh, hurt me, pinch me, humiliate me. Please cause me pain!"The sadist looked at him and said, "No".
 » 18 months ago, # |   +1 Ow I think I can do it this time with this comment: is it rated? GL & HF How many problems there are? Hope for short statements anything missing? please write phrases I should write in this comment
•  » » 18 months ago, # ^ | ← Rev. 3 →   0 I'm sure that you want to get upvotes.If you really want to get down votes remove: "Ow I think I can do it this time with this comment"You can learn from this guy: Comment
•  » » » 18 months ago, # ^ |   0 I think I can learn also from this person below :| NotMoreThanANoob
•  » » 18 months ago, # ^ |   0 try using "Up votes please :) " P.S. i'm perfectly satisfied with my contribution status, so if you wanna give me down vote, give it to this-TOPCODER- guy instead and help him reach his dream.
•  » » » 18 months ago, # ^ |   0 yup, like this guy: Comment
 » 18 months ago, # |   +4 Story of tourist and problems :
•  » » 18 months ago, # ^ |   +1 tkhkhkhkhkhkhkh soooo interesting :\
 » 18 months ago, # |   +53 Finally a round that tourist cannot take the first place :)
•  » » 18 months ago, # ^ |   +3 respect for everybody. Did tourist stood first in every contest?
•  » » » 18 months ago, # ^ |   +10 You can check.
•  » » » » 18 months ago, # ^ |   +25 so basically whenever he doesn't come first he loses rating? tough job
 » 18 months ago, # |   +2 I have End-Semester exam tommorow. Well fuck it.
 » 18 months ago, # |   +3 More delays?
 » 18 months ago, # |   0 Rating? Or spend the semester? :'v
 » 18 months ago, # |   +3 Delayed by 10 min
 » 18 months ago, # |   +18 Delay, delay everywhere
 » 18 months ago, # | ← Rev. 2 →   -18 Guys instead of fun I want you talk with you. Today I did this with an account to show you in life they are some people like this -topcoder- this people can be so bad for our duty. look, one of the codeforces best blogs ever can be hardly damned with people like this please, please I'm not joking please read this comment and try to remember it, there are many people like this in the real world don't make sense about them and let them for their own! at last be happy and I wish you all a good contest :) Sorry for my poor english :(
•  » » 18 months ago, # ^ |   +21 bruh.. do u even english?
•  » » » 18 months ago, # ^ |   +9 Ironically enough , it says that he is from MIT :P
 » 18 months ago, # | ← Rev. 2 →   -29 I hate delayed contest :(
•  » » 18 months ago, # ^ |   0 At least delays are useful for some persons :)
 » 18 months ago, # |   0 delay, hope it won't be delay as much as 411
 » 18 months ago, # |   0 Delay again!!
 » 18 months ago, # |   +10 Now 10 minutes late is a common factor of codeforces contest.
 » 18 months ago, # |   +5 There is nothing I hate in codeforces more than the delays xD
 » 18 months ago, # |   +12 Delays for situations like this (yesterday's registration) should be announced a day earlier when the registration failure happens, not 5 minutes before contest start.
 » 18 months ago, # |   +3 I'm the only one that use delays to give contribution points??? I'm nervous, I hope to solve at least three problems...
 » 18 months ago, # | ← Rev. 7 →   +23 after hearing the contest is on Sunday:After hearing it is from tourist:
 » 18 months ago, # | ← Rev. 2 →   +31 That's why I love problems of tourist:
•  » » 18 months ago, # ^ | ← Rev. 2 →   -9 NO! Your rate increasement is the reason :/
 » 18 months ago, # |   +18 What if I hate Math! xD xD
•  » » 18 months ago, # ^ |   +26 Rating drops deeper than Mariana Trench. :)
 » 18 months ago, # |   +3 Fairly difficult contest but great problems by a great problemsetter!
 » 18 months ago, # | ← Rev. 2 →   0 What is test 10 for problem Div2 E? It's driving me insane.
 » 18 months ago, # |   +138 There's definitely something wrong with problem B, I'm sure that my solution is correct but I kept getting wrong answer. Here's my idea, please correct me if I'm wrong: Only tourist can beat Petya, so I printed -1 for all test cases.
 » 18 months ago, # | ← Rev. 2 →   0 In DIV2D/DIV1B, does anybody have an idea, what test case 11 could've been like? Kept failing it.
•  » » 18 months ago, # ^ | ← Rev. 2 →   0 I got WA once on test 11 with binary search.A linear scan got pretest passed.
•  » » » 18 months ago, # ^ | ← Rev. 2 →   +11 binary search doesnt work always. Take case something like vasya cannot solve some problem and petya can solve it.then u are increasing its points
•  » » » » 18 months ago, # ^ |   0 Yes. I forgot the fact that if i can't have a correct solution for a particular problem, adding new accounts would increase the difference between two's score.
•  » » » » 18 months ago, # ^ |   0 I literally just bruteforced my way until some large enough threshold, say 1e6. Since the original number of participants is quite small (<= 120)
•  » » » » 18 months ago, # ^ |   0 Could you give me an example case that make binary search goes wrong? My idea is binary searching the answer and then using current "fake accounts" i use bitmask for every problem. 0 in the mask represents that all fake accounts must produce "failed submission", 1 in the mask that all fake accounts must produce "accepted". Firstly i check if there is any problem that Vasya hasn't solved yet, the fake account cannot produce the correct answer and move to the next mask. In any mask configuration that makes Vasya score gets higher than Petya, then current answer is able to make the score higher. Mine got WA on pretest 11
•  » » » 18 months ago, # ^ |   0 What do you mean by linear scan?
•  » » » » 18 months ago, # ^ |   0 for i:=0 to a specific value check adding i accounts submitting solutions in an optimal way satisfies the requirement or not
•  » » » » » 18 months ago, # ^ |   0 Greedy?
•  » » » » » » 18 months ago, # ^ |   0 make all new accounts submit a correct solution to a problem if time[Vasya] > time[Petya] and Vasya has a correct solution to the problem.
•  » » » 18 months ago, # ^ |   +1 Damn. I did it with binary search, because I though a linear function would be too slow.
•  » » » » 18 months ago, # ^ |   0 I'm too... It's so sad(
•  » » 18 months ago, # ^ |   0 Got WA on pretest 12 (not 11) with a greedy solution
 » 18 months ago, # |   +22 Why points in scoreboard changed?
•  » » 18 months ago, # ^ |   +4 Yes, I thought i was going crazy :/
 » 18 months ago, # |   0 Hack case for Div2.C?
•  » » 18 months ago, # ^ |   0 maybe: 1 1 2 0 1
•  » » » 18 months ago, # ^ |   -7 My program prints -1 and answer is -1! passed from this :D
 » 18 months ago, # | ← Rev. 2 →   0 how to solve div2 problem D? Can anyone please help
 » 18 months ago, # |   0 How to solve Div2C?
•  » » 18 months ago, # ^ |   0 About binary search or math to solve it.
•  » » 18 months ago, # ^ |   +8 binary search
•  » » » 18 months ago, # ^ |   0 Search what?
•  » » » » 18 months ago, # ^ |   0 Assume p*t/q*t =(x+c1)/(y+c1+c2).Now binary search for t
•  » » » » » 18 months ago, # ^ |   0 But we don't know c1 and c2 right?
•  » » » » » » 18 months ago, # ^ | ← Rev. 2 →   0 the condition for valid t is c1>=0 and c2>=0
•  » » » » 18 months ago, # ^ |   0 (x+a)/ (y+b) = p/q this implies x+a = pn and y+b = qn for some n. Now apply binary search for n with high as 10^9 , i got the idea late :-/ Hope this helps. Check for conditions in binary search .
•  » » 18 months ago, # ^ | ← Rev. 4 →   0 Simple math, no need binary search (maybe will fail from systest): Codeintt t; cin >> t; while (t --) { intt x, y, p, q; cin >> x >> y >> p >> q; if (p == 0) { if (x == 0) cout << 0 << endl; else cout << -1 << endl; continue; } if (x / gcd (x, y) == p && y / gcd (x, y) == q) { cout << 0 << endl; continue; } intt k = ceil (1.0 * (y - x) / (q - p) / 1.0); if (k * p < x) { k = x / p + min (1LL, x % p); } if (k * q - y < 0) cout << -1 << endl; else cout << k * q - y << endl; } Got AC :)
•  » » » 18 months ago, # ^ |   0 how is k fixed?? i did binary search on k but failled pretest.
•  » » » » 18 months ago, # ^ |   0 In problem we have to find k such that k * p - x ≤ k * q - y. From inequality we get . Then check if k is answer or not.
•  » » » » » 18 months ago, # ^ |   0 nice catch!! was solution same as this, or simpler
•  » » 18 months ago, # ^ | ← Rev. 2 →   +3 Firstly, divide p and q by gcd(p, q), next step is binary search parameter m, and check that we can make fraction N / m * q from x / y.
•  » » » 18 months ago, # ^ |   +5 "It is guaranteed that p / q is an irreducible fraction."
•  » » » » 18 months ago, # ^ |   0 Hmm okay, I should carefully read statement.
•  » » 18 months ago, # ^ |   +2 Solved it using math. we must find n and m integers, n, m >= 0 such as: (x + n) / (x + n + m) = p / q; => n = (p * m + p * x + q * x) / (q — p); and m = (n * q — n * p — p * y + q * x) / p; m = (n * q + q * x) / p — n — y; m = q * (n + x) / p — n — y; Because gcd(q, p) = 1 => n + x = cp, c integer, c >= 0, c minimum so n = cp — x; because n >= 0 => q * (n + x) / p >= n + y so: c >= (y — x) / (q — p) => c = ceil( (y — x) / (q — p) ) Notice that n = cp — x, so if cp — x < 0, we have a contradiction. Finally, c = max(c, ceil(x / p)); we calculate n and then m; we print n + m. be careful with border cases
•  » » 18 months ago, # ^ | ← Rev. 5 →   0 See the comment at the top of my solution: http://codeforces.com/contest/806/submission/26929314 least k s.t. kq >= y && x <= kp && kp <= x+(kq-y) k >= y/q k >= p/x k*(q-p) >= y-x k >= (y-x)/(q-p)
•  » » » 18 months ago, # ^ |   0 Could you, please, add a bit more detail to the following transition: "min b s.t. (x+a)*q == p*(y+b) 0 <= a <= b" "least k s.t. kq >= y && x <= kp && kp <= x+(kq-y)" I don't understand how do we go from step 1 to step 2.
•  » » » » 18 months ago, # ^ | ← Rev. 3 →   0 This reformulation is the crux of the problem, at least for me. I didn't think of it this way while solvingh; I wrote down #1, didn't think it was useful, decided I had to find k, and tried to write down conditions that would make a given k a valid solution.However, they are equivalent:kq-y is b, so the condition kq >= y is just saying b is non-negative.kp-x is a, so kp>=x is saying a is non-negative.And kp <= x+(kq-y) is saying a <= b.
 » 18 months ago, # |   0 What is test 7 about DIV.2 problem B?
 » 18 months ago, # |   +3 How to solve div2 C??? :/
•  » » 18 months ago, # ^ |   0 Try using binary search
•  » » » 18 months ago, # ^ |   0 did that..still got error. What is the upper and lower bound of search?
•  » » » » 18 months ago, # ^ |   0 I used 0 to 10^9
•  » » 18 months ago, # ^ |   +2 binary search multiple of q/p
•  » » » 18 months ago, # ^ |   +1 yes I did that...check my submission. We basically check multiples of p/q such that it m*p-x <= m*q-y and both of the term >0
•  » » » 18 months ago, # ^ | ← Rev. 2 →   -10 Is possible p=0? For example 1 0 2 0 3
•  » » » » 18 months ago, # ^ |   +11 That shouldn't be valid since p/q must be irreducible.
•  » » » » » 18 months ago, # ^ |   0 Is 0/1 irreducible or reducible?
•  » » » » » » 18 months ago, # ^ |   +1 Irreducible, there surely is a test with 0/1. The statement also says that p >= 0.
•  » » » 18 months ago, # ^ | ← Rev. 2 →   0 I think it can be done in O(1). Multiply q/p by a smallest constant such that newq-newp>=y-x
•  » » » » 18 months ago, # ^ | ← Rev. 2 →   0 And how do you find this constant in O(1)? (This is incorrect anyway btw)
•  » » » » » 18 months ago, # ^ |   +5 Just compare the ratio of difference(denominator-numerator) of the two rational numbers. Code
•  » » » » » » 18 months ago, # ^ |   0 Interesting, I modified my own correct code to find the constant and it failed on test 1. Code
•  » » 18 months ago, # ^ |   0 Used Binary Search. Realized that after making more submissions final value of x/y must be a multiple of p/q.Let number of successful submissions, total number of submissions and such a multiple be k , d, g an, then g*(q-p) + (x-y) >= 0 and k >= 0 and d >= 0.The goal is to find the first multiple such that g*(q-p) + (x-y) >= 0. It turns out that we can binary search on the g.k = g*p-x d = g*q-y
 » 18 months ago, # |   0 Why I can't see others' solutions?
•  » » 18 months ago, # ^ |   0 To force us ask questions "How to solve ...?" here instead of looking at solutions by ourselves :)
•  » » 18 months ago, # ^ |   0 While system tests won't ended,you can't see solutions
•  » » » 18 months ago, # ^ |   0 Actually, I can see them now.
•  » » 18 months ago, # ^ |   0 You can see now
 » 18 months ago, # | ← Rev. 4 →   -20 For Div2 C, got WA on test pretest 4. What's wrong in my code? 26944035
 » 18 months ago, # |   +30 Fastest start of System Testing this year :o
•  » » 18 months ago, # ^ |   +11 But it is down now.
•  » » 18 months ago, # ^ |   -6 We all know why :D :PHail tourist :D
 » 18 months ago, # |   +30 Understanding question div 2 B is harder than solving it
 » 18 months ago, # |   0 How to solve Div.1 D? It is correct that we should find exactly one path with cost X and length K to the some vertex U, and choose min(X + minEdge[U] * (n — K)) over all pathes K, U? How to manage this?
•  » » 18 months ago, # ^ | ← Rev. 2 →   +15 Let's fix the root u. What we want to find is actually a path from u to some vertex with minimal weight edge attached to it. Consider sorting the edges and add them one by one, let's say we're adding e(u,v), do we know the shortest path from u to some vertex with minimal weight, using this edge?We do indeed! it's equal to the weight of the edge, added by the result of vertex v. Notice that if we don't have result of vertex v, we notice that all the "empty" edges have same weight as the edge we just added, so it's weight * 2. Doing it for all edges and you get the answer.
•  » » » 18 months ago, # ^ |   0 Got it, Thanks!
 » 18 months ago, # |   +3 Problem C [Success Rate]: Case 3 3 5 5 is the answer 0 or 2 ?
•  » » 18 months ago, # ^ |   0 p/q is guaranteed to be irreducible.
•  » » 18 months ago, # ^ |   0 p/q is guaranteed to be irreducible, the answer is 0 though.
•  » » 18 months ago, # ^ |   0 the answer should be 0 since the ratio is the same. btw p/q is irreducible fraction, so your input case is invalid
•  » » 18 months ago, # ^ |   0 it is assumed that p/q is irreducible, so this case doesn't exist.
 » 18 months ago, # |   +5 What an end for a contest by tourist. petr wins it with a submission in last minute.!!!
•  » » 18 months ago, # ^ |   +10 WoW! ... ;)
•  » » » 18 months ago, # ^ |   +34 And also I felt tourist thought to bluff Div1 B as binary search (only my personal opinion)
 » 18 months ago, # |   -10 what should the answer to problem div 2C be for the following output x=0 y=2 p=0 q=3 ?
•  » » 18 months ago, # ^ |   -15 0, since the ratios are already the same.
 » 18 months ago, # |   +8 Nice Contest and questions were also interesting. Thanks tourist!!
 » 18 months ago, # |   +14 one of the team was "-xray- is gay". And the members are -xray-'s teammates. lol .
 » 18 months ago, # |   0 Is O(n^3) supposed to get TLE for problem Div2F?
•  » » 18 months ago, # ^ |   0 My submission in O(n^3) gets TLE...http://codeforces.com/contest/807/submission/26945597
•  » » » 18 months ago, # ^ |   +6 I haven't read the problem myself, but given that n is 2000 it should TLE.
 » 18 months ago, # |   -14 Boss(tourist) is back, that's why we have a nice round. :)
 » 18 months ago, # | ← Rev. 2 →   0 Can someone explain mathematical solution of Div1 A / Div2 C ?Petr's one http://codeforces.com/contest/806/submission/26927108
•  » » 18 months ago, # ^ |   +17 Find smallest integer t such that 0 <= p*t-x <= q*t-y. Submit q*t-y times and get AC p*t-x times then AC rate wil be p*t/q*t = p/q.
•  » » » 18 months ago, # ^ |   0 but how to implement it?
•  » » » 18 months ago, # ^ | ← Rev. 2 →   0 i can't understand your formulas for t ll s=max((x+p-1)/p,(y+q-1)/q); MX(s,(y-x+q-p-1)/(q-p)); 
•  » » » » 18 months ago, # ^ |   +1 (A+B-1)/B means ceil(A÷B).
•  » » » » » 18 months ago, # ^ |   0 ok, now its clear. thank you
•  » » 18 months ago, # ^ |   0 Petr has started doing screencasts with commentary, so probably we will be able to see his thoughts while he was solving this problem.
•  » » » 18 months ago, # ^ |   +4 I think he stopped doing it, as according to him it affects his thinking ability :(
 » 18 months ago, # |   +7 The most upvoted blog ever on CodeForces!
 » 18 months ago, # | ← Rev. 2 →   +14 I just want to know, Am I the only one who spent more than 1 hour to understand Div.2 B? :D
•  » » 18 months ago, # ^ |   +3 Me too bro
•  » » 18 months ago, # ^ |   +3 Same Here .... More than 1 Hour .
 » 18 months ago, # |   +14 Very nice round and well-written problems..... on a completely different topic : is there any problem with sharing the rating changes ? i can't see the usual buttons i.e: facebook , twitter ... and thanks again.
 » 18 months ago, # |   0 in Div2 C this test case" 2 8 8 32 " output 24 and it should be 0 and the code still AC why ???
•  » » 18 months ago, # ^ |   +9 p and q must be relatively prime
 » 18 months ago, # |   -7 why all my sloved skipped...
•  » » 18 months ago, # ^ |   +24 It means your solution resembles another's too closely, so either you cheated or you're pretty unlucky.
•  » » 18 months ago, # ^ |   +3 MikeMirzayanov and the entire codeforces community hates cheaters.
 » 18 months ago, # | ← Rev. 2 →   +4 Editorial? Nice set by the way
 » 18 months ago, # |   0 For 1E, does the following logic work?If the question just had 1 query for the case of n people, then we simply sort all of them by their estimated rating in ascending order and simulate.In a different line of thought, consider a fixed arrangement of people visiting the blog. Changing somebody's vote downwards (ie. making him downvote) will never increase the final rating of the blog.Suppose x people downvote the blog, y people don't vote and z people upvote it in the optimal arrangement. Then, there is an arrangement where we arrange the people in increasing order of estimated rating, enforce that the first x downvote the blog, the next y people don't vote, and the last z upvote the blog. Then this enforcement does not make anybody rate the blog better than usual, implying that the final rating is possible.Furthermore, if y>=2 people don't vote, this is equivalent to forcing the first of the y people to downvote and letting the last of them upvote, so we may assume y<2.This means that given a target rating, we can find out x, y and z required. Hence, we may binary search on the score. Queries are equivalent to asking whether the i-th largest element is greater than C-i for i<=k, for some constants C and k. This can be maintained using a modified balanced binary search tree.
•  » » 18 months ago, # ^ |   0 Suppose x people downvote the blog, y people don't vote and z people upvote it in the optimal arrangement. Then, there is an arrangement where we arrange the people in increasing order of estimated rating, enforce that the first x downvote the blog, the next y people don't vote, and the last z upvote the blog Cannot see why it's correct :( Consider this case? 4 1 1 1 1 First one upvote, then the following 3 people does not affect the rating.
•  » » » 18 months ago, # ^ |   0 uh I meant nondecreasing. Plus I wasn't being very clear I guess.What I meant is that: if we allow people to change upvotes to no vote/downvotes, and no vote to downvotes, we can achieve the desired format. In this case, we have the first person downvote it (it's not too hard to show that this cannot increase the final rating), then the second person (instead of upvoting) does not vote. Lastly, the last 2 people upvote, for a net +1.
 » 18 months ago, # |   0 How to solve div 2 C without binary search?
•  » » 18 months ago, # ^ | ← Rev. 4 →   +1 The fraction, that we need to get is fraction of this type: n * p / n * q. Now we need to find n. The only things, that we can do with starting fraction are +1 to denominator and +1 to both denominator and numerator. So, we cannot decrease y — x. That is why let's make an inequation: n * (q — p) >= y — x; n >= (y — x) / (q — p). Also, we cannot decrease numerator, so: n * p >= x; n >= x / p; Now, to find the first n, where the both inequations are correct let's take max of these ceiled values: (y — x) / (q — p) and x / p. The answer is: n * q — y, because the difference between numerators is always <= then difference between denominators due to our first inequation. Also, you shouldn't forget about cornercases, when p = q and when p = 0.
 » 18 months ago, # |   +14 But where is editorial?
•  » » 18 months ago, # ^ |   0
 » 18 months ago, # |   0 how to solve Div2 D/Div1 B ??
•  » » 18 months ago, # ^ |   +3 My solution gets like this : iterate all x for 0 to some high value (mine is 10000), this will be our answer. Check whether Vasya's score can be strictly higher than Petya's with current x.How do we check it? First we do some observations. For every problem, we can either :a. "maximize its score" (by using all fake account and get unsuccessful submission on this problem). Why is that? Because by using fake account to get unsuccessful submission for this problem, the number of participants increased and the number of solver of this problem remains the same. Therefore, the fraction goes more smaller as x goes higher, so this problem score increaseb. Get all fake account have successful submission for this problem, it will make this problem score decreased. Contrary to the a. Option above, the number of solver and total participants are increased, therefore the fraction goes higher, and the score for this problem decrease.Since there are only 5 problems in total, bitmasking is not big. we can try all configuration from 0 to 31 for the mask. For each bits of the mask, 0 represents strategy a. While 1 represents strategy b. Then for each configuration, try whether at any point Vasya's score can be greater than Petya's. Please note that to apply strategy b., Vasya must first solve the problem. It's easy to check that if current bit is 1 and Vasya's status is -1, then this bitmask configuration is invalid and try next possible configurationWhy we should try x only to 10000 and not 10^9 + 7? Because at some point the fraction as the number as fake account goes up, the fraction ratio of (solver/total_participant) will be extremely low or high so we can ignore them. Hope my explanation is clear
•  » » » 18 months ago, # ^ |   +19 I didn't check all 32 cases for this problem.For each problem, Vasya should fake as many successful submissions as possible ONLY IF he solved it and his performance is WORSE THAN Petya's (to decrease this problem's score and minimize the score difference for this problem).Otherwise, just submit unsuccessful submissions.
•  » » » 18 months ago, # ^ |   +3 thanks, it's very clear. i wasn't able to comeup with bitmasking thing.
•  » » » 18 months ago, # ^ |   0 nice
 » 18 months ago, # |   +6 Finally 2k17 :D One of the great contest of this year. Learned a lot
•  » » 18 months ago, # ^ |   +31 What did you learn?
•  » » » 18 months ago, # ^ |   +17 He learned that he should not say "Learned a lot" on Codeforces if he doesn't really mean it. xD
 » 18 months ago, # |   +8 When will the editorial be posted?
•  » » 18 months ago, # ^ |   +4 It was posted 20 hours ago http://codeforces.com/blog/entry/51883
•  » » » 18 months ago, # ^ |   +3 Sorry I was following this blog. Thanks
•  » » » 18 months ago, # ^ |   +8 I don't think it is posted 20 hours ago. That's the time it is written. It is posted about 3 hours ago. (about when the first comment is posted)
 » 18 months ago, # |   0 How I check,how many problems I solved in codeforces?
•  » » 18 months ago, # ^ |   0 This will work . http://cfviz.netlify.com/