### send_nodes's blog

By send_nodes, history, 23 months ago, ,

Hi everyone!

It's the round you've been waiting for... Codeforces Round #420 (Div 2). It will take place tomorrow, 25 June 2017, at 17:35 MSK. As always, Div. 1 participants are encouraged to join out of competition. The round will be rated for Div. 2 participants and will have 5 problems to be completed in 2 hours.

I wouldn't be able to create this round without the help of many people: KAN for lots of help in preparing the contest, gainullin.ildar and Alladdin for testing and providing feedback, and as always MikeMirzayanov for the Codeforces and Polygon platforms.

This will be my second contest, and I'm glad to get such a nice round number :). Hopefully, you'll find the problems interesting. Of course, you should read all the problems so you can solve problems you find easy or interesting.

To excite some and disappoint others, the round theme will have nothing to do with the number 420. Instead, continuing the anime themes of the last two rounds, round #420 will feature mad scientist Rintaro Okabe (don't read spoilers!) from the anime Steins;Gate. Statements will not contain any spoilers, but you might find the problems slightly more amusing if you've watched the series. Of course, you should watch the series if you havent :)!

As per Codeforces tradition, scoring distribution will be announced shortly before the contest. Good luck, and I hope you can help Okabe with all 5 tasks :D!

Scoring is standard: 500-1000-1500-2000-2500!

Update: Sorry for delays.

Update: Editorial is here: http://codeforces.com/blog/entry/52895

I really apologize for the issues during the round. It's upset a lot of people and I should have taken more care. Hopefully you won't hold this against Okabe or Steins;Gate anime :P

Here are the contest winners! Congratulations!

Div. 1

Div. 2

Thanks for participation everyone! Hope to write more problems in the future (without bugs)!

•
• +104
•

 » 23 months ago, # |   +20 "EID MOBARAK" in advance to every CODEFORCES user.
 » 23 months ago, # | ← Rev. 2 →   +43 Last 2 codeforces rounds was anime-themed and it will be third lol.
•  » » 23 months ago, # ^ |   +51 It's the work of the Organization !!!
•  » » » 23 months ago, # ^ |   +15 Nope, it must be the work of an enemy stand.
•  » » » » 23 months ago, # ^ |   +15 Let's hope JoJo for the next round. :P
•  » » 23 months ago, # ^ |   +7 Like "As per codeforces tradition, the contest will be anime-themed round". (?)
•  » » 23 months ago, # ^ |   +10 In addition, last codeforces round (#419) is anime-themed even the editorial, and dalex said a legend comments: Please hide this anime bullshit. Codeforces is not an anime site. I don't want to see these pictures when I read an editorial. But I think anime-themed is fun, so in my opinion, anime-themed is one of fun thing in contest.
•  » » » 23 months ago, # ^ | ← Rev. 4 →   +1 I think it is very true that anime themed is fun. Just curious, why this comment is highly downvoted (I can't figure out the reason)? Is anime thing is not fun? Or is it to be duty to codeforces problemsetting?
•  » » » 23 months ago, # ^ |   -74 I think porn-themed is fun, so in my opinion, porn-themed is one of fun thing in contest.Probably in the future, when downvoters become adults, they'll understand what content is appropriate for sites and what is not.If you want anime pictures, go to /a on your favourite imageboard and be happy.
•  » » » » 23 months ago, # ^ |   +6 It's the theme for the round, I never said anything about pictures...
•  » » » » 23 months ago, # ^ |   +7 I am not a big fan of anime, but I have no problem with that. It's nice to have some common theme for problems. Why are you such a drag here?
•  » » » » » 23 months ago, # ^ |   0 I only complain about pictures, like in the previous round. Today statements are good.
 » 23 months ago, # |   +4 So excited to maybe raise in level :D
•  » » 23 months ago, # ^ |   +20 Never mind :(
 » 23 months ago, # | ← Rev. 2 →   +10 For the people who don't know what send_nodes was talking about when he mentioned number 420 number 420 is the code for smoking marijuana...420blazeit baby.PS: I don't support, advise or otherwise suggest that you should smoke marijuana I'm just explaining what 420 and 420blazeit mean.
•  » » 23 months ago, # ^ |   +26 In India a betrayer is called a 420 guy
 » 23 months ago, # |   +22 Yoo niggas, Codeforces is "Still" the best but this round will rise CF to "The Next Episode"...Go 420 and have fun!!
•  » » 23 months ago, # ^ | ← Rev. 3 →   +36 And my rating will "Drop Like It's Hot"...
 » 23 months ago, # |   +3 Steins' gate! Loved it! :D
 » 23 months ago, # |   +83 Tu-tu-ruuu.. <3
•  » » 23 months ago, # ^ | ← Rev. 2 →   0 mayushii desu!
 » 23 months ago, # |   +2 420 BLAZE IT
 » 23 months ago, # |   +65 EL... PSY... CONGROO...
 » 23 months ago, # |   +106 I'm sad that it won't be rated for div 1... i'm TOO HIGH for the contest!
•  » » 23 months ago, # ^ | ← Rev. 2 →   +8 This contest was not rated even in Div.2 ..., so sad!
 » 23 months ago, # |   +54 Funny handle send_nodes
•  » » 23 months ago, # ^ |   +5 Send_nudes
 » 23 months ago, # |   +3 Hacking... to the gate? There's a joke in there somewhere...
 » 23 months ago, # |   +32 Do i need an IBN 5100 ?
 » 23 months ago, # |   0 if (Hacks) { will watch o_o the series }
 » 23 months ago, # |   0 Not a single 420 joke or reference? I'm a bit disappointed.
 » 23 months ago, # | ← Rev. 2 →   0 I'm impressed about the number "420". 420 is 2*2*3*5*7=420, so the number of divisors is 24. In addition, there is only one number which is lower than 420 and the number of divisors is more than or equal to 24. (Only one number is 360.) So the contest might be one of the period, I think. Good luck! :)
 » 23 months ago, # |   +17 if she didn't send nodes , the round will be hard ?
•  » » 23 months ago, # ^ | ← Rev. 2 →   +29 I think yes. (It is a joke) If she sent nodes, the problem's constraints would get easier!
•  » » » 23 months ago, # ^ |   +18 Send_edges
•  » » 23 months ago, # ^ |   +24 If she does, I will be hard.
 » 23 months ago, # |   +49 Please don't insert any image in the first question.Last time my page loaded after about 60 seconds. Everyone simultaneously opens first question and due to higher server load, page is rendered slowly. Actually, it happened with many.You can watch the screencast of reds.I like those images, but please don't add any in the first question.PS: Here's the link CF419 screen cast by eddy1021 — YouTube
•  » » 23 months ago, # ^ |   0 Or maybe load the first problem before the contest, and show them exactly at the start?
 » 23 months ago, # |   +18 Year 2017
•  » » 23 months ago, # ^ |   -6 Hello number 1 on problem-set standing
•  » » 23 months ago, # ^ |   0 Thank god, you are registered, otherwise you would be in 2018...
 » 23 months ago, # |   0 I can guess from your name that these anime in statements would be hentai
•  » » 23 months ago, # ^ |   0 he watches boku no pico
 » 23 months ago, # |   +44 Aw man ... no 420 themed puns ?
 » 23 months ago, # |   +15 In India, #420 means cheating and fraud as defined by a laymen as well as defined in the Section 420 of Indian Penal Code.....hopefully this round hasn't got anything to do with that...Lol :P
 » 23 months ago, # |   +51
 » 23 months ago, # | ← Rev. 2 →   -10 What the handle name :> ohhhhhh sorry, I read it wrong...
 » 23 months ago, # |   +11 My favourite anime!! :D
 » 23 months ago, # |   0 It seems to be intersecting with Google Kickstart.
 » 23 months ago, # | ← Rev. 3 →   +25 I hope we have one Game of Thrones themed contest in July.
•  » » 23 months ago, # ^ |   0 yeah , i hope so
•  » » » 23 months ago, # ^ |   0 King in the nor'f!
•  » » 23 months ago, # ^ |   0 Yeah ! And you will be asked in the task to calculate DSU between Cersie and Sir Jamie :D
•  » » » 23 months ago, # ^ | ← Rev. 2 →   +2 Lol, it won't be DSU, it will be SCC because they both belong to House Lannister :)
 » 23 months ago, # |   +5 TUTURU!!!
 » 23 months ago, # |   0 i wish all of you get a great rate and have fun :D
 » 23 months ago, # |   +4 Expected a weed themed contest, got a Steins;Gate one. Not disappointed :D
 » 23 months ago, # |   +7 I will just wait for the tutorial and travel back in time using my Phone Microwave (MAD SCIENTIST LAUGH)..
 » 23 months ago, # |   0 If I register the contest and I can't have the time to do the contest,will I lose rate?
•  » » 23 months ago, # ^ |   +9 If you don't submit anything, then your rating is not affected.
•  » » 23 months ago, # ^ |   0 No, Your rating will not be affected unless you made at least one submission. You can also unregister using the red 'x' icon beside your handle in the registrants' page.
 » 23 months ago, # | ← Rev. 2 →   -13 .
 » 23 months ago, # |   +17 CF severs, please, be OK during the contest
•  » » 23 months ago, # ^ |   +9 I hope girls were more like the Codeforces servers so they'd go down on me more often.
•  » » » 23 months ago, # ^ |   0 Then it is down now...:(
•  » » » » 23 months ago, # ^ | ← Rev. 2 →   +2 Down like my ratingEDIT: nvm, round is unrated
 » 23 months ago, # |   -6 The dankest Codeforces Round announcement ever. :D
 » 23 months ago, # |   +11 I think my name should be "send_rating" :) :D
 » 23 months ago, # |   +3 What is score distribution?
•  » » 23 months ago, # ^ |   0 Wait for it ...:)
 » 23 months ago, # |   0 C will be logical question.
 » 23 months ago, # |   +1 I hope, no delays...
 » 23 months ago, # |   +2 From Morocco, i wish you Aid Mubarak Said, hope we enjoy the contest good luck :D
 » 23 months ago, # |   +3 Eid Mobarok to Codeforces. Wishing all the best from Bangladesh :-)
 » 23 months ago, # |   +9 just 3 minutes left, score distribution?
 » 23 months ago, # |   +1 send_nodes, nice nikname though
 » 23 months ago, # |   0 Auto comment: topic has been updated by send_nodes (previous revision, new revision, compare).
 » 23 months ago, # |   +32 Is it just me or CF is having some server issues? CF isn't loading properly!
•  » » 23 months ago, # ^ |   +17 Not only the site isn't loading properly, but it was for a few minutes set that the contest will be delayed with 15 minutes. When the page finally got refreshed, I was disappointed to find out that the contest had already started....
•  » » » 23 months ago, # ^ |   +1 After submitting 15 odd times, my A went into judging and now nothing is visible.
•  » » » 23 months ago, # ^ |   0 yes, really disappointing!
 » 23 months ago, # | ← Rev. 2 →   +9 This round really seems to be simulates Steins; Gate.Who sent a D-mail?
 » 23 months ago, # |   +4 Shroedinger s round
 » 23 months ago, # |   +10
•  » » 23 months ago, # ^ | ← Rev. 2 →   +11 That's it! I'm not participating today ... I can't even get to submit successfully...
•  » » » 23 months ago, # ^ |   0 You are right^_^!! But to my superise is that :: the network speed after the contest is so fast after 14 min and I got my promblemsA's AC.
 » 23 months ago, # |   +24 Round should be unrated
 » 23 months ago, # |   +21 Plz, make it unrated! CF is lagging all the time!
 » 23 months ago, # |   0 Will it be rated?
•  » » 23 months ago, # ^ |   +1 It has to be unrated. My A which I submitted after 4 minutes went into judging at 17th minute and I had already left the will to do the contest because I thought it will get unrated and so did many other people.
 » 23 months ago, # |   +2 There seems to be a bug: if you press the Submit button and the contest announcement pops up before the problem is actually submitted, the problem isn't actually submitted.
 » 23 months ago, # |   +24
 » 23 months ago, # |   +2 Is the round still rated?
•  » » 23 months ago, # ^ |   0 No I guess!
•  » » » 23 months ago, # ^ |   +4 Its not have been officially announced though
 » 23 months ago, # |   0 Any Extra Registration today?
 » 23 months ago, # |   +3 Good afternoon, I have a problem, I think that not only me, that codeforces began to issue error 502 (504). And so on throughout the tour. For these reasons, I ask you to make a competition without a rating change.
 » 23 months ago, # |   +36 If the contest has been made unrated , Please make an official announcement
 » 23 months ago, # |   0 Give me answer Contest authors. Send your some questions.
 » 23 months ago, # |   -7 Problem C is very interesting problem. But I dont know how to solve it.
 » 23 months ago, # | ← Rev. 2 →   +28 Please help!! Why is output of D's last test case 3?I already asked problem writers, they haven't responded
•  » » 23 months ago, # ^ |   0 Wondering the same thing :/
•  » » 23 months ago, # ^ |   0 They said we should note some sample change but I haven't seen any changes.
•  » » » 23 months ago, # ^ |   +3 The last test case was output 4 previously!! They changed correct to incorrect :|
•  » » » » 23 months ago, # ^ |   0 What? I thought the answer is -1 ... Can you help me get why it is 4 ?
•  » » » » » 23 months ago, # ^ |   0 When on 1,1, we lit the first row, then we go to cell 1,2.From 1,2 we go to 2,2 which is lit so we can spend a coin at 2,2 and lit second row and so on.
•  » » » » 23 months ago, # ^ |   +1 "To change the row or column that is temporarily lit, he must stand at a cell that is lit initially" Either im an idiot and im not seeing a correct path or there really is no correct path.
•  » » » » » 23 months ago, # ^ |   0 Just like the note says, when you step at (4,4) and now if you set the last row light you can go to (5,5) just in one step
•  » » » » » » 23 months ago, # ^ |   0 But I don't know why the ans changes to 3
•  » » » » » » » 23 months ago, # ^ |   +3 I know that! QAQ We can move from (1,1) to (3,3) if we light up the second row
•  » » » » » 23 months ago, # ^ |   0 Does that mean correct answer to last test case is still 4 ?
•  » » » » 23 months ago, # ^ |   0 Ohhh... it says he can light up any column and row, not just those which he is standing on...
•  » » 23 months ago, # ^ |   0 You can move from cell (1, 1) to cell (3, 3) by temporarily lighting row 2 or column 2
•  » » » 23 months ago, # ^ |   +3 Shoot! I thought we have to stand on the row we temp. lit, given that we are standing on a lit cell.
»
23 months ago, # |
+10

# 420? CF BLAZES AWAY

 » 23 months ago, # |   0 Please someone explain Sample 4 of problem D how it takes only 3 steps previous answer was 4 which seemed correct to me.
•  » » 23 months ago, # ^ |   0 same problem confused b/t tc 1 and 4 :(
•  » » 23 months ago, # ^ |   +3 You can move from cell (1, 1) to cell (3, 3) by temporarily lighting row 2 or column 2
•  » » » 23 months ago, # ^ |   0 When you are at (1,1) you have to light either row 1 or column 1, right? Then when you come to (2,2) you have to do the same thing. I can't see how you can transport from (1,1) to (3,3) with only one lighting.
•  » » » » 23 months ago, # ^ |   0 I assumed the same thing but turns out we are wrong.. You can light any row and any column if you are standing on an initially lit cell :/
 » 23 months ago, # |   +19 First time in my lifetime i got "Pretests passed" for E during contest! Pl. dont make this round unrated
•  » » 23 months ago, # ^ |   +1 I guess it will be and it must be problem D still not clear
•  » » » 23 months ago, # ^ |   +3 Yeah they made it unrated :(
•  » » 23 months ago, # ^ |   -15 I solved E for the first time too. You are sorry too often CF. Almost every second contest. Does anybody knows better contest platform?
•  » » » 23 months ago, # ^ |   +9 Lol ... CF is not that bad. Frankly, its the best platform. All contests being issue-free is not practically possible.
•  » » » 23 months ago, # ^ |   0 Only a very few contests face major issues and get unrated like this. I happened to me twice in > 60 contests.
•  » » » » 23 months ago, # ^ |   0 but you only joined 59 contests :P
•  » » » » » 23 months ago, # ^ |   +8 Two were unrated, so that makes 61 contests that were supposed to be rated. :-)
•  » » 23 months ago, # ^ |   +8 FIrst time I get "Pretests passed" on the first four problems, but still green at the end of the day...I guess I should not take the ratings too seriously
 » 23 months ago, # |   0 Okay, that is my first time destroying the contest, sorry folks :/
 » 23 months ago, # | ← Rev. 2 →   +1 Codeforces just announced that the round will be unrated due to problems in question D :( . I really worked hard in trying to solve A,B and C.
 » 23 months ago, # |   +35 Why unrated? I do not aware of the changes of D. And my original thought can pass the tests.
•  » » 23 months ago, # ^ |   +23 I think the problem description is quite clear :(
•  » » 23 months ago, # ^ |   +1 Yes, the statement was clear enough to notice the issues with the samples. And anyways the round could be rated for problems: A, B, C & E.
 » 23 months ago, # |   +47 problems in codeforces , delay in the round , problems in D , unrated round , all of this because she didn't send nodes ?
•  » » 23 months ago, # ^ | ← Rev. 2 →   +11 or may be because she send n"u"des indeed :P
•  » » » 23 months ago, # ^ |   +3
•  » » » » 23 months ago, # ^ |   0 Oh sorry, I can not understand. I am quite busy watching deathly Hallows right now. :P
•  » » » 23 months ago, # ^ |   +11 Exception in thread "main" java.lang.Error: Unresolved compilation problems: Type mismatch: cannot convert from nudes to nodes
 » 23 months ago, # |   +1 I got 50 points penalty on resubmitting the same solution for A. Did anyone else have the same problem?
•  » » 23 months ago, # ^ |   +1 I do in problem C.
 » 23 months ago, # |   +4 Let's discuss!Is E matrix expo?
•  » » 23 months ago, # ^ |   0 Contest isn't over yet.
•  » » » 23 months ago, # ^ |   +11 What contest ;)
•  » » » 23 months ago, # ^ |   +14 but unrated :(
•  » » 23 months ago, # ^ |   +14 clearly
•  » » » 23 months ago, # ^ |   0 D was harder. Why can't problem writers guess difficulty a little better, as it's a matter of 500 points?
 » 23 months ago, # |   +2 Maybe the nodes were not sent! Jk :P
 » 23 months ago, # |   +21 So sad as both rounds of send_nodes are unrated :(
 » 23 months ago, # |   0 If i am not mistaken, the authors last round was also made unrated due to some issue. @send_nodes having two contests of yours having issues is a bit frustrating. Pl. be careful next time.
•  » » 23 months ago, # ^ |   +14 First contest was unrated because of server issues afaik.
 » 23 months ago, # |   0 its unrated. enjoy..
 » 23 months ago, # |   -80 Shitty Contest with Shitty Problems! What a combination!
 » 23 months ago, # |   -9 it must be unrated.
•  » » 23 months ago, # ^ |   0 Codeforces has declared that it will be unrated due to problems in question D and server lagging.
 » 23 months ago, # |   +17 SERN is behind this?!
 » 23 months ago, # |   +4 Happened to me first time that a rated round became unrated . It hurts .
•  » » 23 months ago, # ^ |   +3 it doesn't hurt if predictor shows -17
•  » » » 23 months ago, # ^ | ← Rev. 2 →   +3 But it does when it shows +115...
•  » » » » 23 months ago, # ^ | ← Rev. 3 →   +1 It does when it shows +70
 » 23 months ago, # |   +2 I liked D, almost ready to press submit! Then I realized I was solving a different problem. If we have to stand on the row/col we temp. lit, it's DP. Now I have to think from scratch :/
 » 23 months ago, # |   0 Unrated due to D? -_- or because of server. anyway you could have just removed D...Maybe from next time CF should have "back up problems". It's kind of depressing when you hear after "2 hours" that a rated contest has become unrated and all those time "when you kept hitting the refresh button and hoping cf will load" become futile. Just sad :(
•  » » 23 months ago, # ^ |   +38 How exactly do you envision removing problems or having "back up problems" as saving the contest?
•  » » » 23 months ago, # ^ | ← Rev. 3 →   0 I don't know if it is even a good idea but suppose you are a setter and in some moment of the contest you found that your solution was wrong and if you already made another "D category" problem, you can replace it and even extend the contest time. Yes, there's another option that you can remove that problem (which happened in the past on CF as far as i know) but i dont think that will be fair to judge someone's ability. If a contest only had "A Level" difficulty or "E level" difficulty problem, then it would be hard to determine who is really talented. That's my opinion. I don't know if this thing is really possible or not.
•  » » » » 23 months ago, # ^ |   0 Have you any idea, I've almost completely stopped opening div2 A/B now during contest -_-. Now imagine if C,D,E get replaced. There are others like me.
•  » » » » » 23 months ago, # ^ |   0 dont you get pop out notifications when a change has been made during a contest? yeah you have to keep your browser (where you kept the CF tab open) open. So during any modification, you will know. And time should be extended if that happens. But isn't it better than an unrated contest? Some of us cancel our events just so we can do a rated contest. we can do an unrated contest anytime. Today i canceled my program (and got a lot of scolding -_-) for CF
•  » » » » » » 23 months ago, # ^ |   +14 Imagine I've spent 1 hour on a problem that gets cancelled! Is it fair to me?
•  » » » » » » » 23 months ago, # ^ |   -15 Imagine my 2 hours and 40 seconds -_- . But yes it's not fair for you. It's not fair for me -_-. But does it take so much time to realize that their solution was wrong? i mean isnt there a team? a person can make a mistake. but a team made a mistake? :| that's kind of sad. anyway things like these happen. Life. I remember when i was doing well on a contest and when i just solved C i found out the contest was unrated due to server :| ...and the funny part was my ratings decreased after those two contests. but all of my solutions were correct in that "canceled" contest.... Life
•  » » » » » » 23 months ago, # ^ |   +5 I wasted almost an hour trying to understand the sample before any answer from the contest setter/cf. And then when I gave up I opened problem E and thought instantly "why is this easy matrix problem E while that other one is D?". I'm sure that there are people that did the same as me in div2 and if that's the case it should be unrated because the difference between these people and others that got higher placings are that some skipped problem D and others didn't. The whole problem was because of a wrong sample case.
•  » » » » » » » 23 months ago, # ^ |   +5 Actually, it took me maybe 30-60 seconds to know E's approach. D had some cases to handle, so even if D was all correct, E was still easier than D. I think writers should put a little more effort into deciding problem difficulty.
•  » » 23 months ago, # ^ |   +8 By the time people complained about D, many other contestants had already spent a lot of time trying to solve it. Thats why things are not that simple. It really should be made unrated, as everyone expects a WA to be a WA and so on.
•  » » » 23 months ago, # ^ |   0 i get it though i didnt get time to even think about D because of loading problem. but still as i said it feels really awful when at the end of the contest you see it's unrated. maybe there could be other ways.
 » 23 months ago, # |   +36 I was really happy that I got 3432 point in pretest and pretty sure would get more than half hundred rating. Then suddenly a window popped out and punched me in the face.
 » 23 months ago, # |   +26 round unrated
•  » » 23 months ago, # ^ |   +3 Sponsored by Dr. Pepper -- Damn I am glad you didn't missed the meme opportunity.
 » 23 months ago, # |   +27 Making this round unrated made us totally frustrated :(
 » 23 months ago, # |   0 How do you solve B?
•  » » 23 months ago, # ^ | ← Rev. 4 →   0 sum of ( sum of first x natural numbers * y, sum of first y natural numbers * x ) for each value of x, such that rectangle is under the lineNotice the line-intercept notation of a line. y/(m*b)+x/b=1. min(m*b,b) = b, which makes linearly checking x feasible.
•  » » 23 months ago, # ^ |   0 for (int y = 0; y <= b; y++) { long long x = m * b - m * y; ans = max(ans, ((x * (x + 1)) / 2) * (y + 1) + ((y * (y + 1)) / 2) * (x + 1)); } 
•  » » 23 months ago, # ^ | ← Rev. 2 →   +3 Sum of x+y for all points in the rectangle determined by x and y is (1 + x) (1 + y) (x + y)/2. It is enough to test only points which have integer coordinates, as only lattice points have trees. So, iterate y from 0 to b, determine x and use the formula. There are less efficient solutions, and also there may be a O(1) solution, but this works just fine.
•  » » » 23 months ago, # ^ |   0 I can't get the formula to calculate bananas depending on x and y. Can u explain
•  » » » » 23 months ago, # ^ | ← Rev. 4 →   +5 Sum of all x: x * (x+1)/2Sum of all y: y * (y+1)/2How many times each value of x is summed: y+1How many times each value of y is summed: x+1So: x*(x+1)/2*(y+1) + y*(y+1)/2*(x+1)Which is simplified to (1+x)(1+y)(x+y)/2
•  » » » » » 23 months ago, # ^ |   0 Thanks . I got it .
•  » » 23 months ago, # ^ |   +6 at first i tried Ternary Search, but it was false. Then i realized that i just need to use brute-force :v
•  » » » 23 months ago, # ^ |   +3 I used ternary search. Why won't it work?
•  » » » » 23 months ago, # ^ |   0 oh, due to my bad skill :D
•  » » » » 23 months ago, # ^ |   +3 i mean the Ternary Search was right, but my code was wrong.
•  » » 23 months ago, # ^ |   0 To maximize bananas, you always want the bottom left point of the rectangle to be at point (0, 0). All that's left to do is find the upper right point of the rectangle.the line intercepts the Y-axis in the value b, so you have at most 10000 possible y values for that point. Iterate through all those 10000 y values and find the maximum value for x at that y by solving y = -x/m + b for x and rounding down the solution to an integer value.You also need a count_bananas function that for given x and y of the upper right point of the rectangle calculates the number of bananas in the rectangle. the formula for this is: (sum from 0 to x) * (y + 1) + (sum from 0 to y) * (x + 1).So you just iterate every possible y value, find the corresponding x value, and calculate the number of bananas for that pair, and print the max bananas at the end. At least this is how I solved it, there might be a better O(1) solution using math.
 » 23 months ago, # |   0 I think E was a quite straightforward DP, except combinatorics part. I didn't manage to get it. How did you solve E?
•  » » 23 months ago, # ^ |   0 Is possible to calculate dp faster with matrix exponentiation
•  » » 23 months ago, # ^ |   0 It was matrix exponentiation. If you know the number of ways to get to (a[i], 0), (a[i], 1), ... (a[i], c[i]), then you can determine the number of ways to get to (b[i], 0), (b[i], 1), (b[i], 2), ... (b[i], c[i]). The transition matrix is 16x16.
•  » » 23 months ago, # ^ |   0 Say you have x_i ways to be at position (a,i). Then you have x_{j-1} + x_j + x_{j+1} ways to be at (a+1,j), where each indexed x_? is 0 if it goes out of bounds. This is a linear transformation, so for each segment you can make a (c+1)*(c+1) matrix and compute the transitions along it with fast matrix multiplication, then resize cutting off or padding zeroes when moving to the next segment.
 » 23 months ago, # |   +18 why this shit happens even if problems are tested by others???
•  » » 23 months ago, # ^ |   0 Maybe author commited a mistake while writing the problem statement, but he described the other problem when telling to others.
•  » » » 23 months ago, # ^ |   0 In that case answers should not match!!
 » 23 months ago, # | ← Rev. 2 →   -25 good contest
•  » » 23 months ago, # ^ |   0 You're supposed to post in english under the english part of codeforces. I suggest you edit it before the downvote flood. lol
 » 23 months ago, # |   -8 Guys, it was just a big misunderstanding. Problemsetter didn't know that the nodes would have a "D" in them.
 » 23 months ago, # |   +3 When you're enjoying the contest And then you see this..
 » 23 months ago, # |   0 How to solve problem E? Thanks.
•  » » 23 months ago, # ^ |   -9 A naive idea would be trying to dp from one end to the other, you could observe that the state transitions are actually rather simple, try to find a way to exploit it. :)Hint:
 » 23 months ago, # | ← Rev. 4 →   0 In problem D the first and fourth samples were wrong they should have equaled to 1 and 2 instead of 2 and 3edit : as walnutwaldo20 pointed out i misunderstood the problem
•  » » 23 months ago, # ^ |   0 No they were 2 and 3. You can't get off onto (N-1, M-1) unless it is lit.
•  » » » 23 months ago, # ^ | ← Rev. 2 →   0 int the first you can light row 3 then go like this : 1 1 -> 2 1 — > 3 1 -> 3 2 -> 3 3 -> 3 4 -> 4 4 and pay one and in the second you light collumn 2 and then after going to 3 3 light collumn 4 and go to 5 5 unless i have understood something wrong
•  » » » » 23 months ago, # ^ |   0 But you can't do 3 4 -> 4 4 because 4 4 is not lit up.
•  » » » » » 23 months ago, # ^ |   0 oh, sorry i thought you could, you are right!
 » 23 months ago, # | ← Rev. 2 →   +19 It seems to me that some people started competing at the 00:00 mark, while others started at the 15 minute mark.PS: Was it by any chance a synchronization problem, due to the fact that someone tried to delay the contest too close to the beginning, or something else?
•  » » 23 months ago, # ^ |   0 This is so true! The problems didn't load for me until after a few minutes of the contest.
•  » » » 23 months ago, # ^ |   +7 Lag was so bad problem A loaded as a PDF for me.
•  » » » » 23 months ago, # ^ | ← Rev. 2 →   0 Same here! Initially. I was worried whether I was the only one facing this weird problem.
 » 23 months ago, # |   +4 Nice problems, so sad it's unrated tho :(
 » 23 months ago, # |   +7 Don't worry, send_nodes will send a D-mail about problem D, and the round will be rated (in an alternate world)
 » 23 months ago, # |   +3 If the system can make it unrated just for some people who are effected by the problem D?
 » 23 months ago, # |   +18 http://codeforces.com/contest/821/submission/28036426Cheaters in an unrated contest.....
•  » » 23 months ago, # ^ | ← Rev. 2 →   0 why is this cheating?edit: ok, I think obfuscated code is not allowed, but he's the only one that will loose points because of that (in case of a possible hack that didn't happen)
•  » » » 23 months ago, # ^ |   0 It's obvious it's cheating. Who writes defines like that? Must have copied someone else and obfuscated the code to bypass the similarity check.
•  » » » » 23 months ago, # ^ |   0 Ah, I see, but I think codeforces cheating detector will find this.
•  » » » 23 months ago, # ^ |   0 Taken from Codeforces Contest RulesIt is forbidden to obfuscate the solution code as well as create obstacles for its reading and understanding. That is, it is forbidden to use any special techniques aimed at making the code difficult to read and understand the principle of its work.
•  » » 23 months ago, # ^ |   0 Do they have a program that can program? What is going on?
•  » » » 23 months ago, # ^ |   0 A couple rounds back someone else did the same thing, it is done by a program which obfuscates the code so that the code that was copied off someone else won't get detected by the checker.
•  » » » » 23 months ago, # ^ |   0 that's actually smart
•  » » » 23 months ago, # ^ |   0 His code works just fine, he just used a #define for each original line. The compiler will replace the defines with the correct code before compiling.
•  » » 23 months ago, # ^ |   +3 farmersrice we wrote a code to reverse the code and used pretty print and got the real code! check it out! ==> https://pastebin.com/1BQAaw73 hope the codeforces guys do the same with every such code so these cheaters can be caught(if he is a cheater:p XD)!!
 » 23 months ago, # |   0 How is problem D solved?
•  » » 23 months ago, # ^ |   0 I tried just doing a standard shortest path algorithm where you can jump to any tile that is less than or equal to two rows or columns away. It didn't work however, since I got RTE on pretest 14.
 » 23 months ago, # |   +4 your first round Codeforces Round #370 (Div. 2) ended up unrated too, feel sorry for you man :(
•  » » 23 months ago, # ^ |   0 relevant profile pic
•  » » » 23 months ago, # ^ | ← Rev. 2 →   +3 I did the same and got pretests passed, but now that rejudged it, I got WA on test 4, but the idea woks
 » 23 months ago, # |   0 Making it unrated made me feel covfefe.
 » 23 months ago, # |   +12 Do it rated :c
 » 23 months ago, # |   0 how to solve problem B?
•  » » 23 months ago, # ^ | ← Rev. 2 →   0 I've just find the optimal x,y to be the rectangle vertex touching the line[satisfy the equation] In O((b/2)^2). It has to be the greatest in area ((b/2)^2) and just calcullate the sum between each x and y inside that area. Not sure about more efficient solution, but that approach should pass the 2 seconds constraint.Be aware how yo find that vertex and corner cases like 1,1... Good luck my friend :)
 » 23 months ago, # |   -13 Too much math for one round
 » 23 months ago, # | ← Rev. 2 →   0 send_nodes be like : I wont make a contest from next time because my every contest is unrated.
 » 23 months ago, # | ← Rev. 3 →   +11 Today was my sister's birthday. She came to my country after 1 year. I was supposed to be at her birthday party. But I chose to sacrifice the birthday party to attend this contest. I was sad first, then I thought I will try to make myself happy by solving problems. The first 10 minutes of the contest, I cannot load the website. Then I tried to solve some problems. I was able to pass pretests of three problems. I was very happy after that. At the last 10 minutes of the contest, there was a notification saying the contest will be unrated. Very sad life for me.I hope from the next contests, the quality of the problemset will be better and there will be less bugs in the websites as well as in problems.
•  » » 23 months ago, # ^ |   +36 You seriously chose participating in a CF contest over attending your sister's birthday party?
•  » » » 23 months ago, # ^ |   +10 Are you seriously surprised?
 » 23 months ago, # | ← Rev. 2 →   +4 I don't know who is the unlucky one: me, or send_nodes. xDI perform good in his rounds but unlucky they end up unrated.
 » 23 months ago, # |   0 Actually it was good round if it is assumed as an educational round. :D
 » 23 months ago, # |   +17 Predictor said high rating change if system tests aren't mean. This is gonna be a great nigh--screamsThe problem statement is quite clear. No ambiguity there. Even if the main solution is incorrect, testers' solutions should somehow end up getting different answers. Why did this end up happening anyway?I love the problems though.
 » 23 months ago, # |   0 whats test case 8 for Div2B? this simple solution http://ideone.com/sdPvQD fails test 8 can someone tell why? the check function simply returns true if the point (x, y) lies below or on the given line.
•  » » 23 months ago, # ^ |   0 In my solution (that passed pretests) answer for test 1000 10000 is equal to 74133360011484445,meanwhile you print 55049995000.
•  » » 23 months ago, # ^ |   0 As Mucosolvan has said, you produce the wrong answer because your search space is too small. You are checking all points within 0 <= x <= 1000, 0 <= y <= 10^4. However, for a sample test case like 1000 10000, the answer exists at (6666000, 3334)
 » 23 months ago, # |   +23
•  » » 23 months ago, # ^ |   0 Does it really matter, since the contest is unrated?
•  » » » 23 months ago, # ^ |   +5 Yes, i really want to submit in practice mode.
 » 23 months ago, # |   +17 If round was rated, your rating would be like in this table
•  » » 23 months ago, # ^ |   0 Good thing I found a mistake in D, otherwise -18 :X
•  » » » 23 months ago, # ^ |   0 -18 too lol.
•  » » 23 months ago, # ^ |   0 Very cool feature! Is there a way to see this prediction table of rating change in every contest?
•  » » » 23 months ago, # ^ | ← Rev. 2 →   0 Thanks) You could read more about this tool in the my blog or just install extension for your browser:
 » 23 months ago, # |   0 I could have got 6368 points (if I don't FST and) if there wasn't such a serious bug in D, and I ranked 1st before the announcement... I admire the courage to submit and ignore the 4th sample test.Anyway, it's originally unrated for me (since I'm in div 1). I'm really happy to solve problems featuring Okabe from my favourite anime Steins;Gate, and I did find the problems slightly more amusing:D
 » 23 months ago, # |   -6 Auto comment: topic has been updated by send_nodes (previous revision, new revision, compare).
•  » » 23 months ago, # ^ | ← Rev. 2 →   -41 *_*
 » 23 months ago, # |   0 Can I see the final standing before dying ? Why so much delay in everything today ? First the contest then delay in clarification and now system testing too ! GREAT !
 » 23 months ago, # |   +1 At least editorial came fast :D
•  » » 23 months ago, # ^ |   +22 :D
 » 23 months ago, # | ← Rev. 2 →   0 How to solve Problem C? EDIT: Sorry I didn't see that the editorial is already out.
 » 23 months ago, # |   0 First time end up solving 3 problems and now the round is unrated .
 » 23 months ago, # |   0 AbdoFoda hacked my C, but after system test......his solution was wrong also!!! LOL!!!! :D
•  » » 23 months ago, # ^ |   +1 you will be surprised my solution is wrong at the test I hacked you by :3
•  » » » 23 months ago, # ^ |   +1 Really? :o ha ha ha!!!
 » 23 months ago, # |   -16 Two hours wasted .. :P
 » 23 months ago, # |   0 have they posted the editorials ? i cant find them if anyone can help ?
•  » » 23 months ago, # ^ |   0 It is stated in the post: http://codeforces.com/blog/entry/52895
 » 23 months ago, # | ← Rev. 5 →   +14 ..
 » 23 months ago, # |   0 Are they just say contest unrated and that's all? They still didn't give any motivation.
 » 23 months ago, # |   -9 Auto comment: topic has been updated by send_nodes (previous revision, new revision, compare).
 » 23 months ago, # | ← Rev. 2 →   +2 This D is just a masterpiece.Square samples (this issue has been raised million times, but who cares, lmao), profound testing leading to total misunderstanding in sample test #4 and ML at test 28 not included in pretests as a cherry on top. Incredible! Why can't I take my upvote back :/
 » 23 months ago, # | ← Rev. 2 →   +7 There were 2 contests from send_nodes and both were unrated. Unlucky :(
 » 23 months ago, # |   0 Can somebody explain test 48 in D? My code returns -1, while the answer is 20.Is it possible to move directly from one position to another if both rows and columns differ by more than 1?
•  » » 23 months ago, # ^ |   +6 Yes. 1 1 and 3 3 you can light the column 2 and go through it.
•  » » » 23 months ago, # ^ |   0 Thanks — I haven't thought about that...
 » 23 months ago, # | ← Rev. 3 →   0 Nevermind
•  » » 23 months ago, # ^ |   0 Do you have any strategy for finding errors like this? lol I have been seeing a lot of these recently (in my own solutions)
•  » » » 23 months ago, # ^ |   0 actually i just mistyped a as b and didn't notice it before posting , as for finding the error , i printed out the points in sorted order and saw that theres an error in sort.
 » 23 months ago, # |   0 Can anyone point out the mistake in my submission of Okabe and Future Gadget Laboratory? Here is my submission link:http://codeforces.com/contest/821/submission/28046977
 » 23 months ago, # |   -27 2010 the first contests codeforces.
 » 23 months ago, # |   -17 The ratings are still not updated..the contest was rated toh
•  » » 23 months ago, # ^ |   0 Due to bugs it was made unrated!
 » 23 months ago, # | ← Rev. 3 →   0 What's wrong with my program? Why it's not working? (Problem B) Code//CODEFORCES #include #include #include #include //#define f first //#define s second typedef long long ll; typedef unsigned long long ull; using namespace std; ull sum; int m, b; inline int uravnenie (int x) { return (-x / m + b); } inline ull countOfBananas (int x, int y) { ull sumOfY = (y * (y + 1)) / 2, sumOfX = (x * (x + 1)) / 2; return sumOfY * (x + 1) + sumOfX * (y + 1); } int main () { cin >> m >> b; for (int x = 0; x <= b * m; x += m) { int y = uravnenie(x); ull bananCnt = countOfBananas(x, y); if (sum < bananCnt) { sum = bananCnt; } } cout << sum << endl; return 0; } I figured out. sumOfX = (x * (x + 1)) / 2; `The problem was casting types.
•  » » 23 months ago, # ^ |   0 limits, change some types to ll instead of int
 » 23 months ago, # |   0 Pls give me an idea for problem B .
 » 23 months ago, # |   -6 I like your every post because you always give the best information through your post. I always get and follow the new things which is get from your post. So again thank you for sharing this post. Me Manvi Kakkar. One of the high profile phenomenal Mumbai Escort. For more information you can visit here.