### Mahdi_Jfri's blog

By Mahdi_Jfri, 4 years ago,

Hi Codeforces!

I'd like to invite you to join Codeforces Round #446 which will be held on November 17 at 17:35 MSK.

And yes it is rated.

The contest is prepared by Omid Azadi (omidazadi), Mehrdad Saberi (Batman), Arshia Soltani (ckodser), Aryan Esmailpour (Aryan) and me (I honestly didn't do anything).

And also thanks to Mahdi Amiri (Amiri), AmirReza PoorAkhavan (Arpa) for helping us, Weihao Zhu (Tommyr7) for testing the round and Nikolay Kalinin (KAN) for round coordination and Mike Mirzayanov (MikeMirzayanov) for awesome platforms Codeforces and Polygon.

You will have 2 hours and 5 problems each division.

Contest theme will be about Seven Deadly Sins but the statements will be short and brief.

The scoring distribution will be posted soon and good luck and stuff.

Update 1 : The scoring for both divisions is 500 — 1000 — 1500 — 2000 — 2500.

Update 2 : The round is over. Hope everybody had fun and enjoyed it. And as you can see the round is rated so yay!

Top 5 Div1 participants :

1.MiracleFaFa (The only one who solved all problems)

3.dotorya

4.SkyDec

5.ksun48

Top 5 Div2 participants:

1.shoob

3.SLLN

4.fdoer

5.dl1997

The editorial is posted.

• +642

 » 4 years ago, # |   +46 Do you mean the anime "Nanatsu no Taizai" or just the typical Seven Deadly Sins? I hope it's the anime one! :D
•  » » 4 years ago, # ^ |   +42 Sorry but it's the typical one :(
•  » » » 4 years ago, # ^ |   -30 Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?
•  » » 4 years ago, # ^ | ← Rev. 2 →   -10 kys Knightof13
•  » » » 4 years ago, # ^ |   -43 Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?v Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?v
•  » » » » 4 years ago, # ^ |   0 what is rated?
•  » » 4 years ago, # ^ |   -41 Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?
 » 4 years ago, # |   -12 Mahdi_Jfri If you didn't do anything so why did you write the announcement?
•  » » 4 years ago, # ^ |   +264 I wrote it so now I have done something!
•  » » » 4 years ago, # ^ |   +8 Oh, it seems Mahdi_Jfri have done a very important and great thing. I think so too. Due to CF Round #444, #445 was unrated, everyone is hoping that this contest will be rated. I hope so too. There’s a risk of getting 1000+ downvotes in this announcement if it is unrated, as far as see the last 2 contests. So I think less than half can have courage to write an announcement if they’re writer. So I think he is brave, and he make great contribution. But I hope this contest will be rated with 99.99999999...% = 100% probabilities.
•  » » » » 4 years ago, # ^ |   +70 why are you always whining about downvotes. please get over it.
•  » » » » » 4 years ago, # ^ |   -9 No. But I think that mentioning about upvotes/downvotes is important to support how much contributed it is about writing today’s contest announcement. Btw it seems there are many other way to support his contribution. (Writing announcement is originally a type of contribution.)
•  » » » » » » 4 years ago, # ^ |   0 Yeah we really don't care about that.
•  » » » 4 years ago, # ^ |   -29 Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?
•  » » » 4 years ago, # ^ |   -20 Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?
 » 4 years ago, # |   -132 Is it rated?
•  » » 4 years ago, # ^ |   -52 Spoiler
•  » » 4 years ago, # ^ |   +81 For now yes :)
•  » » 4 years ago, # ^ |   0 Have you installed an application that gives this question automatically for each contest announcement???
 » 4 years ago, # |   0 We hope it will be a contest that anyone will enjoy here! Please, Please check servers and problems 1 to 5 before contest starts in order that it will maintain as a contest we look forward! Good Luck to all!!! Thanks.
 » 4 years ago, # |   +74 Hmm..The "greed" problem will probably involve greedy technique as its solution.. or it might be a trap.. :|Just a prediction lol~
•  » » 4 years ago, # ^ |   +11 Haha :)
•  » » 4 years ago, # ^ |   +35 "Wrath" will actually not be a problem, it's just the feeling that you have when the servers go down mid-contest.
•  » » 4 years ago, # ^ |   -19 vIs it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?v
 » 4 years ago, # | ← Rev. 3 →   -8 I hope it won't look like this
 » 4 years ago, # | ← Rev. 2 →   +3 We hope that this round will not become unrated magically.UPD: Ok, ok... I hope...
 » 4 years ago, # | ← Rev. 3 →   +18 It will be enjoyable contest. Because it has a tag best round ever. . .
 » 4 years ago, # |   +8 Previous two round was unrated. Now what should be our expectation from this round????
•  » » 4 years ago, # ^ |   +16 "Best round ever"
•  » » 4 years ago, # ^ |   0 sa1378 is my bro xd he won't betray us
•  » » 4 years ago, # ^ | ← Rev. 2 →   -39 We have a binary random variable X with Bernoulli distribution.P(X = 0) = 1 - p — probability of an unrated roundP(X = 1) = p — probability that the round is ratedWhat is the probability that X = 1, given that we saw X = 0 two times in a row?
•  » » » 4 years ago, # ^ |   0 This sir is a glorious comment.You deserve my upvote.(Not that it matters because it has so many down votes any way)
 » 4 years ago, # |   0 Seven Deadly Sins, I was looking forward to more Arpa and Mehrdad adventures :(
 » 4 years ago, # |   -12 Is it unrated?
•  » » 4 years ago, # ^ |   -28 we make this unrated!
•  » » » 4 years ago, # ^ |   0 externalgoal, you are so suspicious. But please, don’t open your solution during the contest... You want downvotes... I know. But we’re wanting strongly, a rated contest. Please don’t open your solution during the contest... please...
•  » » » » 4 years ago, # ^ |   -13 Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?Is it rated?
•  » » 4 years ago, # ^ |   +26 Just wrote a piece of code to answer this ultimate problem. text = readFromURL("http://codeforces.com/top-contributed/friends/false/page/77") if text.find("NoMoreThanANoob") then print "Unrated" else print "Rated" 
 » 4 years ago, # |   -91
 » 4 years ago, # |   +2 Unrate or riot!
 » 4 years ago, # |   -24
 » 4 years ago, # |   +50 I will sabotage this CF and get a very bad rank for all you guys, because whenever I get a good rank, contest becomes UNRATED and when I get a bad rank, contest is RATED.Taking one for the Community.
•  » » 4 years ago, # ^ |   0 Mission Successful
 » 4 years ago, # |   +1 Is late registration there? I am returning to codeforces after a while — is it there in all contests now?
 » 4 years ago, # |   -8 hi I'm kinda a noob and was wondering what the difference between dev.1 and dev.2 is... would really apreciate it if someone answered... tnx
•  » » 4 years ago, # ^ |   0 Okay so div1(div stands for division) is for people with ratings in the range 1900-9999 and div2 is for us noobs below 1900 rating.Since you haven't played any CF rounds, you will be playing in div2 to get your rating first. Your default rating is 1500 I guess.
 » 4 years ago, # |   +3 Is the CF great now ? :D
•  » » 4 years ago, # ^ |   +5 After the situation of past CF contest it might be improved enough :)
 » 4 years ago, # |   +30 Good to see "the statements will be short and brief" Waiting for the statements!
 » 4 years ago, # |   -21 Arpa and Batman's contests are always amazing!!! i think this tradition return its value :).
•  » » 4 years ago, # ^ |   +2 ..... ... re ... .....
 » 4 years ago, # |   0 Please don't make it unrated again.
 » 4 years ago, # |   +3 I like the confidence in the problem-set of this contest
 » 4 years ago, # |   +23 Yaaaay a Persian contest! I hope I can wake up for this lol
 » 4 years ago, # |   0 And yes it is rated — minus at least 5 questions))
 » 4 years ago, # |   +121 Upvote me, please. When I look at my contribution, my mood falls down.
•  » » 4 years ago, # ^ |   0 Do not be beggar! Do not look for easy ways! Just comment wisely and you will faint , when you see your contribution.
•  » » » 4 years ago, # ^ |   +11 said the gray...))
•  » » » » 4 years ago, # ^ |   +13 I am not gray (now)...:):):)
•  » » 4 years ago, # ^ |   +48 Can't agree more, I wanted to say this but didn't dare to do it :( Negative contribution is like saying "Codeforces community will become better without you", and now I started to think if it's true.Can I have positive contribution like others too?
•  » » 4 years ago, # ^ |   0 Foolproof way to increase contribution:https://snag.gy/X3qRLQ.jpg
•  » » » 4 years ago, # ^ |   0 What do you mean?
•  » » » » 4 years ago, # ^ | ← Rev. 2 →   0 Round 444
 » 4 years ago, # |   -12 well , all people with good contribution don't wear capes , some just comment in that manner , and magic happens :) :)
 » 4 years ago, # |   0 Hope that there would be no issues like the last "rated" contest...
 » 4 years ago, # |   -6 This contest seems to be great, so I hope, that CF's servers will get through. May the force be with Mike :)
 » 4 years ago, # |   +135 Seven deadly sins: Gluttony Lust Wrath Envy Pride Greed Sloth
•  » » 4 years ago, # ^ |   +16 I really like the first one ^__^
•  » » 4 years ago, # ^ |   +3 Are this names from fullmetal alchemist?)
 » 4 years ago, # |   +10 It is delayed?
 » 4 years ago, # |   0 Good Luck to all I think this contest will be rated, Iranian guys)
 » 4 years ago, # | ← Rev. 3 →   -9 Deleted
•  » » 4 years ago, # ^ |   +2 Why only Iranian guys? Other guys also cool. People though are divided by the nation but to show discrimination on the public site is stupid.
 » 4 years ago, # |   +6 Yeah!!! I love this anime!
•  » » 4 years ago, # ^ | ← Rev. 2 →   +4 Take a look at first comment :(
•  » » » 4 years ago, # ^ |   +3 it would be better an anime
 » 4 years ago, # |   0 I hope this time it will be rated!
 » 4 years ago, # |   +1 Again rated, again...
•  » » 4 years ago, # ^ |   +6 Congratulations! So how did you handle it?
 » 4 years ago, # |   0 Contest theme will be about Seven Deadly Sins but the statements will be short and brief. :)
 » 4 years ago, # |   +37 Let's wish good luck codeforces servers)
 » 4 years ago, # | ← Rev. 2 →   0 Let us hope best for the servers so that our hardwork will not be ruined _ /\ _ :)
 » 4 years ago, # |   0 minh bi bede
 » 4 years ago, # |   0 Hope today is the day Codeforces Servers get out of gray
 » 4 years ago, # |   -8 CODEFORCES!!
•  » » 4 years ago, # ^ |   -8 :)
 » 4 years ago, # |   +123 Five Deadly Sins for Codeforces Sin 1Asking if it is rated. Sin 2Not writing "thanks to MikeMirzayanov" in round blogs. Sin 3Underestimating div2-A http://codeforces.com/contest/812/problem/A. Sin 4Envying tourist :) Sin 5Downvoting this comment :DDDDDDD
 » 4 years ago, # | ← Rev. 3 →   0 my three TOP only one things I have known in this world.1 the sun. 2 the earth. 3 the only way to change the color of our handles in codeforces. I hope everyone here to pass this way positively in this contest! Good luck to Everyone!!!
•  » » 4 years ago, # ^ |   +6 the only way to change the color of our handles in codeforcesWhen will Christmas come?
 » 4 years ago, # | ← Rev. 2 →   0
 » 4 years ago, # |   -45 Is it rated?
•  » » 4 years ago, # ^ |   0 here is the guy who tries to make his contribution -200 .
•  » » 4 years ago, # ^ |   0 No
 » 4 years ago, # |   0 is it unrated?
 » 4 years ago, # |   +3 Fix your damn servers..
 » 4 years ago, # |   +10 Why it is so slow...I submit a code 5 minutes ago…… and now I found I got a WA
 » 4 years ago, # | ← Rev. 8 →   -32 Seems like it will be a 3rd consecutive unrated round.
•  » » 4 years ago, # ^ |   +1 Yep, I have to wait 5-6 minutes for each submission.
 » 4 years ago, # |   +6 Thanks god for short problem descriptions
 » 4 years ago, # |   +4 problem Ds difficulty is inverse of Cs difficulty for the past 3 contests, i think. D is very difficult.
 » 4 years ago, # |   +14 It is really really disappointing that the server issue is still there :/ I mean, how can one enjoy a contest in the current situation where almost every submission takes 5-6 minutes to give verdict, even hacks. It's frustrating :(
 » 4 years ago, # |   0 It doesn't look like problem div2C has much to do with "Pride".
•  » » 4 years ago, # ^ |   +31 Have you notice the case when there is more than one 1 in the array? The idea is that the solver can be proud of themself when they come up the solution and forget to handle this.
•  » » » 4 years ago, # ^ |   0 I do hate problems where not all the corner cases are part of the pretests because it's stupid to lose a whole problem for a particular case. But, in this particular problem, if you proved your solution, you'd easily see this case (now, again, I believe it should be included in the pretests), so it's pretty unlikely for one who proved it to fail on that case. So I'm not taking "their" side, but I just think that you haven't actually solved a problem until you proved it. These corner cases, though, should not cost any more than just an extra submission (after seeing you failed on pretests)
 » 4 years ago, # |   +11 Problem Div2 B TLEd because of slow I/O (cin/cout in c++), and worked well with faster I/O (scanf, printf). Doesn't make it interesting.
•  » » 4 years ago, # ^ |   0 Got TLE for it and didn't know why. Used interval tree. O(nlogn)
•  » » 4 years ago, # ^ |   0 Same here. I don't see why the need for 10^6 max value for n (instead of the usual 10^5).
•  » » 4 years ago, # ^ |   0 Not really. That's well known issue with C++ streams Take a closer look here: http://en.cppreference.com/w/cpp/io/ios_base/sync_with_stdio
 » 4 years ago, # |   -14 Will this work for Div1B/Div2D ? Output the next element in sorted order for each number. like if array is [2,4,1,3] output [3,1,2,4]. Seems too easy(given the constraints N <= 22) but i cant find whats wrong with this.
•  » » 4 years ago, # ^ |   0 try 3 5 6 2
•  » » 4 years ago, # ^ |   +3 I was nowhere close to the solution but I think maybe n < 22 is for checking whether the condition is true for your logic
•  » » » 4 years ago, # ^ |   -20 Yes, it is.
•  » » 4 years ago, # ^ |   0 Wht's the role of a[i]?
•  » » 4 years ago, # ^ |   +3 Actually it works perfectly. If you choose one subset that does not contain the biggest element from the first array, then there is a map between elements in the first array to a bigger element in the second array (the one it becomes). Otherwise there is a map for a smaller element, so sum will never coincide.I thinks the n up to 22, was a misleading clue to confuse contestants. I tried to come up with a 2^n dp but completely failed.
 » 4 years ago, # |   +14 Very interesting D.
 » 4 years ago, # |   0 very good (trolling) name for problem Div1D. I really lazy to code all this cases...
•  » » 4 years ago, # ^ |   +10 Yes it was so hard for me too.
 » 4 years ago, # |   0 How to solve Div 2 D/ Div 1 B and div 2 E/ div 1 C?
•  » » 4 years ago, # ^ |   +13 Div1B If any repeated elements are present then no solution Else put b1 = a2 , b2 = a3 , b3 = a4 , ... bn = a1 (Assume a is sorted)
•  » » » 4 years ago, # ^ |   0 Isn't 5, 3, 4, 1, 2 a counter-example?
•  » » » » 4 years ago, # ^ |   0 yes, array should be sorted first and after that shift.
•  » » » » 4 years ago, # ^ |   0 Maybe i misunderstood smth, what will be the output for 5, 3, 4, 1, 2?
•  » » » » » 4 years ago, # ^ |   0 1 4 5 2 3
•  » » » » » » 4 years ago, # ^ |   0 I mean in his solution
•  » » » » » 4 years ago, # ^ |   0 Sorting the array a initially won't change the problem.
•  » » » 4 years ago, # ^ |   0 [3 1 1] has no solution??? I think [1 1 3] is solution for this input. Am I wrong??
•  » » » » 4 years ago, # ^ |   +5 array elements should be distinct so the test case isn't valid!
•  » » » 4 years ago, # ^ |   0 I understand your solution, but is there any formal proof why it always works???
•  » » » » 4 years ago, # ^ |   +42 after sorting a let c[i] = b[i] — a[i] then c[1] , c[2] , c[3] , ... , c[n-1] > 0 while c[n — 1] < 0 and sum of C's is 0 so obviously no proper subset will have sum of c as zero.
•  » » 4 years ago, # ^ |   +31 Div1C consider all edges with weights <= C , then any minimum spanning tree (forest) consisting of these edges will have the same set of connected components So have an offline solution where for each i from 1 to MAX , you first check if for all query edges with this weight if they can be added , if not then mask this query with "NO". Then forget these query edges and add actual tree edges with weight i. This works because of the reason mentioned at the beginning.
•  » » » 4 years ago, # ^ |   0 "any minimum spanning tree (forest) consisting of these edges will have the same set of connected components"Can you please elaborate on that a bit more? TIA!
 » 4 years ago, # |   0 Does solution to D use this?
•  » » 4 years ago, # ^ |   0 Of course.
•  » » » 4 years ago, # ^ |   0 My solution which I hope is correct (it passed the pretests and it really makes sense) doesn't involve that observation (even thought at some point I made it and hoped it'd help, I didn't find it of any use)
 » 4 years ago, # | ← Rev. 5 →   +23 Heck test for Div2C: 36 10 15
•  » » 4 years ago, # ^ | ← Rev. 3 →   0 What will be the answer for this case? My code prints 5 for the former test case you posted. For this test case, it prints 4.
•  » » » 4 years ago, # ^ |   0 4
•  » » » 4 years ago, # ^ |   0 4 (If my solution is correct :p )
•  » » » 4 years ago, # ^ |   +1 4[6, 10, 15], [6, 2, 15], [6, 2, 1], [6, 1, 1], [1, 1, 1]
•  » » » 4 years ago, # ^ |   0 If the gcd of all is not 1, it's guaranteed to be able to make some element to 1 within (N-1) trial.
 » 4 years ago, # |   0 How to solve D? I was thinking in terms of bitmask and reversal of highest bitcount numbers.
•  » » 4 years ago, # ^ |   +7 If the sequence is sorted, (I call it as a1 a2 a3 .. an), then the B seq is a2, a3,a4,a5..an,a1. Then just for every element in the A sequence, print the smallest element that is bigger than it.
•  » » » 4 years ago, # ^ |   +1 What if a isn't sorted?
•  » » » » 4 years ago, # ^ |   +18 Sort, solve, unsort back
•  » » » » » 4 years ago, # ^ |   0 got it!
 » 4 years ago, # |   0 yay! Finally Rated Round ! I need +1 rating gain for becoming specialist again , and finally I will be specialist once again. :)
 » 4 years ago, # | ← Rev. 2 →   +16 My attempt today in a nutshell. (Div2C/Div1A).Well, many thanks to the problem setter xD (No, really, this is the best pretest set I've ever seen — hacking comes in so many levels :) )
•  » » 4 years ago, # ^ |   +13 The tag does say "best round ever" anyway
•  » » » 4 years ago, # ^ |   0 Meow, precisely confident <(")
 » 4 years ago, # |   0 Then the feeling when the TL 2000 ms and the participant code runs 1996 ms(
 » 4 years ago, # |   +5 Will this work for Div1B/Div2D? Output the next element in sorted order for each number. Like if array is 2 4 1 3 print 3 1 2 4
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 That's my solution and it passed pretests.
•  » » 4 years ago, # ^ | ← Rev. 3 →   +37 Yes, and it's easy to prove. Let's consider for convenience the permuted arrays a and b: a1a1 If we take any subset that doesn't contain the last element, the sum on the lower side will definitely be bigger. So, we'd only have a problem with those that contain the last element. We need to balance a difference of aN — a1 with a subset of the values a[i + 1] — a[i] for 1 <= i < N. The nice part is that all those are positive and only if we choose them all will we be able to balance the differences (otherwise the total balance from the second part is still too small)
•  » » » 4 years ago, # ^ |   0 I understood the proof when subset doesn't contain the last element. I didn't get how you proved the sums will be different when the subset contains the last element. Can you explain it again in more detail ?
•  » » » » 4 years ago, # ^ | ← Rev. 2 →   +1 Let 1<=i1
•  » » » » » 4 years ago, # ^ |   0 Yeah , Got it. Beautifully explained. Thanks a lot :)
•  » » 4 years ago, # ^ |   +6 If you don't mind Sarvagya, Can I ask you something?You have not given any contest from quite sometime and after each contest ends, you ask "how to solve problem X?" Do you give contests with a fake ID? Because it seems so. If yes, why?Please don't ignore. Thanks.
•  » » » 4 years ago, # ^ |   +13 Why would I comment with this account if I am participating with a fake one?
•  » » » » 4 years ago, # ^ |   +13 Why would you comment "how to solve problem X?" just after any contest ends if you haven't participated or haven't seen the problems?And seeing problems without participating during contests make doesn't makes sense.
•  » » » » » 4 years ago, # ^ |   +8 Huh, I do this all the time — I just do not have enough time to do any Codeforces Round until recently so I just read the problems and ponder(?) about them in my free time. Also I want to improve my thinking speed for ACM (I rarely code — my code sucks) so it really helps. I also have friends who read problems and seek for solutions without participating to gather as many ideas as possible (lol idk how it works but oh well).Not trying to 'solve' the case or anything, just pointing out it is not that abnormal at least for me.
 » 4 years ago, # |   +7 How to solve div2 D/E ?
 » 4 years ago, # | ← Rev. 2 →   +20 How to solve div1.E ? I am not good at this kind of problems, but anyway, nice contest and nice problems.:)
•  » » 4 years ago, # ^ |   +13 I see it can be solved by generating function.
•  » » » 4 years ago, # ^ |   +10 Author's solution is completely different unfortunately we didn't predict that it can be solved by generating function :(
 » 4 years ago, # | ← Rev. 2 →   0 Can anybody explain me why my first div2 B submission got tle on test 9 having the complexity O(n) and using cin — cout, but after that i used scanf — printf and my second submission got accept. Why?
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 cin/cout is by default synced with scanf/printf, which caused the I/O process in C++ submissions to be pretty slow on large input if we don't switch of the sync. Personally, I'll insert ios_base::sync_with_stdio(false); on any source code files I create to switch off the default sync.
•  » » 4 years ago, # ^ |   +1 cin/cout is slow. If you want to use cin/cout, include these three lines at beginning of your main() function. ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ; 
•  » » 4 years ago, # ^ |   +1 Cin/Cout is slower than scanf/printf. Keep it a rule of the thumb when n >=1e6 the IO becomes the bottleneck. Use scanf/printf or instead http://codeforces.com/blog/entry/10297
•  » » 4 years ago, # ^ |   0 thanks for advices and explanations
 » 4 years ago, # |   +45 Thanks for nice problems! Is there any neat way of solving Div1D? I tried some long and ugly dp which took 1hr to code but don't even pass samples
•  » » 4 years ago, # ^ |   +1 My solution (it's different from author's) uses dp on tree and I can't say it's ugly. I will post a link to my submission after the system testing ends.
•  » » 4 years ago, # ^ |   +6 Here is my solution: 32407269.
»
4 years ago, # |
-25

I wrote this program for Div.2 B but still got Time limit reached in pretest 9: could someone please tell me whyyyyyyyyyy?

# include<bits/stdc++.h>

using namespace std; int main() { int n,s=0; cin>>n; int arr[n]; for(int i=0;i<n;i++) { cin>>arr[i]; } reverse(arr,arr+n); bool arr2[n]; for(int i=n-1;i>=0;i--) arr2[i]=true; int count=0; int last=0; for(int i=0;i<n;i++) { if(arr2[i]==true) count++; if(arr[i]!=0) { if(last<=i+arr[i]) { for(int j=last;j<=i+arr[i];j++) arr2[j]=false; last=i+arr[i]; } } } cout<<count<<endl;

return 0;


}

•  » » 4 years ago, # ^ |   +12 sorry for that....
•  » » 4 years ago, # ^ |   +11 cin/cout is slow. If you want to use cin/cout, include these three lines at beginning of your main() function. ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ; 
•  » » » 4 years ago, # ^ |   +1 tnx man :D
 » 4 years ago, # |   +18 Great thanks for the short statements, this just made my day :D i hope all setters do the sameAlso for the interesting tasks, enjoyed doing them...
 » 4 years ago, # |   -7 Why break the consistency, let's make this round unrated! :D
 » 4 years ago, # |   0 How to solve div2 C?
•  » » 4 years ago, # ^ | ← Rev. 4 →   0 Let's suppose array contains count number of 1's. If count ≠ 0, then every non-one element has to change into one. So, ans = n - count. If array doesn't contain any 1, then compute in the following way. You have to find the minimum length of subarray, whose gcd is 1, let's say, it is p. First you have to create one 1 using (p - 1) operations on that subarray. Then, change other non-one elements into 1 also using (n - 1) operations. So, ans = n + p - 2.
 » 4 years ago, # |   0 Can Anyone Explain How To Solve Problem B Div2.
•  » » 4 years ago, # ^ |   0 You need to answer whether the i'th person will die in O(1).He will die if there is some other person to the right j > i which can reach the i'th person.
 » 4 years ago, # |   0 Just take input 10^6 element using cin>> cause TLE in problem B. -_-
•  » » 4 years ago, # ^ |   +37 I think this is a good thing to teach people how to use their's language from time to time =)
 » 4 years ago, # |   +9 What's the motivation behind the constructive algo for Div2D/1B? Like, how did you arrive at the thought of trying exactly that algorithm?
 » 4 years ago, # | ← Rev. 5 →   +75 Is it normal to lock after getting hacked?!!!! KAN MikeMirzayanov
•  » » 4 years ago, # ^ |   +9 Race condition! :P KAN
•  » » 4 years ago, # ^ |   +46 At least you got revenge.
•  » » » 4 years ago, # ^ |   +1 fofao_funk Yeah, it tasted sweet! xD
 » 4 years ago, # |   -33 Problem Div 2-D is overestimated !! it should be categorized as B. Also the constraints is so tricky (22 numbers?!!), that tends my way of thinking towards something like backtracking and bit-masking. But it so easy just sort the numbers and replace each one with the next element after sorting.Whatever I didn't take care that the numbers will be distinct and I have known that after the contest.
•  » » 4 years ago, # ^ |   +65 Actually if n > 22 then we can't check if the participant answer is correct or not.
•  » » » 4 years ago, # ^ |   +10 Well, i believe they can be slightly (~40) more if you would write meet-in-the-middle knapsack in checker (however this only increases possibity of incorrect checker and doesn't really change anything).
•  » » » » 4 years ago, # ^ |   +8 That could have been another task ;) As it was with D,E here: https://arc079.contest.atcoder.jp/assignments
•  » » » 4 years ago, # ^ |   +26 Noob jafar
•  » » » » 4 years ago, # ^ |   0 wide author
•  » » » » 4 years ago, # ^ |   0 :(
•  » » » 4 years ago, # ^ |   0 Actually there is a way — you could specify a way to generate testing subsets and provide a number — for example first X subsets in lexicographic order. You could also provide some additional number of subsets given explicitly — to verify some random subsets on larger sequences.
 » 4 years ago, # |   0 I ctrl+F on my browser and write rated on this page . I found 25 times matching this word . This shows how much everyone is eager to see is this will be rated or unrated . :)
 » 4 years ago, # |   0 OMG what a bad luck my friend vaibhavkhulbe, pretest passed test 9 and judging time failed on test 9 :(
•  » » 4 years ago, # ^ |   0 Yeah I am yet to understand what happened... :'(
 » 4 years ago, # |   0 Long check :(
 » 4 years ago, # |   0 can someone plz tell me how to solve div 2 D and why that works
 » 4 years ago, # |   +7 hey , congrats to moejy , he is the second on codeforces now :D ,again,
 » 4 years ago, # |   0 Thanks a lot for this sweet contest! Really glad it went well, unlike 2 previous ones.
 » 4 years ago, # |   +5 Tests to div1 C might have been better. Accepted submission: http://codeforces.com/contest/891/submission/32408123Fails almost example test (replace vertices in first edge): 5 7 2 1 2 1 3 2 2 3 1 2 4 1 3 4 1 3 5 2 4 5 2 4 2 3 4 3 3 4 5 2 1 7 2 1 2 
•  » » 4 years ago, # ^ |   0 And here is my accepted solution.Which fails the following test: 4 4 1 4 1 1 2 2 2 3 2 3 4 2 1 3 2 3 4 
 » 4 years ago, # | ← Rev. 3 →   +4 Hi guys! Unfortunately, Codeforces API is down, that is the reason why CF-Predictor doesn't work.You could find last saved snapshot here: div1 div2.UPD Official rating has been updated, but API still down.
•  » » 4 years ago, # ^ |   +4 Both snapshots are of div1.
 » 4 years ago, # |   +5 Great problems with short statements, I really enjoyed it, thanks!
 » 4 years ago, # |   0 where is the new rating????
 » 4 years ago, # |   0 can someone plz tell me how to solve div 2 D and why that works
 » 4 years ago, # |   +28 My solutions were skipped because somehow someone copied my solution for Div1-A.http://codeforces.com/contest/891/submission/32389480http://codeforces.com/contest/892/submission/32400911I have no idea how this happened. And no, I didn't use Ideone. KAN, please fix this!
•  » » 4 years ago, # ^ |   +73 I see there is a flaw in codeforces to disqualify someone: when you lock a problem, it is possible to view roommate's code, then send it to other :)
•  » » » 4 years ago, # ^ | ← Rev. 2 →   +28 Damn, you're smart, brilliant observation :) I wouldn't come up with it by myself.Is there an easy (no matter if allowed by rules or not) way to get that code without retyping it? Anything easier than text recognition programs.I already thought that I got hacked since I didn't use Pastebin/Ideone either. And now it is like 50/50 :)P.S. I don't remember how it works — can one read codes by all contestants after locking (without being able to hack them), or only codes in his room? None of the coders in my room have problem C locked, so in case you can only read codes in your room — for me the reason should be different.
•  » » » » 4 years ago, # ^ |   +13 You can only read codes in your room.
•  » » » » 4 years ago, # ^ |   0 Is there an easy (no matter if allowed by rules or not) way to get that code without retyping it? Anything easier than text recognition programs. I think that Flash applet gets the code from the server in a text representation and then renders it in a non-copyable widget. Will try looking into this. can one read codes by all contestants after locking (without being able to hack them), or only codes in his room? IIRC you can read the code only in your room. At least with the current interface.
•  » » » 4 years ago, # ^ | ← Rev. 3 →   +40 Hmm, looks like you can also disqualify yourself if you are doing poorly in contest and don't want to lose rating: just submit your code again with fake account. Is this how it works? :)
•  » » » » 4 years ago, # ^ |   0 Cheating should result in account removal, to prevent this.
•  » » » » » 4 years ago, # ^ |   0 That might work only if you can be sure when someone has cheated. As you can see, 2 red coders that most likely haven't thought of cheating were caught by the system. Even if any of them used ideone (which they didn't), do you think that because of a mistake (not of a desire to cheat), they should have their accounts removed?
•  » » » » » 4 years ago, # ^ |   0 I've always thought that an interesting method to try to deter cheating would be to consider the cheater as earning a score of 0 (or maybe -INF) in the contest (and consider all of his/her submissions as incorrect). This way, cheaters would still lose rating, which I think may do a better job preventing cheating.
•  » » » 4 years ago, # ^ |   +3 but wouldn't they have to solve the problem to lock it?
•  » » 4 years ago, # ^ |   +35 My solutions were skipped too because somehow the SAME guy (Helli.code) copied my solution for Div1-C. LoppA/32401950, hellicode/32405243. (Link for his submission is broken right now).I don't use Ideone too, I coded and tested the program in my computer and only submitted to codeforces. I also have no idea how this happened.
•  » » 4 years ago, # ^ |   +20 Well, we will look into this and think what to do. Btw, these submissions are completely identical, so I doubt someone retyped it.
•  » » 4 years ago, # ^ |   +26 This time we will roll back ignores for first submissions in a group of identical. After it we will recalculate ratings. But from this moment we will notify if someone submissions look like your and in case of repeated notifications we reserve the right to apply penalties.
•  » » » 4 years ago, # ^ | ← Rev. 2 →   0 I feel that if someone did deliberately retype their submissions in order to sabotage them, those malicious guys would probably just do it to the same group of people again to damage their rating, especially upon reading this comment so Codeforces should probably be more careful of that.
•  » » » » 4 years ago, # ^ | ← Rev. 2 →   +11 Getting into the same room, then retyping without a single mistake, indentation etc.? Seems unlikely.For me it seems more likely that passwords were leaked or there is another flaw in this website.
•  » » 4 years ago, # ^ |   +5 I get the same trouble here
•  » » 4 years ago, # ^ |   0 the same trouble http://codeforces.com/blog/entry/55843?#comment-395662
 » 4 years ago, # | ← Rev. 2 →   +5 Something is not right. User I_love_Tanya_Romanova does not appear in standings, even though he participated in the round and hacked my A submission.Edit: Ok, looks like he was disqualified, but shouldn't all his hacks be removed too? They should be removed from final tests if they were added. KAN could you please comment on this?
•  » » 4 years ago, # ^ |   +11 Maybe all submissions in the round were opened for viewing? I can't believe red users cheated.
•  » » 4 years ago, # ^ | ← Rev. 2 →   +9 I got disqualified since my code for div1C matches with code for div2E by user best.code. I don't know exact way how it leaked yet :) Do you think the part about hacks is really that important? As I recall, out of my hacks three were like 3 6 10 15 And one was something like 8 15 6 6 6 6 6 2 1 I don't think they aren't covered by model tests and other hacks :)
•  » » » 4 years ago, # ^ |   +10 "I don't know exact way how it leaked yet :)"Perhaps you should ask EdwardSnowden.
•  » » » 4 years ago, # ^ |   +13 There's one way to do that: Pass pretests on one account in Div1 Lock the solution Look at other people's solutions Submit a random red's solution on your account in Div2 Or have a friend in Div1 to do steps 1-3 for you.
•  » » » » 4 years ago, # ^ |   +8 It was mentioned that no one else in his room locked C.
•  » » » » » 4 years ago, # ^ |   +78 In that case Codeforces should just start using HTTPS
•  » » » 4 years ago, # ^ |   +8 best.code copied my div1B I don't know exact way how it leaked yet too
 » 4 years ago, # |   -8 Thanks for the short statements:) But there were several mistakes in russian version
 » 4 years ago, # |   +3 Fullmetal Alchemist ^_^
 » 4 years ago, # |   0 10 minutes before the end until the contest, I pasded problem B by using priority_queue. T_T
•  » » 4 years ago, # ^ |   +4 I used segment tree in case of I can't pass problem B...because at that time I was sleepy and I couldn't come up with a good way to solve it(I even submit a wrong answer solution using dsu trick in segments...)Now I think everyone will take me as a fool because I write a segment tree in a div.2 B problem...
•  » » » 4 years ago, # ^ | ← Rev. 2 →   +1 In Round#419 Div2 ,I used Segment tree for B,too.I thought for 1 hour and submited for 5 times,pretest passed.Unluckily,I fst in the end(TLE)...
•  » » » » 4 years ago, # ^ |   +2 orz xljI think we should always come up with a suitable solution for one problem,instead of just writing data structures or some other things without deeper thinking.But sometimes these "force" methods can save us in some condition...
•  » » » » » 4 years ago, # ^ | ← Rev. 2 →   -6 .
•  » » » » » » 4 years ago, # ^ |   -9 I will sabotage this CF and get a very bad rank for all you guys, because whenever I get a good rank, contest becomes UNRATED and when I get a bad rank, contest is RATED.
•  » » » » » » » 4 years ago, # ^ |   -9 I will sabotage this CF and get a very bad rank for all you guys, because whenever I get a good rank, contest becomes UNRATED and when I get a bad rank, contest is RATED.
•  » » » » » » » » 4 years ago, # ^ |   -11 I will sabotage this CF and get a very bad rank for all you guys, because whenever I get a good rank, contest becomes UNRATED and when I get a bad rank, contest is RATED.
•  » » » » » » » » » 4 years ago, # ^ | ← Rev. 2 →   -8 Hey Don't always think like thisYou are not weak as you got good rank sometimes,but bad rank warns us more about our methods of thinking,coding and so on.It's just a coincidence that you got good rank but the contests are unrated.Instead of just complaining for the bad rank,you should believe in yourself and review the mistakes you made in some bad-ranked contests,then you will learn more and be easier to get good rank next time.UPD:OK maybe you all don't like to encourage others or he was just joking = =
•  » » » » 4 years ago, # ^ |   0 I will sabotage this CF and get a very bad rank for all you guys, because whenever I get a good rank, contest becomes UNRATED and when I get a bad rank, contest is RATED.
•  » » » » » 4 years ago, # ^ |   0 I will sabotage this CF and get a very bad rank for all you guys, because whenever I get a good rank, contest becomes UNRATED and when I get a bad rank, contest is RATED.
•  » » » » » » 4 years ago, # ^ |   0 why are you repeated that sentence for many times?
•  » » » 4 years ago, # ^ |   0 Orzzzzz
»
4 years ago, # |
-23

can someone please find why i am getting TLE in test case 9 in questuion 2. my code. and when i remove macro rfl it gets accepted! please explain.

# include<bits/stdc++.h>

using namespace std;

# define int long long

main() { int n,count=0; cin>>n; int arr[n]; fl(i,0,n) cin>>arr[i];int sum=0; if(n==1) { cout<<1; return 0; } rfl(i,1,n-1) { if(arr[i]>sum) sum=arr[i]; if(sum>0)count++; sum--;

        if(sum<0)
sum=0;
}
cout<<n-count;


}

 » 4 years ago, # | ← Rev. 2 →   +6 Sweet revenge by ovis96 xD
 » 4 years ago, # |   0 Can someone help me with Div2D/Div1B?Maybe I have misunderstood the problem, but judge says: "wrong answer there are 2 sets with equal sum".Input:1 3 4 5 2My solution:3 4 5 2 1
•  » » 4 years ago, # ^ |   +1 pick second and last element of each array, 3 + 2 = 4 + 1
•  » » » 4 years ago, # ^ |   0 Thanks! I was thinking that it should be some interval like [1, k].