### Errichto's blog

By Errichto, 5 years ago, ,

Hello Codeforces community!

Codeforces Round #318 (for both divisions) will take place on August, 29 at 19:30 MSK. It is the Thanks-Round devoted to Russian Code Cup. You will be given 5 problems and 2 hours to solve them. Scoring will be announced close to the round. I strongly recommend you to read all problems.

RussianCodeCup is the largest open programming competiton for Russian-speaking participants by Mail.Ru Group. Its history started in 2011. And since the first championship RCC offers great problems and generous prizes. This year finals will be held on September, 19th. Wish good luck to all the finalists! Thank you, RussianCodeCup, for your gift on the 5th anniversary of Codeforces!

I am honoured to be a problem setter for this round. I wouldn't do it alone. I want to thank Zlobober for his great help with problems preparation and MikeMirzayanov (and all people working on Codeforces and Polygon) for this awesome site. It's an amazing place to learn and compete. My big thanks to winger and AlexFetisov for their help with testing a round. And to Delinur for translating statements. As you see, not only a setter creates a round.

It's my first Codeforces round but not my first problems here. You can check out A, C and D from VK Cup 2015 — Round 2. Also you might remember some of my problems in TC rounds. I'm very happy with finally preparing a full round for Codeforces and I hope you will enjoy it. I tried my best to prepare nice and diverse problemset, you will judge it. In all problems you will have to help Limak who is quite unusual bear.

I wish you great fun and no frustrating bugs. Looking forward to seeing you!

UPD: Scoring is 500-1000- 1750 -2000-2500 in div1 and 500-1000-1500-2000- 2750 in div2. Enjoy a round!

UPD: Editorial

UPD: Contest is over. The winners:

Div1:

Div2:

1. cesc (5 problems solved!)
2. fhxb520630 (5 problems solved!)
3. bugCollector
4. Izaron

And note from an author. There were some wrong solutions passing. Sorry for that. I tried my best to create strong tests but I failed a bit. Did you like this round? What do you think about problems?

Thanks for participating!

• +380

 » 5 years ago, # |   +216 No T-shirts ?
•  » » 5 years ago, # ^ |   +48 like hunger games
•  » » 5 years ago, # ^ |   -11 T-shirts for Div2 only :PNow all Div1 participants will create a new account :D
•  » » 5 years ago, # ^ | ← Rev. 4 →   -12 Oh No! T-Shirts! But I'm in Div.2.
•  » » 5 years ago, # ^ |   -12 求虐!
 » 5 years ago, # |   +67 You solve a lot of users' problems in the blogs...Wish we can solve your problems too ;)
•  » » 5 years ago, # ^ | ← Rev. 2 →   -10 I love Russian ,I love code and I love cup ,it's should be interesting :D
•  » » » 5 years ago, # ^ |   +18 You love Russian,Code,Cup ??? But,But what about Taylor ?
•  » » » » 5 years ago, # ^ |   -7 I don't love him ; she is my life :D
•  » » » » » 5 years ago, # ^ |   0 him? she? shemale?
 » 5 years ago, # |   0 Maybe we should study your previous problems well, to get a whole look of the style of your problems. Maybe?
•  » » 5 years ago, # ^ |   +18 Hmm... interesting idea. Then you see some algorithms and techniques there and what does it mean? That it's likely to appear again or that I won't use something similar?
•  » » » 5 years ago, # ^ | ← Rev. 2 →   -35 Errichto you are great coder how i can mail you ? guys please dont vote down
•  » » » » 5 years ago, # ^ |   +2
•  » » » » 5 years ago, # ^ |   0 Apparently, you got voted down :p
 » 5 years ago, # |   -48 Good luck to all participants (Codeforces Round # 318 — Russian Code Cup). I wish you a good mood during the contest and rankings.
•  » » 5 years ago, # ^ |   +88 translate: I need upvotes , plz :)
•  » » » 5 years ago, # ^ |   +91 translate: I need upvotes , plz :)
•  » » » » 5 years ago, # ^ |   -48 translate: I need downvotes._.
•  » » » » » 5 years ago, # ^ |   -45 translate : I have nothing to do
•  » » » » » » 5 years ago, # ^ |   -26 translate: I too need more upvotes please
•  » » » » » » » 5 years ago, # ^ |   +5 Can you plz stop that?
•  » » » » » » » » 5 years ago, # ^ |   -13 wayA oG
 » 5 years ago, # |   -62 Considering the previous round i think it will be better to do dynamic scoring.
•  » » 5 years ago, # ^ | ← Rev. 2 →   +1 Considering your downvotes I think it will be better advertisement if they do static scoring.
 » 5 years ago, # | ← Rev. 3 →   +3 I think someone is getting ready to get first in this contest. to : sorry_dreamoon Be careful. You have a new mission : Antoniuk
 » 5 years ago, # |   0 I hoped this Contest for T-Shirts but ... TT.TT
 » 5 years ago, # |   0 LOL Guys you are so worried about T-shirts as if you can win them)
 » 5 years ago, # |   +26 I wish you great fun and no [frustrating bugs]. Oh yeah we all know where this will be going.
•  » » 5 years ago, # ^ |   0 Arrrh frustrating bugs. We'll see alright.
•  » » 5 years ago, # ^ |   0 **UPD : ** I guess my prediction is spot on. At least from my point of view.
 » 5 years ago, # |   0 This round takes place at the same time as the "Red de Programacion Competitiva" marathon :(
 » 5 years ago, # |   0 Good luck :)
 » 5 years ago, # |   +4 I think that I love This contest
 » 5 years ago, # | ← Rev. 2 →   +7 Actually although all problem statements in qualification and elimination rounds was in Russian two Japanese coders advanced to finals (rng_58 from third place and anta from 21st) :-)
•  » » 5 years ago, # ^ |   +35 Easy one for rng_58 :)
 » 5 years ago, # |   -8 Is the statement in Russian only?!?!
•  » » 5 years ago, # ^ |   +3 No :>
 » 5 years ago, # | ← Rev. 2 →   -22 the stupid one who saw he can't translate, to have upvotes i wish you can translate this comment ************
•  » » 5 years ago, # ^ |   0 to : Anonym_KALEP.please translate.Maybe I'm not a good translator.
 » 5 years ago, # |   -8 Problems will be in English? or not?
•  » » 5 years ago, # ^ |   +13 It will be normal codeforces round.
 » 5 years ago, # |   -7 Excuse me if I am wrong, but this guy prepared for VK Cup Round 2 one easiest and two hardest problems? If he did than this is real intriging.
•  » » 5 years ago, # ^ |   +7 I had some tasks and they chose the most interesting ones, that's it.
 » 5 years ago, # |   +25 This is usual round, guys. Statements will be both in English and in Russian.
 » 5 years ago, # |   0 Thank you roundwriter! Can't wait to see this round! :)
 » 5 years ago, # |   0 Lets hope Errichto prepares a great editorial as well as a great round for us . In the past few contests he has helped a lot of guys through his insightful comments . ALL THE BEST :)
 » 5 years ago, # |   -6 Hopefully, it won't be another Div 0 Contest.And don't get fooled guys. It will be like last round. In last round, there was a "PPS" stating top 20 of div 2 will get t-shirt, even though they didn't mention it before contest. I guess they are taking things another level higher. Saying no t-shirts now and then giving top contestants t-shirts later :DOr, they won't be giving any and I am just over thinking. I won't be getting t-shirt either way...
 » 5 years ago, # |   0 Guys, can you please tell me how can i add my school in my profile . Thanks in advance .
•  » » 5 years ago, # ^ |   0 Here: Your profile > Settings > Social > Organization(If I understood your question hehe.)
 » 5 years ago, # |   0 'Newbie' zone.... be prepared for me.... I'm almost there... ;_;
•  » » 5 years ago, # ^ |   0 Never care about rating, your goal is to solve as much problems as you can.Your challenge is against the problem setters. :D
•  » » » 5 years ago, # ^ |   +45 Looks like, the problem setters are winning ;_;
•  » » » » 5 years ago, # ^ |   0 You are very sarcastic, may be i wish could upvote you 100 times :)
•  » » » » 5 years ago, # ^ | ← Rev. 2 →   0 Think positively; solve one problem and its your win!
•  » » » » 5 years ago, # ^ |   0 Are people happy that the problem setters are winning?
•  » » » 5 years ago, # ^ |   0 I believe that not care for you and you are my hero :))
•  » » » » 5 years ago, # ^ |   0 Hey.... What about me?
•  » » » » » 5 years ago, # ^ |   0 You can both be his hero.
•  » » 5 years ago, # ^ |   0 You can't lose -127 rating in one contest.
•  » » » 5 years ago, # ^ |   0 That's very reassuring ;_;
•  » » » 5 years ago, # ^ | ← Rev. 2 →   +13 Doesn't Lose -127 rating mean gain +127 rating?
•  » » » » 5 years ago, # ^ |   0 I've gained +143 , but so far, didn't lose that much.
 » 5 years ago, # |   +5 someone should make codeforces fantasy league ,just like fantasy premier league in football ^.^ ,we can bet on favourite coders to win the round
•  » » 5 years ago, # ^ | ← Rev. 3 →   +13 Every one will bet on tourist and every one will win the bet :P
•  » » » 5 years ago, # ^ |   +4 Tourist will bet that "he won't win" and he will intentionally lose to win the bet :)
•  » » » » 5 years ago, # ^ |   0 That will be clear to all and it will be considered as cheating, :P
•  » » » » 5 years ago, # ^ |   +1 Wow! But, why should anyone even participate in something like this? Betting doesn't sound nice, besides, how will it help us?
•  » » » » » 5 years ago, # ^ |   +2 sometimes people do things for fun as well
•  » » » » » » 5 years ago, # ^ |   +1 Like, hunger games?
•  » » » » 5 years ago, # ^ |   +9 Looks like your guess came true today :/
•  » » » 5 years ago, # ^ | ← Rev. 3 →   0 ofcourse its a raw idea.. we can twist things round such as take any 10 coders where the addition of their ratings should not cross maximum limit or something like this.its upto you how much interesting you can make it :) .
 » 5 years ago, # |   0 Bear Limak will cause us trouble...
 » 5 years ago, # |   0 Looks like something interesting will happen with the bolded problem scores
 » 5 years ago, # |   0 Why 1750 and 2750 written with bold font?
•  » » 5 years ago, # ^ |   +6 Because usually this problem costs 1500(2500 in div 2)
 » 5 years ago, # |   0 What is the real difference between the knowledge level of a Blue guy and a Red Guy ? ?I think knowing more algorithms and more exposure to thousands of problems!
•  » » 5 years ago, # ^ |   0 They read a problem, and by the time they've finished reading the problem statement, they have the solution. That's the difference.
•  » » » 5 years ago, # ^ |   0 Even we have a solution to 2-3 problems but when it comes to 4-5th problems ,atleast I do not have any knowledge about the paradigms! Obviously they are better than me but Even I solve every problem related to the scope I have! Same is with everyone !I feel like there is something more than that :PBecause I have been coding since one year and yet blue :P
•  » » » » 5 years ago, # ^ |   +8 They can visualize problems better. They are insightful , and can code bug-free in their first attempt .
•  » » » » » 5 years ago, # ^ |   +1 Bug-free on the first attempt... I wish.
•  » » » 5 years ago, # ^ |   +3 Don't forget to mention: Even a green coder can solve Div2/A immediately after reading. The real difference is the complexity of the problem between that a red coder and a blue coder can code immediately. :D
•  » » » » 5 years ago, # ^ |   0 And I guess that comes through exposure to algorithms and problems..Practice and lot of practice!!
•  » » » » » 5 years ago, # ^ |   0 Yes, I think practising improve the level of your immediately solving ability. :)
 » 5 years ago, # |   +1 Ohhh, nice div1 registrants list ..
 » 5 years ago, # |   0 Where rooms?
 » 5 years ago, # |   0 There is guy who is printing "YES" or "NO" (in capital) in Bear and Poker . I tried to hack his solution and it gave me unsuccessful hacking attempt.Why? Its written in problem we have to print like this: "Yes" or "No".
•  » » 5 years ago, # ^ |   0 ?
•  » » » 5 years ago, # ^ |   +4 "yes" and "no "are usually case insensitive
•  » » » 5 years ago, # ^ |   +3 I think Codeforces treats "Yes" and "YES" same and vice versa for "NO".I read it somewhere in comments sometime ago .
•  » » » » 5 years ago, # ^ |   +20 It's not that Codeforces treats them similarly. Round writers are advised (I think they are) to use the checker which is case-insensitive unless they have strong reasons to have case-sensitive output. And most of the times this checker is being used indeed so (mostly) it doesn't make sense to hack such solutions. It should have been clear today that hacking "YES" <-> "Yes" doesn't make any sense since participant's solution passed pretests which would never happen in case of case-sensitive checker.
•  » » 5 years ago, # ^ |   +29 There might be some lee-way. The fact that the solution passed the pretests should have made it clear that your hack wasn't going to work though.
 » 5 years ago, # |   +126 I guess you should be awarded for designing the first anti-tourist contest ever! at least till now!
•  » » 5 years ago, # ^ |   -7 The first? Are you serious?
•  » » » 5 years ago, # ^ |   +32 Previous record was 24, now it is 168 :)
•  » » » » 5 years ago, # ^ |   0 and when he was ~20, rating decrease was about ~130.
•  » » » 5 years ago, # ^ |   +8 Of course he's serious, did you look at your own link? Notice how tourist's worst performance ever is 24th and he came 168th this round?
•  » » » » 5 years ago, # ^ |   0 Yes, but I think AliB's comment was posted before tourist fail D, maybe I'm wrong. Anyway, you're right.
 » 5 years ago, # |   0 not able to hack
 » 5 years ago, # |   +45 dreamoon hacked my A. Feel so honored!
•  » » 5 years ago, # ^ |   0 He hacked me once. I was angry.
•  » » » 5 years ago, # ^ |   0 Its better then getting WA at the end of the contest. dreamoon gave you one more chance. I think you should be grateful to him.
•  » » » » 5 years ago, # ^ |   0 You're right. Sorry Dreamoon. :)
•  » » » » » 5 years ago, # ^ |   0 You mean sorry_dreamoon? :D
•  » » » » » » 5 years ago, # ^ |   0 I knew someone will say this. No, i mean, i apologize, to Dreamoon. ;)
 » 5 years ago, # |   +13 The problems are so nice, thanks for the contest!
 » 5 years ago, # |   +8 I liked the problemset, but I've no idea how to solve Div1 D or E. Anyone want to share approaches?
 » 5 years ago, # |   0 I really like problems. Problem statements are clear. Even div2A required simple idea. Thank you
 » 5 years ago, # | ← Rev. 2 →   +6 I really hate when someones solution has overflow but when you try to hack it , it passes your test but is wrong and should give overflow in this test. UPD : 12760657 it didn't pass the full tests.
•  » » 5 years ago, # ^ |   +34 Also some guy fooled me with #define Int long long, lol.
•  » » » 5 years ago, # ^ |   0 You shouldn't be fooled if you know that Int is not int
•  » » » 5 years ago, # ^ |   0 I wonder if this is a common thing. I always use "typedef long long Int" but I've never seen someone else do it, at least from the competitors in my country :P
 » 5 years ago, # |   0 Was this contest easy or my skills have improved ?
 » 5 years ago, # |   0 Couldn't hack (or fail) because of lags at the end :( Div1 A-C look quite easy compared to other rounds. Though I failed to implement C..
 » 5 years ago, # |   0 This is the first time I solved A,B,C and had half an hour left. Thanks for that!
•  » » 5 years ago, # ^ |   +10 D (div-1B) was super easy too. I've implemented seg. tree, but when I looked at the other solutions, I realized how stupid I was =)
•  » » » 5 years ago, # ^ |   0 Just curious. What's your seg tree logic? Please share. :)
•  » » » » 5 years ago, # ^ | ← Rev. 5 →   +5 for (int i = 0; i < n; i++) b[i] = a[i] + i; for (int i = 0; i < n; i++) c[i] = a[i] + n - 1 - i; For example if a equals to {2, 1, 2, 1, 2} then b and c will be: {2, 1, 2, 1, 2} {2, 1, 2, 1, 2} {0, 1, 2, 3, 4} {4, 3, 2, 1, 0} _______________ _______________ {2, 2, 4, 4, 6} {6, 4, 4, 2, 2} Now let's build 2 segment trees using b and c to find minimum.It's easy to prove that: ans[i] = min(i + 1, n - i, a[i], minimum(b, i + 1, n - 1) - i, minimum(c, 0, i - 1) - n + 1 + i); And the result will be max(ans[i]).P. S. Yeah, I know, it's overkill ^_^
•  » » » » » 5 years ago, # ^ | ← Rev. 3 →   +3 Overkill or not, if it passes, its worth a try :)Actually, I don't see how your min(...) is so obvious. It took me hours to understand the problem setter's solution.edit: Instead of for (int i = 0; i < n; i++) c[i] = a[i] + n — 1 — i;why not just for (int i = 0; i < n; i++) c[i] = a[i] — i;?And, min(...., tree(c,0,i-1) + i ,....).
•  » » 5 years ago, # ^ |   0 Check it again. Anyway Congrats.
•  » » » 5 years ago, # ^ |   0 Yeah, my B failed :( . The pretests passed, and now I will debug it.
 » 5 years ago, # |   0 Am I wrong or there were no -50 points if you submit a solution that fails on a pretest from problem's sample tests in previous rounds?
•  » » 5 years ago, # ^ |   +3 Not all sample tests in general; only test#1 doesn't count.
•  » » » 5 years ago, # ^ |   0 Thanks!
 » 5 years ago, # |   +36 I pressed submit when there are still 20 seconds left but didn't submit my code successfully....... So sad T_T
•  » » 5 years ago, # ^ |   +17 Same here. I tried to submit my code when there were still 15 seconds left, but the submission page didn't load. I just checked that my code was correct.
•  » » 5 years ago, # ^ | ← Rev. 2 →   +22 And that code get AC.... Edit: It' problem E T_T
 » 5 years ago, # |   0 The problem set was commendable for me, especially the idea of problem C. Cheers!
•  » » 5 years ago, # ^ |   0 C was easier than B , don't you think?
•  » » » 5 years ago, # ^ |   0 I was talking about div 1.
 » 5 years ago, # |   +14 I was a bit late submitting div1 A because I didn't believe that it's that easy(specially after div1 A of previous round) and I must be understanding it wrong or missing something , anyone had the same situation?
•  » » 5 years ago, # ^ |   0 I had similar situation with div2 A but the constraints were too low and I got through.
•  » » 5 years ago, # ^ |   0 Yes. I questioned myself for 1 min.
•  » » 5 years ago, # ^ |   +41 My first thought was that it was made this way intentionally — after all those complains which we saw several days ago: "People can't solve A and they ignore contest, their rating doesn't change — and I am losing rating with solved A".
•  » » » 5 years ago, # ^ |   +17 Good guess.
•  » » 5 years ago, # ^ |   -78 Lol no, A's are almost always trivial x_0.
 » 5 years ago, # |   0 I was trying something like dfs to detect 3 member cycles for Div2-B and finally the flat O(n^3) got AC Suffered 3 WA and around 1.5 hours :(.
•  » » 5 years ago, # ^ |   0 n^3 AC?
•  » » 5 years ago, # ^ | ← Rev. 3 →   0 I also tried DFS to detect 3-vertex cycles, but failed miserably.
 » 5 years ago, # |   +73 So is this the first time tourist gets a three digit rank?
•  » » 5 years ago, # ^ |   +14 I did beat tourist with 6 points!
•  » » » 5 years ago, # ^ |   +5 Tourist doesn't always win every CF round.
•  » » » » 5 years ago, # ^ |   +5 But I have only done competitive programming for 9 months, let me be happy :(
•  » » » » » 5 years ago, # ^ |   +8 I've been coding much longer than that, and I am still green. You are a legend by my parameters :)
•  » » » » 5 years ago, # ^ |   +5 I said it's the first time he got a 3 digit rank.Please read the question er... comment carefully.
•  » » » » » 5 years ago, # ^ |   +5 I commented on JonStraat's comment :)
•  » » » » » » 5 years ago, # ^ |   0 HahaSorry, my bad!
•  » » » 5 years ago, # ^ |   +11 You should be careful now, who knows what tourist does with those who beat him...
•  » » » » 5 years ago, # ^ |   0 lol
•  » » » 5 years ago, # ^ |   0 Probability of that you can beat tourist in next round is very low
•  » » » » 5 years ago, # ^ |   +1 It wouldn't be special if the chance were high.
•  » » 5 years ago, # ^ |   +77 Well, he gave 167 people a contest to remember.Thank you tourist!
 » 5 years ago, # |   0 Can anyone please tell why my submission is giving runtime error? It is working fine on my local ide. Submission link : http://codeforces.com/contest/574/submission/12757848
•  » » 5 years ago, # ^ |   0 You did this : vector q(m,0); you allocated a vector of size N*M instead of N*N.
•  » » » 5 years ago, # ^ |   0 Thanks. But i still don't understand why this case is working on ideone :- https://ideone.com/JTSkfy
•  » » » » 5 years ago, # ^ |   +1 Overflowing is unpredictable.
 » 5 years ago, # |   0 I was so glad by fast solving Div1A (3 minutes), but in result couldn't solve Div1B, though it is not much harder than Div1A:DBut really nice problems. Thanks!
 » 5 years ago, # |   +8 What a contest? Tourist gets 3 digit rank, Petr only with 2 correct submissions until 1hr 45min. Kudos to the problem setter. PS: My personal opinion on the problem set is that it was very good. Since C was easy nobody would have ditched contest as a result of not solving any of them.
 » 5 years ago, # |   +37 Some O(qn) solutions passed Div1 D, and one O(n2) solution passed Div1 E. I think more tight time limits for those problems are necessary.
•  » » 5 years ago, # ^ |   +8 In D we didn't see any O(nq) with low constant factor and we wanted to pass (some solution with bitmasks).For E we had a O(n2) solution with many tricks to speed it up and it was still far from AC.Two big mistakes :/
•  » » » 5 years ago, # ^ | ← Rev. 2 →   +8 Thank you for the fun problems.
 » 5 years ago, # |   0 That was a wonderful round. Fast Editorial and nice problem set.
 » 5 years ago, # |   0 Can problem B div.1 solve by divide and conquer too?
•  » » 5 years ago, # ^ |   0 I was thinking the same. Since the structure can be split on the shortest tower, given its height is less than its distance from the boundary, it looks like a D&Q problem.
 » 5 years ago, # |   +17 I hope rating update is as fast as system test and editorial
 » 5 years ago, # |   +8 maybe problemset was good but there is a big differece between a — b,c and d — e div 1.
 » 5 years ago, # | ← Rev. 3 →   +5 Hi,Div2 Bcan anyone tell me what's wrong with this solution? http://codeforces.com/contest/574/submission/12750750Edit: one of my friends told me the problem... Using set.lower_bound() to search can lead to set.end() as the result which when I compare to a number can lead to false result. http://codeforces.com/contest/574/submission/12769046
 » 5 years ago, # |   +15 I didn't like having to help a bear politician cheat in div 2 Problem A.
 » 5 years ago, # |   +51 Could someone explain this code? http://codeforces.com/contest/573/submission/12760770
•  » » 5 years ago, # ^ |   +45 I don't think that's something our mortal minds can comprehend.
•  » » 5 years ago, # ^ |   +25 I guess he really is a machine like his username says.
•  » » 5 years ago, # ^ | ← Rev. 2 →   +34 It's clearly a brute-force, but seems to be incredibly sped up. The first trick is alignment of the variables in memory (some variables are told to be aligned to 16-byte blocks) — it probably helps cache do its work more efficiently (less cache misses and so on).The magic part (inner loop) uses SSE (set of processor instructions which allows many operations to be done at once; why do 100 000 32-bit additions/shifts/comparisons when we can use 128-bit SSE registers to do only 25 000 operations?). You can probably decode what it does here. I guess one can write a simple brute-force and then "encode it" in terms of SSE.Still, a question to the author: have you worked for a CPU/GPU manufacturer?
•  » » » 5 years ago, # ^ |   0 Is there a similar way to exploit SSE in Codeforces for other languages (I'm particularly interested in Java)?How much faster would C++ be compared to other languages for this problem?
•  » » » » 5 years ago, # ^ |   +16 In my opinion, in Java SSE intrinsics make no sense (Java source code is compiled to Java bytecode which is then run by Java Virtual Machine; you have no access to JVM code, so you cannot optimize it by hand — for example using SSE code).I have no idea how other languages compare to C/C++. However, the fact is that many of them may lack support for the intrinsics and thus we won't be able to control the power of SSE.
•  » » » 5 years ago, # ^ |   +24 Actually alignment is required for SSE instructions to work.
•  » » » 5 years ago, # ^ |   +13 Thank you for your explanation. In addition, I think those techniques are not needed if our submission runs on 64-bit systems.I have not worked for a processor manufacturer, but I have a bit of experience of performance tuning on CPUs and GPUs.
 » 5 years ago, # |   +14 Did author suppose that local optimization should pass in E?
•  » » 5 years ago, # ^ | ← Rev. 3 →   +1 Sry, ignore that comment.
•  » » 5 years ago, # ^ |   +35 Did author suppose that O(nq) should pass in D?
•  » » » 5 years ago, # ^ |   +3 :)
•  » » » 5 years ago, # ^ |   +8 those restriction seem to show that.
•  » » » 5 years ago, # ^ | ← Rev. 4 →   +11 We didn't see any O(nq) solutions with low constant factor. All of them were far from AC. And we wanted some (which also had big memory complexity) to pass. It turned out to be a bad decision.
•  » » 5 years ago, # ^ |   +3 I didn't.
 » 5 years ago, # |   +102 It seems that the test data of E is really weak and should be fixed.This obviously wrong solution of cubelover passed 41 out of 42 tests, and the 42nd test is so small that it could be solved in O(2NN). (maybe it was added during the contest..?) He got accepted with the same solution with some minor modifications.You can find more obviously wrong solutions which got accepted after the contest..
•  » » 5 years ago, # ^ | ← Rev. 2 →   +101 One specific example from cubelover:This solution from Marcin_smu gets wrong answer for this test: 3 -1 -3 3 The optimal answer is obviously  - 1 × 1 + 3 × 2 = 5, but it prints 3.This simple test could have been made even using a random generator!
•  » » » 5 years ago, # ^ |   +36 Marcin_smu, are you proud of your victory :D?
•  » » » » 5 years ago, # ^ |   +184 It's not my fault :) You should ask Errichto, whether he is proud of his tests.
•  » » » » » 5 years ago, # ^ |   +111 ;_;
•  » » » » » » 5 years ago, # ^ |   +34 Do you plan to add more tests for our practicing purpose? :)
•  » » » » » » » 5 years ago, # ^ |   +39 It's possible so I do plan to do it.
 » 5 years ago, # |   +43 I hate to wait for rate; but it's late and it's my fate.
•  » » 5 years ago, # ^ |   -12 you like hate?
 » 5 years ago, # |   +37 It seems that in problem C there are no tests with maximal degree 3 and answer NO: 12766417But such test exists and is quite simple.
•  » » 5 years ago, # ^ |   +12 for example
 » 5 years ago, # |   0 will i go with rank 108 div1?
•  » » 5 years ago, # ^ |   0 1689 not 1700 :(((((((((((((((((((((((( ;_; OH NO
 » 5 years ago, # |   +90 Finally red!
•  » » 5 years ago, # ^ |   +80 I know that feeling :)
•  » » » 5 years ago, # ^ |   +29 High five!
•  » » 5 years ago, # ^ |   +9 And at the same time a better rank than tourist , enjoy the moment :)
•  » » 5 years ago, # ^ |   +3 So you joined quite recently and have become very good quite fast, could you give some background on yourself, like what age you are and so on? You obviously practice a ton, have so many solved problems having joined only 9 months ago. Anyway it is pretty inspiring to me what a lot of practice in a short amount of time can do.
•  » » » 5 years ago, # ^ | ← Rev. 2 →   +4 I'm old, I started when I was working on my masters thesis in maths since I realized that I weren't really qualified for any jobs and I didn't want to do research. But at least it shows that it is never too late to start programming!
 » 5 years ago, # | ← Rev. 2 →   0 Why the problemset and the gym are still blocked?UPD working now.
 » 5 years ago, # |   +48 Really nice problemset! Natural and short (but yet original) problems which were really fun to solve or interesting to know the solution :) Thumbs up!
 » 5 years ago, # |   +42
•  » » 5 years ago, # ^ |   +8 dear god..
•  » » 5 years ago, # ^ |   +3 Why not more? Can you upload the whole contest?
•  » » » 5 years ago, # ^ |   +3 I think, a subscriber's screencast will be more interesting =)
•  » » » » 5 years ago, # ^ |   +28 And here it is.
•  » » 5 years ago, # ^ |   +20 Looking at amount of testing you did — you seems to be pretty confident about your solutions :)
•  » » » 5 years ago, # ^ |   +5 ... no luck, just skill. (c)Btw, I've trained that skill during some of my streams =P
•  » » 5 years ago, # ^ |   +39 return 0 * printf("No\n"); Сheater! :)
•  » » » 5 years ago, # ^ | ← Rev. 2 →   0 What about return cout << "No", 0; ?
•  » » 5 years ago, # ^ |   0 Wonderful!
 » 5 years ago, # |   +5 Master again.
 » 5 years ago, # |   0 In future (t-shirt giving) contests, we could state that there will be t-shirts for div2 after the contest, in that way, there won't be div 1 people here, and div 2 guys can also have a chance to win t-shirts.
 » 5 years ago, # |   +34 Мне кажется что это хитроумный план tourist-а, залажать на контесте. Что бы все снова начали о нем говорить, а то теперь когда он выигрывает никто не удивляется(он же Гена).
 » 5 years ago, # |   0 I tried to hack a solution of the problem C. It showed invalid input. Can someone help? Link: http://codeforces.com/contest/574/hacks/164504/test
•  » » 5 years ago, # ^ |   0 You print endl before the last number, instead of after it...For example, if n was 5, your code would produce: 5 1 2 3 4 5 
•  » » » 5 years ago, # ^ |   0 Oh thanks! But I tried using endl in the end also and still got Invalid input. Can you show me the code, how it should be?