### PrinceOfPersia's blog

By PrinceOfPersia, history, 4 years ago,

Hello Codeforces, and happy Nowruz.

It's an honor to announce you that Codeforces Round #406 is going to take place on March 23rd.

I'm the writer of this round and it is gonna be my 6th CF contest (there are still plenty coming...). There are 5 problems and you'll have 120 minutes to solve them.

I'd like to thank keyvankhademi and waterfalls for testing this round, netman and KAN for helping me prepare this round and MikeMirzayanov for awesome platforms of Codeforces and Polygon.

The main characters of this round are going to be Rick and Morty!!!

Scoring will be posted soon.

Problems are sorted by their expected difficulty, but I strictly recommend you to read all the problems.

GL & HF!

P.S: Top IOI 2017 participant in each division (only with handle present in the future IOI handle list) will be rewarded with special Persian souvenirs in Tehran.

UPD: Scoring distribution is: 500, 1000, 1750, 2000, 2500 for Div.2 and 750, 1000, 1500, 2000, 2500 for Div.1

UPD: Editorial is out!

UPD: System test is over, congratulations to the winners.

Div.1 winners are:

Div.2 winners are:

See you next time ;)

• +493

 » 4 years ago, # |   +86 amd is back! <3
•  » » 4 years ago, # ^ | ← Rev. 2 →   +79 AMD is an absolute champ in preparing nice interesting and original problems.
•  » » 4 years ago, # ^ |   -20 so is KAN <3
 » 4 years ago, # |   0 Something, I have heard of being a great experience but never experienced is happening. It's happening, happening. A contest worth it, as others say. :)
 » 4 years ago, # |   +20 Amd's contests are so good. I've never been disappointed with any of his contests. Looking forward to this Thursday.
 » 4 years ago, # |   +2 are you sure then IOI participants has in EACH division?
•  » » 4 years ago, # ^ |   +18 You would be surprised, but as far as I remember the split was 50 / 50 for those with a Codeforces account.
 » 4 years ago, # | ← Rev. 2 →   +5 "I strictly recommend you to read all the problems" does that related to the difficulty of the upcoming problems???
•  » » 4 years ago, # ^ |   +5 read this
•  » » 4 years ago, # ^ |   -15 From quite an experience , I believe , the statement wants to convey that C can might turn out to be easier than B :P
•  » » 4 years ago, # ^ |   +17 For example, you are very good at math and E is math problem which you can solve, but you are solving A-B-C and can't solve D, so you can think if I can't solve D, I won't solve E too and don't reading problem. So, it is good to read all the problems.
 » 4 years ago, # |   +54
•  » » 4 years ago, # ^ |   +8 Will be using this when code fails system tests :(
 » 4 years ago, # |   +19
 » 4 years ago, # |   +21 Happy Nowruz! I wish everyone that the round was truly festive!
 » 4 years ago, # |   +3 I missed PrinceOfPersia's rounds so much!
 » 4 years ago, # |   +12 (only with handle present in the future IOI handle list). Where's that list?
•  » » 4 years ago, # ^ |   +31 future
•  » » » 4 years ago, # ^ |   -11 test coments
 » 4 years ago, # | ← Rev. 2 →   -25 Problems are sorted by their expected difficulty, but I strictly recommend you to read all the problems.GL & HF!// What's the output of this code ? :) cout<<(GL=="Good Luck" && HF == "Have Fun" ? "Yes":"No"); 
•  » » 4 years ago, # ^ |   +6 Yes :"D 
•  » » 4 years ago, # ^ |   +13 compilation error: unexpected token Luck
 » 4 years ago, # |   0
•  » » 4 years ago, # ^ | ← Rev. 3 →   +3
 » 4 years ago, # |   +74 "Do ya hear that M-M-Morty? *URP* We're gonna go to a universe where everyone is a character in a programming competition, Morty--" "I-I, uh, I don't know Rick, that sounds like--" "A programming competion, Morty! Codeforces, Morty!"
 » 4 years ago, # |   +1 Hope morty doesn't go back to the old shop... :/
 » 4 years ago, # |   +48 Good Luck and Have Fun !! I hope this comment becomes the reference for all authors who are lazy to write it , and they write GL or HF . so they can copy paste it from here .
•  » » 4 years ago, # ^ |   -22 GL with that!
•  » » » 4 years ago, # ^ |   -21 HF
•  » » 4 years ago, # ^ |   +5 i hope there will be nice mromlems today gl hf friends
 » 4 years ago, # |   -10 First of all I apologise to write it here as I am very much new to this.I want to hack a problem which is already accepted.But I can see that the solution is wrong,what to do,Please Help.
•  » » 4 years ago, # ^ |   0 maybe ask @PrinceOfPercia
 » 4 years ago, # |   -11
 » 4 years ago, # | ← Rev. 2 →   -8 AMD setting the round + Main characters as Rick and Morty. This is going to be good.
•  » » 4 years ago, # ^ |   0 do not be so sure until you see the mromlems
 » 4 years ago, # |   0 A contest about me? thx :D
 » 4 years ago, # |   -18 wowwww im very much excited about the contest ... for giving this contest i will eatless :) hoping for +ve rating change and i love all the contest prepared by PrinceOfPersia ... and i love him too :) his style of blog writing is awesome and he is also awesome... i love codeforces ,,,,, i love MikeMirzayanov and i love alll :) happy coding best of luck for the contest :D
•  » » 4 years ago, # ^ |   -21 "and I love him too"
•  » » » 4 years ago, # ^ |   -8 but i love him more !!! so please stay away ... :)
•  » » » 4 years ago, # ^ |   +39
•  » » 4 years ago, # ^ |   +15 Gay Scene
 » 4 years ago, # |   +55 What made you change your mind?
 » 4 years ago, # |   +1 I just love codeforces contests
 » 4 years ago, # |   0 Best theme ever! This is one of the main reasons for why I love competitive programming...
 » 4 years ago, # |   +41
 » 4 years ago, # | ← Rev. 2 →   0 ..
 » 4 years ago, # |   +22 Why the hell your characters are soooooooooooooo intresting?! 1-Barney Stinson 2-Mike 3-Rick and Morty all of them are wonderful
•  » » 4 years ago, # ^ |   +8 Simple answer: because he is PrinceOfPersia.
•  » » 4 years ago, # ^ |   0 :|
 » 4 years ago, # |   -19 can someone tell me the full-form of amd please?
•  » » 4 years ago, # ^ |   +96 Advanced Micro Devices
•  » » » 4 years ago, # ^ |   -16 What??
•  » » » » 4 years ago, # ^ |   +50 PrinceOfPersia earlier used to be PrinceOfPersia (he changed his handle on this new year),PrinceOfPersia comes from his real name Amir Mohammad Dehghan
•  » » » » » 4 years ago, # ^ |   -22 Ok Thanks.
 » 4 years ago, # | ← Rev. 2 →   +1 Do i only see that i have last 2nd contest's amount of points instead of amout that should i have now? I mean i have 1021 when i had after last round 1087 and i see everybody have the same issueAlso my submissions from last contest got back themselves
 » 4 years ago, # |   +25 Glad to see my teacher is holding another round, good luck PrinceOfPersia (reply to this comment).
 » 4 years ago, # |   +8 Happy Nowruz everyone) Hope that most will increase their rank
 » 4 years ago, # |   -49 Everybody, who liked this commend will increase his rating))
•  » » 4 years ago, # ^ |   +133 *no one upvotes and thus your statement is true*
 » 4 years ago, # |   +14 Good thing CodeForces doesn't have verdict "Not Acceptable", else this round will be full of Error 406: Not Acceptable.
 » 4 years ago, # |   +43 It's my birthday contest !! thanks PrinceOfPersia :D
•  » » 4 years ago, # ^ |   +62 Happy birthday :-)
•  » » 4 years ago, # ^ |   -15 happy birthday
 » 4 years ago, # |   -16 Yeahhh !!! More contest for me to decrease my rating
 » 4 years ago, # |   +173 Guys, better prepare robust version of Heavy-Light Decomposition. Afair on 3 out of 5 PrinceOfPersia's contests E required it xD.
•  » » 4 years ago, # ^ |   +48 Thanks, I will Unregister!!!
•  » » » 4 years ago, # ^ |   +232 Yeah, possibility of Div1E being HLD is a perfectly valid reason for greens to unregister ;p.
•  » » » » 4 years ago, # ^ | ← Rev. 5 →   +35 I understand Sarcasm.ThanksIf E is HLD,then Accordingly all lower problems like D will be of PersistenSe segTree amd c will be of Sqrt decomposition and b will be of Dynamic programming with bitmasking and A will be of Maximal fLow and minimum cut in graph and Div2B will be from suffix trie and then DIV2a will be Unknown theorems on NUmber theory .So,I said I will Unregister
•  » » » » » 4 years ago, # ^ |   +144 If E is HLD,then Accordingly all lower problems like D will be of PersistenSe segTree amd c will be of Sqrt decomposition and b will be of Dynamic programming with bitmasking and A will be of Maximal fLow and minimum cut in graph and Div2B will be from suffix trie and then DIV2a will be Unknown theorems on NUmber theory . That's a pretty good and valid point.
•  » » » » » » 4 years ago, # ^ |   +16 Thank You,P_Nyagolov
•  » » » » » » 4 years ago, # ^ |   -24 Guys I have found a genius at sarcasm. Just take my like.
•  » » 4 years ago, # ^ |   +50 Funny fact: in Round #362 problem E was not a hardest problem, but it was indeed a HLD-problem. So, if a problem on HLD appears, it will apparently be the problem E, no matter how many problems in the contest there are.
•  » » » 4 years ago, # ^ |   +46 On last Petrozavodsk I used HLD once and it was also problem E (E2) :D. Apparently it was second easiest problem that day xD.
 » 4 years ago, # |   -176 you cock sucking son of a faggot gay piece of a homo sexual fucking mama joon (go see deadpool for more information) contest writer
 » 4 years ago, # |   -144 who likes inception?
•  » » 4 years ago, # ^ |   -6 Nice try to increase contribution. Haha
 » 4 years ago, # |   -36 hahaha :-DNice photo Prince :-D
 » 4 years ago, # |   -162 fact : PrinceOfPersia is a gay prince and he's trans.
•  » » 4 years ago, # ^ |   -24 So?
•  » » » 4 years ago, # ^ |   0 Amirp78 the only thing we all know here is sir PrinceOfPersia is a great coder and motivation of all of us . His problemsetting is awesome :) and his contest are always interesting , so focus on that fact !!! :)
•  » » » » 4 years ago, # ^ |   -59 cock sucker!!
 » 4 years ago, # |   -30 Wow...its great
 » 4 years ago, # |   -33 Hi, Prince)
 » 4 years ago, # |   0 mrims of persia always very nice mromlems, looking forward to the round 406, good luck
 » 4 years ago, # |   -28 Me when the competition starts (better watch out!)
•  » » 4 years ago, # ^ |   -10 Aww, you look so cute. Haha
•  » » » 4 years ago, # ^ |   0 vpsingh you are so cute awwww :) :P
 » 4 years ago, # |   +13 Scoring distribution?
 » 4 years ago, # |   0 I didn't know the theme was Eminem too
 » 4 years ago, # |   +6 Hacking page does not load.
 » 4 years ago, # |   +8 EM fan eh ?
 » 4 years ago, # |   +26 Did anybody notice the names of the problems...they are the names of eminem's songs too.Nice taste PrinceOfPersia.:)
 » 4 years ago, # |   +3 Very long queues.
 » 4 years ago, # |   +1 Is there a long hack queue? My hack has been in queue for almost 5 minutes now
 » 4 years ago, # |   +69 This is exactly how I read the problem statements to understand the whole meanings.
 » 4 years ago, # |   0 If suppose somebody program is write but would terminate before considering all the inputs would it be a valid program or not?
•  » » 4 years ago, # ^ |   0 Yes
•  » » 4 years ago, # ^ |   0 All that matters is that your output is correct, it is not necessary to take the entire input.
 » 4 years ago, # |   +2 It could be better if there were explanations for the examples in Div 2 problem C. It is possible to understand it ambiguously.
 » 4 years ago, # |   +3 Systests of A will make many people sad (me too) :'(
 » 4 years ago, # |   +34 Like almost everyone after the contest
 » 4 years ago, # |   +35 Div 2 B and C are so ambiguous. There should be more explanation rather than what we had.
•  » » 4 years ago, # ^ |   +8 Strongly agree with C.
 » 4 years ago, # |   -15 I do really like problem C xD good job PrinceOfPersia
 » 4 years ago, # |   +83 PrinceOfPersia right now.
 » 4 years ago, # |   0 How to solve C? My idea is to do dynamic programming with 3 state [position][cycle_passed][turn], with O(k) transition. This gives the right answer, however since cycle_passed could exceed 70, my solution got TLE. Am I on the right track here?
•  » » 4 years ago, # ^ |   0 It needs only position and turn(0 or 1), nothing else.
•  » » » 4 years ago, # ^ |   0 Wouldn't the graph be cyclic? and dp only works on DAG right?
•  » » » » 4 years ago, # ^ | ← Rev. 2 →   0 With DFS, you could do on graphs that are not DAG either.
•  » » 4 years ago, # ^ |   +5 I used a dp approach too, conf[player][pos] = 1 if player can win if he moves first from pos, 2 if he loses, 0 if it-s a loop. I made a dfs(player,pos) to find the answer for the current configuration but I'm not sure it will pass the main tests because of the complexity . It became a little complicated when taking care of the loops so I had to use some extra time to verify those.
 » 4 years ago, # |   0 What are the hack cases for problem 2 divB
•  » » 4 years ago, # ^ |   +3 I hacked two people with this: 5 1 10 4 4 4 4 4 4 4 4 4 4correct output is YES
•  » » 4 years ago, # ^ |   +1 I hacked codes with this case : 4 1 2 1 1
•  » » » 4 years ago, # ^ |   0 Answer should be YES
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 I hacked 3 with 2 1 2 -1 -1
 » 4 years ago, # |   +10 Applause Great problems! Thank you, man!
 » 4 years ago, # |   +5 on div2b, why no runtime error for negative values on this solution? Unsuccessful Hack case 10000 2 8 1 -1 -1000 -2000 -3000 -4000 -5000 -6000 8 1 -1 -1000 -2000 -3000 -4000 -5000 -7000 
•  » » 4 years ago, # ^ |   0 Could you show the whole code?
•  » » » 4 years ago, # ^ |   0 sure: submission it received WA on systest, but I was wondering why the hack didn't pass
•  » » » » 4 years ago, # ^ | ← Rev. 2 →   +4 If you add cout << ok << " " << v << endl; to the beginning of code: You get 0x554ae0 0x4f3040. That means that ok was placed after v (exactly v + 100008 = ok), so in fact ok[-1000] makes sense because it means v[100008 - 1000] (Don't have any idea why 100008 and not 100005, that's some compiler stuff).But generally you could get a Succesful hack by this test: 10000 2 3 1 -1 -10 1 10 He wouldn't clear ok[10] after first group, so he will say "NO" after checking 2nd group and finding that there are two elements with absolute value of 10. But right answer is of course "YES".Also this code doesn't check multiple occurrences of the same element. So 1 1 2 1 1 will also have "NO" answer, but the right answer is "YES".
•  » » » » » 4 years ago, # ^ |   0 I see, so it doesn't give RE only because that memory region is luckily located within the program scope. Well, at least it didn't pass the systest. Thanks for the clarification, it was very helpful!
 » 4 years ago, # |   +1 Whats the hack for div 2 A?
•  » » 4 years ago, # ^ |   0 Try this: 3 1 6 2
•  » » » 4 years ago, # ^ |   0 Whats the answer for it?
•  » » » » 4 years ago, # ^ |   0 -1 of course :)
•  » » 4 years ago, # ^ |   0 1 2 1 2
•  » » 4 years ago, # ^ |   0 10 5 10 7 OUTPUT : -1 . P.S.: I used it twice with affirmative .
•  » » 4 years ago, # ^ |   0 I found 2 hack cases:1 1 1 1 (because of not checking b == d)1 1 1 2
 » 4 years ago, # |   +5 10000 1 2 -3 -3So many fell to this single test in div 2 B :-P..
 » 4 years ago, # |   0 Was it possible to solve Div2.D on Python? I tried all my best, and solution is very simple, but Timeout on pretest 8...
 » 4 years ago, # |   +171 I couldn't really understand the statements. I read problem A like 5 times.
•  » » 4 years ago, # ^ |   0 i read it like 20 times til i understand it
•  » » » 4 years ago, # ^ |   +26 I guess he meant Div. 1 A .
•  » » 4 years ago, # ^ |   +1 I can't still figure out what I should do. Can somebody explain the statement to me? TT
•  » » » 4 years ago, # ^ |   +1 they are moving the same monster alternatively, I read it more than 10 time to figure that out :(
•  » » » 4 years ago, # ^ |   0 in simplified version, you and i takes turn alternately and choose some number from our setmy set = {4,3} your set = {2,5,3}let x be the initial position of the monster and i were about to move firstyour task is not to make the monster went to the blackhole, and my task is to do so. for example N = 5 and x = 2, and i choose to move 4 steps ahead which makes the x = 1 (circular) then i win, in other case i can move 3 steps which makes the x = 5 and you takes the turn to make sure i can't make the monster into the blackhole
•  » » » 4 years ago, # ^ |   +3 Well you have an infinite game, you have a position and turn. In your turn you take any of your numbers and change position into (position + chosen_number) % n. If you got into 0 -- you win.
 » 4 years ago, # | ← Rev. 3 →   0 I think problem E was just a persistent segment tree .Let A be the original array. Make a persistent segment tree B such that position j of the i'th version is 1 if there is no value equal to A[j] between A[i],A[i+1],....,A[j-1]. Once we have this we can do a greedy construction, because we can find the farthest possible endpoint for the next segment in time log(n).Is this the intended solution?
 » 4 years ago, # |   +11 B was easier than A
•  » » 4 years ago, # ^ |   0 B was not easier, A was tricky.
•  » » 4 years ago, # ^ |   -8 I don't think so seeing the number of WAs :P
•  » » » 4 years ago, # ^ |   0 I thought this before seeing the main tests. After seeing the main test... well things changed.
 » 4 years ago, # |   0 Just 10 more seconds ... (and a faster Internet)
 » 4 years ago, # |   0 Pretty nice contest (although I failed). B was really nice but I didn't like A. On C can I coded a solution (which I thought was and I still think so) the idea was that you change the answer at most when you change the K. Also the answers are decreasing so we can do a divide and conquer with at most times computing/doing the O(N) solution for fixed K. Can someone provide a test case which fails that, because it TLEd?Also how to solve D?
 » 4 years ago, # |   0 Is O(n * log23(n)) the intended complexity for C?
•  » » 4 years ago, # ^ |   0 Nope
•  » » » 4 years ago, # ^ |   0 Then can you give me some hint how to improve this? I used binary search + Persistent IT.
•  » » » » 4 years ago, # ^ | ← Rev. 2 →   0 Greedily do for K = 1 — 1000 in O(n). Now notice that for K > 1000, answer will be <= 100.Binary search on the range to get answers that lie b/w x for x from 100 to 1.For a single x it will take at max O(logn*100*logn*logn) This passes for me in < 1 sec
•  » » » » » 4 years ago, # ^ |   0 Yes I done on the similar way. First I found article where I read problem with amount of distinct numbers online in O(log n) per query and used existing code. Saw it is not enough to pass testcases, so I calculated first sqrt(N) values before binary search :)Other time at the round I spent in reading first problem :D
•  » » 4 years ago, # ^ |   0 my solution is n^2, although I don't know if it a solution quite yet.
•  » » 4 years ago, # ^ |   0 I got TL8 with O(n log^3 n)
 » 4 years ago, # |   +16 i think it was very hard round for DIV2 , am i right or not ?
•  » » 4 years ago, # ^ |   +1 True but there was a good hack opportunity in div 2 B to keep us occupied :-P
•  » » » 4 years ago, # ^ |   0 it was all about hacks if your room has people to hack you would get high score
•  » » 4 years ago, # ^ |   0 right
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 Hard .
 » 4 years ago, # |   0 I tried div1 C O(n * sqrt(n)) but it has TLE. Hahaha....
•  » » 4 years ago, # ^ |   0 try: const = 2500
 » 4 years ago, # |   +86 I hope 2*10^4 dfs in problem D will fail? In other case I don't understand why it's D. I decided to look at the submitted solutions and it made me sad.
•  » » 4 years ago, # ^ |   +117 6848 ms!!! Great! Awesome problem...
•  » » » 4 years ago, # ^ |   +155 Awesome problem!
•  » » » 4 years ago, # ^ |   +1 I'm sorry, our best naive solution worked in 14s. I can't find any counter-test for Retired_MiFaFaOvO's solution :-(
•  » » » » 4 years ago, # ^ |   +57 He just compressed dfs-es in one in order to jump less over the memory. Actually, that's the usual problem with solutions like O(n*log^10).
•  » » » 4 years ago, # ^ |   0 Yeah, more awesome because so far it is the only accepted solution.
 » 4 years ago, # |   -6 harder than usual but problems are so nice!
 » 4 years ago, # |   +5 We need Nicolas Cage from National Treasure to figure out the problems' statements :( . I read the statements many times to understand the problems :(
 » 4 years ago, # |   +109 The Russian statements look much like a result of some automatic translation: the order of words is as in English, and sometimes the meaning is messed up, too. Still possible to understand, but English version looks more readable to me. Looked way better when Codeforces had staff dedicated to translating the statements, like Delinur.
•  » » 4 years ago, # ^ |   -90 There should be no Russian at all. Authors should just focus on English. Quite often there was a reverse situation when native Russian speakers didn't care enough for good english statements.The whole codeforces.ru should be translated into english and removed.
•  » » » 4 years ago, # ^ |   0 https://github.com/Codeforcesfork and create your own CF with blackjack and what you want))
 » 4 years ago, # |   +5 The problems are too hard to understand.Could you make the problems become shorter,it is unfair to poor English men...like me
 » 4 years ago, # |   0 can't figure out why my solution 25749847 for B is failing. could anyone please have a look.
•  » » 4 years ago, # ^ |   +6 you are using break without reading the whole line..
•  » » » 4 years ago, # ^ |   0 pain, pain and more pain. thanks btw.
 » 4 years ago, # |   +36 Are all round prepared by PrinceOfPersia have a hard Div 1 A? Or am I too weak?
•  » » 4 years ago, # ^ |   0 His last contest has pretty easy Div1-A. All other problem though...
 » 4 years ago, # |   +2 Test Case 24?
•  » » 4 years ago, # ^ |   +1 This question is so weird.
•  » » 4 years ago, # ^ |   0 Try this test case : 1000 1 2 -4 -4
•  » » » 4 years ago, # ^ |   0 Thanks
•  » » » 4 years ago, # ^ | ← Rev. 2 →   0 Wait, what? It is said that noone can join the group more than once.Oh god. I got it. I should have read the text better.
•  » » » » 4 years ago, # ^ | ← Rev. 2 →   0 no it isn'tRicks and Mortys have registered online in these groups. So, a person can have joined a group more than once (developer of this website hadn't considered this possibility).
•  » » » » » 4 years ago, # ^ |   0 Thanks. I've read "can't"
 » 4 years ago, # |   +8 Fastest System Test ever :'D
•  » » 4 years ago, # ^ |   +47 there was nothing to be tested :V
 » 4 years ago, # |   0 Statement of C and D are too hard for me to understand -_-
 » 4 years ago, # | ← Rev. 2 →   0 WHat is the proof Of DIV2 A ? I cant guess the impossible (-1) case . When it will be impossible ? And whats the proof ?
•  » » 4 years ago, # ^ | ← Rev. 8 →   0 What I did was to construct a set of all the remainders i.e. if (b > d) (b-d+n* a)%c and if this doesn't come to zero first but repeats then it runs till infinity therefore -1. Similarly if b <= d.
•  » » 4 years ago, # ^ |   0 if both guys from same planet are in the same group then that group is not the required group as both from the same planet can't be traitor at the same time
•  » » » 4 years ago, # ^ |   0 Sorry I mistakenly read DIV2 B .
•  » » 4 years ago, # ^ |   0 For example:a = 2, b = 1, c = 4, d = 4.We are adding even number to odd number, so it will be odd number, but c and d are even, their sum will be even to.
•  » » 4 years ago, # ^ |   +1 b + n * a = d + m * ctherfore :- a * n + (-c) * m = (d — b)this can be solved using extended gcd. if (d — b) % gcd(a, c) != 0 then answer is -1.
•  » » » 4 years ago, # ^ | ← Rev. 2 →   0 Ok....Thanks. +1
 » 4 years ago, # | ← Rev. 2 →   0 I tried Bezout's Identity for Div2A . But it failed....can anyone correct me.Also, I can't think of when would it be -1.
•  » » 4 years ago, # ^ |   0
•  » » » 4 years ago, # ^ |   0 +1.
 » 4 years ago, # | ← Rev. 2 →   0 That moment when you get div. 2 problem A wrong in system test
•  » » 4 years ago, # ^ |   +3 you are not alone
•  » » » 4 years ago, # ^ |   0 I felt so silly lol Gotta be more careful next time :)
 » 4 years ago, # |   +59 pretty balanced
 » 4 years ago, # |   +84 It isn't a good idea to make Div1 A so difficult.795 users registered for this Div1 round but only 343 made at least one submission.
•  » » 4 years ago, # ^ |   +23 Please say this to topcoder admins too! :P
 » 4 years ago, # | ← Rev. 2 →   0 This time lots of Hacks & System failures! :p
 » 4 years ago, # | ← Rev. 2 →   +1 Please Can someone tell why i got WA in Prob B ?http://codeforces.com/contest/787/submission/25753050///I got accepted.same number can come...
•  » » 4 years ago, # ^ |   +4 Try this4 1 2 1 1Output should be YES
•  » » » 4 years ago, # ^ |   0 DIV2 B- not afraid . I solved this problem , One submission with break getting WA on test 10 but test case is too long so cant guess the bug — > WA on test 10 , Submission With break statement . Another same submission got AC where i just cut the break statement -> GOT AC submission without break statement . Can not find any short test case which will give the WA for first code .Here is the diifference : Difference
•  » » 4 years ago, # ^ |   +3 Try this test case: 1 1 2 1 1. The answer is YES.
•  » » » 4 years ago, # ^ |   0 Thank you all guys !! :)
 » 4 years ago, # |   +4 So easy div2 B problem, but so difficult-to-understand problem statement.
 » 4 years ago, # |   +7 Puzzle: Name of all problems are names of Eminem songs, except for Div.1 E. Eminem has no song named ALT, so what is the story behind ALT!?
•  » » 4 years ago, # ^ |   0 Because Encore (mentioned in the statement) is an Album not a Song?
•  » » » 4 years ago, # ^ |   0 Okay, Encore is an album, what is ALT?
•  » » » » 4 years ago, # ^ | ← Rev. 2 →   -8 ALT.music.eminem
•  » » » » 4 years ago, # ^ |   0 Alternate? idk :P
•  » » » » 4 years ago, # ^ |   -9
•  » » 4 years ago, # ^ |   +65 I know the answer) And this is "Ass like that" :D
•  » » » 4 years ago, # ^ |   +38 Exactly ;)
 » 4 years ago, # |   0 Could you guys help me with why I got Div2B wrong?http://codeforces.com/contest/787/submission/25748568I think I misunderstood something.
•  » » 4 years ago, # ^ |   +3 you should clear s after push_back
•  » » » 4 years ago, # ^ |   0 DIV2 B- not afraid . I solved this problem , One submission with break getting WA on test 10 but test case is too long so cant guess the bug — > WA on test 10 , Submission With break statement . Another same submission got AC where i just cut the break statement -> GOT AC submission without break statement . Can not find any short test case which will give the WA for first code .Here is the diifference : Difference
•  » » » » 4 years ago, # ^ |   0 Can you check this test? 10 2 3 5 -5 -5 1 3
•  » » » » » 4 years ago, # ^ |   0 Awesome , I understand what is the problem . Many many thanks . The problem was that when i break middle of the input , the next input data scanned by k , so this cause mulfunction to the program . Awesome hack case . Thanks .
 » 4 years ago, # |   +6 b should be 1500 and c 1000
 » 4 years ago, # | ← Rev. 2 →   -64 PrinceOfPersia EVEN A BLUE CODER OR CYAN CODER CAN MAKE CONTEST WITH UNIFORMITY IN PROBLEMS LEVELS THAN THIS CONTEST.FOR EXAMPLE,TAKE SOME PREVIOUS CONTESTS
•  » » 4 years ago, # ^ |   -8 Gaand fat gai kya? :D
 » 4 years ago, # |   0 Beautiful arts) I was enjoying this contest)
 » 4 years ago, # |   +13 My code of div2B WA vs AC after contestMy Code failed on #59. Can someone explain me how this passed 58 test cases ! !!My best experience in CF.... I will remember it :'(
 » 4 years ago, # |   -10 Is it rated?
•  » » 4 years ago, # ^ |   0 Ofcourse!
 » 4 years ago, # | ← Rev. 3 →   0 please i want to know something: i made this submission during the contest: http://codeforces.com/contest/787/submission/25739022 and then i made another submission in the same problem because there was something i was not sure of, the other submission was hacked, and the first submission above was counted hacked also as you see in the submission linkafter the contest i submitted the above submission again exactly and it is accepeted: http://codeforces.com/contest/787/submission/25754392is this normal ?
•  » » 4 years ago, # ^ |   0 I'd guess a yes It is probably because only the last one that passed all the pretests count for the contest, so your correct submission during the contests technically did not count
 » 4 years ago, # |   0
 » 4 years ago, # |   +15 A positive rating change means absolutely nothing when u know u have not done well at all in the contest. :(
 » 4 years ago, # |   -23 Hello, I think I found a mistake in system tests in task B. Time limit is 2s and I've found the test in which solution has been executing for 2.8s but system test said that it is valid.10000 110000 1 1 1 1 1 1 1 1... 1
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 Can anyone answer why compiler skips it? It is clearly seen that the complexity is the n^2
•  » » 4 years ago, # ^ |   0 2.8s on your machine maybe, probably without -O2Custom Invocation 46ms
 » 4 years ago, # | ← Rev. 3 →   +2 I was able to lock my solution after being hacked. HOW?
 » 4 years ago, # |   +3 wasn't the character next to Rick in div1 D (Rap God) Pearl from Steven Universe?
 » 4 years ago, # |   0 Can someone help me with the part B? In my system for the second test, I am getting "NO" but the codeforce system test says it prints "YES". Here is my code: 25752586
 » 4 years ago, # | ← Rev. 3 →   -15 Gl hf
 » 4 years ago, # |   -11 ez rated
 » 4 years ago, # |   -13 lame af
 » 4 years ago, # |   0 Hi guys! In the A problem, why the values of i,j should be lower then N ? There is any relation of this with diophantine equations properties?
 » 3 years ago, # |   0 I've got a mysterious submission issue;Here's my code:http://codeforces.com/contest/786/submission/29148189It meets a RTE with a exit code which usually means array/vector visit out of range.But my vs2017 report nothing and runs well, and I had never disable runtime warnings.So I submited it in MS C++.The first time it runs and I've got a minor mistake.before correctionafter I corrected it with only one line, it cannot even compile.after correctionAnd the bs reason Can't compile file: program.cpp program.cpp(58) : error C2143: syntax error : missing ',' before ':' program.cpp(58) : error C2530: 'i' : references must be initialized program.cpp(58) : error C3531: 'i': a symbol whose type contains 'auto' must have an initializer program.cpp(59) : error C2143: syntax error : missing ';' before '{' program.cpp(61) : error C2228: left of '.first' must have class/struct/union type is 'int' program.cpp(61) : error C2228: left of '.second' must have class/struct/union type is 'int' program.cpp(62) : error C2228: left of '.first' must have class/struct/union type is 'int' program.cpp(62) : error C2228: left of '.second' must have class/struct/union type is 'int' program.cpp(113) : error C2143: syntax error : missing ',' before ':' program.cpp(113) : error C2530: 'i' : references must be initialized program.cpp(113) : error C3531: 'i': a symbol whose type contains 'auto' must have an initializer program.cpp(114) : error C2143: syntax error : missing ';' before '{' program.cpp(115) : error C2228: left of '.first' must have class/struct/union type is 'int' program.cpp(115) : error C2228: left of '.second' must have class/struct/union type is 'int' program.cpp(194) : error C2143: syntax error : missing ',' before ':' program.cpp(194) : error C3531: 'j': a symbol whose type contains 'auto' must have an initializer program.cpp(195) : error C2143: syntax error : missing ';' before '{' program.cpp(196) : error C2143: syntax error : missing ',' before ':' program.cpp(196) : error C3531: 'k': a symbol whose type contains 'auto' must have an initializer program.cpp(197) : error C2143: syntax error : missing ';' before '{' I got really frustrated. Can someone help? What's going on?