### STommydx's blog

By STommydx, history, 4 months ago, ,

Hello Codeforces!

I'm proud to announce that Codeforces Round #457 (Div. 2) will be held on 19 Jan, 14:35 UTC. The problemset is authored by jamiechoi, longhuenchan and me (STommydx). It is our first round in Codeforces and hope you all find the problems interesting.

We would like to thank the following people as the round would not be possible without their kind help: gritukan for coordinating the round, Arpa for testing the problems and MikeMirzayanov for the great Polygon and Codeforces platform.

The contest will consist of 5 problems and you'll be given 2 hours to solve them. The scoring distribution will be announced close to the start of the round as tradition.

Let me close this blog post by answering the most frequently asked question in Codeforces. This round is rated for all Div. 2 participants. As usual, Div. 1 participants can join out of competition.

Good luck and high ratings!

UPD:

Scoring distribution: 500-1000-1500-2250-2500

UPD2:

We are extremely sorry for the situation for problem B. We are figuring out a correct solution for problem B. I hope you all enjoy the rest of the problems.

UPD3:

The round is over. Congratulates to the winners!

Div2:

Div1+2:

The editorial will be available tomorrow.

UPD4:

•
• -251
•

 » 4 months ago, # |   +7 Is it the first cf round whose problems are prepared by Hongkongers??
•  » » 4 months ago, # ^ |   +40 The first "Div 2 Only" contest by Hongkongers maybe... (http://codeforces.com/blog/entry/7390)
•  » » » 4 months ago, # ^ |   +40 Cries in a corner with a div2 problem set.
 » 4 months ago, # | ← Rev. 2 →   -11 Why it doesn't appear in the main page? UBD : its Now :D
 » 4 months ago, # |   +26 Finally the wait is over.
 » 4 months ago, # |   +14 Good luck, high rating
 » 4 months ago, # |   -17 I wish a high rating for all.
 » 4 months ago, # |   +8 enough time limit for problems
 » 4 months ago, # |   +129 "Good luck and high ratings!" Usually after these words there is always something very bad happening.
•  » » 4 months ago, # ^ |   +40 You're correct as this round is unrated.
•  » » 4 months ago, # ^ |   +46 You are the true "CF-predictor".
•  » » 4 months ago, # ^ | ← Rev. 2 →   0 and it happend :Dnow the round is unrated
 » 4 months ago, # |   -17 add oil
 » 4 months ago, # | ← Rev. 2 →   +19 Good luck!
 » 4 months ago, # |   -62 top 1 || gabella english sosat I'm a big boss of cf glhf retards upvotes if true Is it rated? MiNus * MiNus = Plus xddddddddd
 » 4 months ago, # |   -73 thi cho vui chứ tạch VOI rồi :(
•  » » 4 months ago, # ^ |   +35 Next time, please use English or Russian in public Codeforces blog posts.Anyway, there will always be a second chance. Keep fighting, as long as your heart is still on for competitive programming. ;)(P/s: For those who don't speak Vietnamese, he said he'd play for fun, as he thought he'd fail the Vietnamese Olympiad in Informatics, which occured recently.)
•  » » 4 months ago, # ^ | ← Rev. 3 →   +14 VOI is not the end, ACM is waiting for you..... And strong teamates
•  » » » 4 months ago, # ^ |   -9 i'm very sad
•  » » » 4 months ago, # ^ |   0 And a bright future...
•  » » » 4 months ago, # ^ |   0 ... And strong rivals
 » 4 months ago, # |   +3 They mentioned unusual start time in the mail....What's the usual start time?
 » 4 months ago, # | ← Rev. 3 →   +269 The problem B's standard solution has a error.Input:1 7Output should be -2 -2 -2 -3 -4 -5 -5 instead of -2 -3 -3 -3 -3 -3 -3.http://codeforces.com/contest/916/hacks/399042
•  » » 4 months ago, # ^ |   +6 It is the same with 19 5 The answer shoulf be 3 3 1 -1 -1 and it is 3 2 2 1 0
•  » » 4 months ago, # ^ |   +38 That might be why I always Wrong Answer on pretest 5 For the standard is wrong.
•  » » 4 months ago, # ^ |   +20 Wow, this is a SERIOUS problem. The round should be unrated.
•  » » » 4 months ago, # ^ |   +2 and its unrated
•  » » 4 months ago, # ^ | ← Rev. 2 →   +3 Wow, I'm right. I've got stuck in B for 30 mins.
•  » » 4 months ago, # ^ |   0 Would you please explain the idea behind this?
•  » » » 4 months ago, # ^ |   0 I got the wrong solution but got passed using priority_queue, just like the standard solution
•  » » » 4 months ago, # ^ | ← Rev. 2 →   +3 because -2 -2 -2 -3 -4 -5 -5 is lexicographically greater than -2 -3 -3 -3 -3 -3 -3, and there is no way you can get an answer with the largest number smaller than -2.
•  » » » » 4 months ago, # ^ |   0 Why -1 -2 -3 -4 -5 -6 -6 is wrong?-1 -2 -3 -4 -5 -6 -6 > -2 -2 -2 -3 -4 -5 -5
•  » » » » » 4 months ago, # ^ |   0 y, which is max(Ai) must be minimized. In your case, y=-1, while in second case y=-2. Your y is not the minimum.
•  » » » » » » 4 months ago, # ^ |   0 I think B is only a greedy problem, try to change the number to binary system, and for a pow(2,m) can split to 2 pow(2,m-1) until the limit reachedAm I right? Can I show my code here?
•  » » 4 months ago, # ^ |   +3 Why it should be -2 -2 -2 -3 -4 -5 -5 ?
•  » » » 4 months ago, # ^ |   +3 Is it because those are negative numbers?
•  » » » 4 months ago, # ^ | ← Rev. 3 →   0 It should be -1 -2 -3 -4 -5 -6 -6 I think.edit: no, need to minimize the max value as wellbasically a modification of the original idea should work: keep breaking into two till remaining length is greater than current count, i.e. it will lead to a minimum max value. Then, keep breaking the smaller end.
•  » » » » 4 months ago, # ^ |   0 max(-1 -2 -3 -4 -5 -6 -6)=-1max(-2 -2 -2 -3 -4 -5 -5)=-2-1 > -2
•  » » 4 months ago, # ^ |   0 agree!stuck on pretest 5, and i think my code is right.
•  » » » 4 months ago, # ^ |   0 Exactly, I don't know what Pretest 5 is, but it seems to be very big because I received a RTE when I make my array size very small
•  » » 4 months ago, # ^ |   0 The link doesn't work. How did you figure out what the juri's answer is?
•  » » » 4 months ago, # ^ |   0 The hacks link is invalid until the final standings are published.
•  » » 4 months ago, # ^ |   -9 should output be -6 -6 -5 -4 -3 -2 -1 of 1 7
•  » » » 4 months ago, # ^ |   0 no. -2 -2 -2 -3 -4 -5 -5 is correct.since -2 < -1 (the max value shoudl be minimized)
•  » » » » 4 months ago, # ^ |   0 with 1 7, I had the output: -2 -3 -3 -3 -3 -3 -3Actually I don't know what is the right answer
 » 4 months ago, # |   +9 I presume you have overestimated the power of Div 2. A bit.
•  » » 4 months ago, # ^ |   0 Yes , both B and C are quiet difficult .
•  » » » 4 months ago, # ^ |   +16 C is quiet easy
•  » » » » 4 months ago, # ^ |   +1 Is the answer of C fixed?
•  » » » » » 4 months ago, # ^ |   0 no, can be multiple, output any.
•  » » » » » » 4 months ago, # ^ |   0 can you please explain the solution? I am getting WA.
•  » » » » » » 4 months ago, # ^ |   0 Wa!! Thanks ,it's really easy!
•  » » » » » » » 4 months ago, # ^ |   0
•  » » » » » » » » 4 months ago, # ^ |   0 your solution looks correct to me, except your isrPrime function gives 1 as a prime number.
•  » » » » » » » » » 4 months ago, # ^ |   0 yeah, It will give wrong answer on n=2. Thanks for the help.
 » 4 months ago, # |   +49 Obligatory rage comment about round being unrated.
 » 4 months ago, # |   +12 How did people manage to get pretests passed on problem B? :D
•  » » 4 months ago, # ^ |   +4 a priority queue solution passed.
•  » » » 4 months ago, # ^ |   0 I was getting memory limit exceeded with priority_queue.
•  » » » » 4 months ago, # ^ |   +1 Check for some runtime error in your solution. Sometimes undefined behavior causes element to be added indefinitely and hence the memory error. (Its just one of the causes, perhaps the real bug may be different )
•  » » » » » 4 months ago, # ^ |   0
•  » » » » » » 4 months ago, # ^ |   0 You are not at all dealing with cases where no answer is possible. Check out the case "13 2" in sample input of the problem.
•  » » » » » » » 4 months ago, # ^ |   0 Sorry...I edited that...https://ideone.com/1HOrNz
•  » » » » » » » » 4 months ago, # ^ |   0 What is the problem? I see you passed systest. Can you please elaborate on whats the problem/issue?
•  » » » » » » » » » 4 months ago, # ^ |   0 The Problem is when there are negative values.....Input:1 7 Output should be -2 -2 -2 -3 -4 -5 -5 instead of -2 -3 -3 -3 -3 -3 -3...as -3 < -2....
•  » » » » » » » » » 4 months ago, # ^ |   0 Thats because you are always picking up the max element, popping it and putting in element-1 2 times.How your queue works is as-1 i -(input)0-->-1,-1>>-1,-2,-2-->-2,-2,-2,-2>>> (similarly the 3 of the "-2" turn into "-3,-3" and we reach limit of 7,after which the for loop exits).What you may try to do is, after the final size is obtained, for any 2 same elements, which are not the max elements, do this- Remove those 2 elements, add 1 element+1. Remove the last element. Add 2 "Last element-1" again. So, what it will do is, for "-2,-3,-3,-3,-3,-3,-3", the steps will be like--2,-3,-3,-3,-3,-3,-3==>-2,-2,-3,-3,-3,-4,-4==>-2,-2,-2,-3,-4,-5,-5.I think this should be correct (any improvements are appreciated :) )
•  » » » » » » » » » 4 months ago, # ^ | ← Rev. 3 →   0 @vijju123 you cant always do (1). it might increase your max value. -2 -2 combining to give -1 as the first element.
•  » » » » » » » » » 4 months ago, # ^ | ← Rev. 2 →   0 What you may try to do is, after the final size is obtained, for any 2 same elements, which are not the max elementsI took care of that condition there.
•  » » » » » » » » » 4 months ago, # ^ |   0 @vijju123 should work
•  » » 4 months ago, # ^ |   +1 If you write it to do lexicographic ally smallest instead of largest, you will pass pretests.
•  » » » 4 months ago, # ^ |   +1 I did it by priority queue, wrote the output with largest lexi and still pass
•  » » » 4 months ago, # ^ |   0 absolutely true. I didnt even realize it until u said it
 » 4 months ago, # |   -8 Un...f***ing rated?
 » 4 months ago, # | ← Rev. 3 →   -17 Shit, if pretests of B are correct(?) why do you make round unrated?My solution is passed and I think my solution is correct. Probably there is problem in checker that gave wrong answer on correct solutions which printed something different...I found mistake in my solution xD
•  » » 4 months ago, # ^ |   0 I think the main solution in the problem package were wrong, therefore maybe not all of the pretests have correct answers.
•  » » 4 months ago, # ^ |   +3 I suppose they were not + even if, there are hacks
•  » » 4 months ago, # ^ |   +5 Pretest 5 is wrong
•  » » » 4 months ago, # ^ |   0 Can you explain?
•  » » 4 months ago, # ^ |   0 Their solutions probably aren't, so that would affect anyone who wrote a right answer.
•  » » 4 months ago, # ^ |   0 pretests aren't correct. yours passed because both are same wrong answer.
 » 4 months ago, # |   +3 I felt that B was a really bad problem...
 » 4 months ago, # |   +70 RIP writer contribution score
•  » » 4 months ago, # ^ |   0 Currently it is : -57whereas it was +1 earlier (google cache), certainly it did fall to rock bottom.
 » 4 months ago, # |   +14 Most unfortunate because of a serious issue. Anyway, still thanks for the contest, other problems were good! ;)
 » 4 months ago, # | ← Rev. 2 →   +1 Round unrated but Interesting Problems. Making it unrated in last half hour of the contest is little disappointment.
 » 4 months ago, # |   0 is it rated? overrated
 » 4 months ago, # |   -15 Fucking shit..How the fuck some people solved B?I went mad solving that problem.
•  » » 4 months ago, # ^ |   +8 I think that problem C is easier than B. And both are really cool!
•  » » » 4 months ago, # ^ | ← Rev. 2 →   0 Oh no..It doesnt matter. I wasted my whole contest just to get B accepted. I was not able to think of a logic to sort number lexicographically which does not exceed time limits.
•  » » » 4 months ago, # ^ |   0 are really shit*
•  » » 4 months ago, # ^ | ← Rev. 2 →   -8 Their mind works like the red coder who coordinated this round.
•  » » » 4 months ago, # ^ |   -7 LOL
•  » » 4 months ago, # ^ |   -8 emm... I can understand how upset you were after the round declared unrated, but don't you think we should keep a good environment for Codeforces, therefore, no f***ing... And sorry for my poor English...
 » 4 months ago, # |   -17 I hate you :(
 » 4 months ago, # |   0 uhhhhhhhhhhhaaaaaa, I have done 7 successfull hacks and this round will be unrated:)
•  » » 4 months ago, # ^ |   +10 uhhaaaaa, i'm on the 4 place and this round will be unrated...
•  » » » 4 months ago, # ^ |   +8 I would back Div.1
•  » » » 4 months ago, # ^ |   0 I think it can be rated for people who got increasing rating.
•  » » » » 4 months ago, # ^ |   0 It would be unfair. Your rating increased even though your code was wrong and ours was correct.
•  » » » » » 4 months ago, # ^ |   +5 Maybe you misunderstood me or I am really wrong, I mean the rating under the correct tests.
 » 4 months ago, # |   +13 Even though the round will be unrated, I liked the problems a lot! Kudos to the authors!
 » 4 months ago, # |   +2 3 problems got pretest passed and the round is declared unrated!
 » 4 months ago, # |   +2 :( I was frustrated by lots of WA from pB...
•  » » 4 months ago, # ^ |   0 Same
 » 4 months ago, # |   0 My algo for B was absolutely right and the only problem was there in implement lex. sort which was exceeding the time limit.I went mad when I saw some people solving it with time of about 15ms.
•  » » 4 months ago, # ^ |   +2 I used a map.It is more easy.
•  » » » 4 months ago, # ^ |   0 The time was 31 ms.
 » 4 months ago, # |   +22
 » 4 months ago, # |   +3 I hate of hearing "The round is unrated" in the middle of the contest and I prefer not to go on.
 » 4 months ago, # |   -31 Kuttar baccha , notir pola , tor bal taina taina chirbo ajke , specialist hoite partam , bal falao ??? jotoshob
•  » » 4 months ago, # ^ |   0 Ehe baaje kotha
 » 4 months ago, # |   +32 It's a shame, because D and E seemed like very interesting problems.Apart from B, I thought the problem set was good (perhaps a little too straightforward with C). That said, I was going crazy trying to figure out how over 1000 people got B.In any case, mistakes happen, so it's not a huge deal.
•  » » 4 months ago, # ^ |   0 lol, E is a boring implementaion
•  » » » 4 months ago, # ^ |   0 Oh is it? I thought there was going to be some type of clever preprocessing involved. Oh well.
•  » » » » 4 months ago, # ^ |   +6 it is boring preprocessing with finding LCA and updating on subtrees,I made it a lot of times
•  » » » » » 4 months ago, # ^ |   0 How do you deal with 1st query?
•  » » » » » » 4 months ago, # ^ |   +5 I just remember that this vertex is a New root
•  » » » » » » » 4 months ago, # ^ |   0 E is just cases based on whether lca(x, y) is in the subtree of v or not, and whether it is a parent of v or not right?
•  » » » » » » » » 4 months ago, # ^ |   0 E is just a combination of http://www.spoj.com/problems/DRTREE/ and https://www.codechef.com/LTIME14/problems/TALCA.
•  » » » » » » » » 4 months ago, # ^ |   0 yes
•  » » » » » 4 months ago, # ^ |   0 Ah, so it is LCA. My gut told me LCA but every other time my gut has told me LCA on a tree preprocessing problem it turned out to not be the answer lol.
•  » » » » » 4 months ago, # ^ | ← Rev. 2 →   0 Is it? I thought it is non-trivial to update subtrees with a dynamic root, and it should takes a few case analyzes to compute the answers based on the pre-computed data structures.
•  » » » » » » 4 months ago, # ^ | ← Rev. 2 →   0 Updating subtrees with a dynamic root is an updating some more subtrees with a constant root
•  » » » » » » » 4 months ago, # ^ |   0 Oh yeah, you are right. I thought it requires HLD to update but it seems precomputing the euler tour is enough.
•  » » » 4 months ago, # ^ |   0 Not so boring. I learned quite a lot today and implemented new stuff.
•  » » 4 months ago, # ^ |   +5 D is just boring persistent DS as well?
•  » » » 4 months ago, # ^ |   +5 you're right
 » 4 months ago, # |   +2 What was the issue in B? I did not understand the explanation.
 » 4 months ago, # |   +2 My dream is to be an expert, and the day I have the opportunity, you destroy my dream :(
•  » » 4 months ago, # ^ |   +3 You're really close to it, so don't worry. If at first you don't succeed, try try again! ;)
•  » » 4 months ago, # ^ |   +18 No one can destroy your dreams. Except You!
•  » » 4 months ago, # ^ |   -11 que drama do carai hahaha
 » 4 months ago, # |   0 interesting problem, anyway, could someone tell me the right solution of problem B? I solve B with the wrong solution, but get passed
 » 4 months ago, # |   +2 You should not write at least the closing line of the blog. :(
 » 4 months ago, # |   +254 "Jamie is preparing a Codeforces round. He has got a idea for a problem, but does not know how to solve it. Help him write a solution to the following problem:"  Problem B. Jamie and Binary Sequence ***** Unfortunately, the writers and coordinator solutions for the problem B are incorrect. The round will be unrated. We apologize.  D and E are pretty interesting (shoutouts to D) but I think they probably take too much time to code when put together in the same round.
•  » » 4 months ago, # ^ |   +21 Best comment 2018
•  » » 4 months ago, # ^ |   +2 Unrated — PredictingGoogle Chrome should have this extension
 » 4 months ago, # |   0 it was a realy good contest despite that problem B
 » 4 months ago, # |   +33 if(rank<=300) CF="UNRATED"; else CF="RATED"; :)
•  » » 4 months ago, # ^ |   0 Every fucking time.
 » 4 months ago, # |   -37 Any1 wanna solution for B..Here it ishttps://ideone.com/0HvwUB
•  » » 4 months ago, # ^ |   0 thanks
•  » » 4 months ago, # ^ |   0 i have solution like this too :D
 » 4 months ago, # |   0 Plz make the round semi-rated :(
 » 4 months ago, # |   +31
 » 4 months ago, # |   0 Can D be solved using implicit persistent segment tree?
•  » » 4 months ago, # ^ |   +38 Even the round is unrated, you shouldn't do this during the round. Am I right?
•  » » 4 months ago, # ^ |   -14 Not everything that could be made persistent is a segment tree.
•  » » 4 months ago, # ^ |   0 Maybe, but i don't know how to deal with condition xi ≤ 109
•  » » » 4 months ago, # ^ |   0 Making the segment tree dynamic.
•  » » 4 months ago, # ^ |   0 I think it can be solved by persistent trie on the values (x(i))
 » 4 months ago, # |   +1 After a week of no contest We got "Unrated" one disappointed :(
 » 4 months ago, # |   0 Why turning the round unrated?!Make it unrated for only those who got affected by problem B.
•  » » 4 months ago, # ^ |   0 yeah removing problem B from the contest is better than unrating the round
•  » » » 4 months ago, # ^ |   +7 removing problem B isnt a good idea someone who know the correct solution might waste lots of time on it
•  » » 4 months ago, # ^ |   +1 It'd be unfair to those who spent time on problem B and not on other ones.
•  » » 4 months ago, # ^ |   0 how do you know who got affected?
•  » » 4 months ago, # ^ |   -7 Do you realize you are selfish?
•  » » » 4 months ago, # ^ |   0 CS Academy just did that on their last round
•  » » » » 4 months ago, # ^ |   0 you're right what CS Academy did is another good way
•  » » » » » 4 months ago, # ^ |   -10 The reason for you getting high rating is others find the problem is wrong but you not. That is why i speak you are selfish.
•  » » » » 4 months ago, # ^ |   0 but that requires a new checker immediately available for rejudging submissions.
•  » » » » 4 months ago, # ^ |   0 The reason for you getting high rating is others find the problem is wrong but you not. That is why i speak you are selfish.
•  » » 4 months ago, # ^ |   0 I wasted 80 minutes on B then moved to C and solved it in 5 mins.
 » 4 months ago, # |   0 So what will happen to problem B? Will it be deleted or will the solution be corrected?
 » 4 months ago, # | ← Rev. 2 →   0 So next time, Never ask if the contest is rated or not .. Who knows anyways xD
•  » » 4 months ago, # ^ |   +1 everything is possible :)
 » 4 months ago, # |   +30
 » 4 months ago, # |   +5 B is tough. C is lot easier than B
 » 4 months ago, # |   -23 Solution for A: https://ideone.com/2iLBQK
 » 4 months ago, # |   +4 A and C got AC ;) is this why B has some mistake :P
 » 4 months ago, # |   +5 when you did your best on the contest and it's unrated!!
 » 4 months ago, # |   +73 Unfortunately both author and my solutions for today's problem B were based on simple, nice (and incorrect) greedy idea so they are incorrect. Now we found correct solution for this problem, but answer for some pretests differs, so it's impossible to make this round rated. Of course I did some stress testing for this problem, but my bruteforce was really slow, so it was impossible to check solutions on most of the tests and greedy idea seemd clear and correct, so there were nothing to worry about. However the most simple greedy is incorrect here (it minimises y, but doesn't produce lexicography maximum sequence). You can check your solution on test "1 7". Answer for it is "-2 -2 -2 -3 -4 -5 -5". Of course we will desribe correct solution in the editorial. We are very sorry about it and will try to make everything to make this not happen again.=========================================К сожалению и моё и авторское решение к сегодняшней задаче B были основаны на простой, красивой (и неверной) жадной идее, поэтому они оказались неверны. Теперь мы уже знаем верное решение для этой задачи, но ответ для некоторых претестов был неверен, поэтому невозможно сделать этот раунд рейтинговым. Разумеется, я провёл стресс-тест решений к задаче, но мой перебор был очень медленный, поэтому было невозможно проверить решение на большинстве тестов. Кроме того, решение казалось очень простым и понятным, поэтому ни у кого не было повода волноваться по поводу решения. Однако наиболее простая жадность тут неверна (она минимизирует y, но не выводит лексикографически максимальный ответ). Вы можете проверить своё решение на тесте "1 7". Правильный ответ для него "-2 -2 -2 -3 -4 -5 -5". Конечно мы опишем правильное решение в разборе. Мы приносим глубочайшие извинения и постараемся сделать всё возможное, чтобы это никогда снова не произошло.
•  » » 4 months ago, # ^ |   -29 is it correct for input 1 7 ? Yes -2 -3 -3 -3 -3 -3 -3
•  » » » 4 months ago, # ^ |   0 No.
•  » » » 4 months ago, # ^ |   0 lexicographical order
•  » » » 4 months ago, # ^ |   0 He mentioned it already. Here " You can check your solution on test "1 7". Answer for it is "-2 -2 -2 -3 -4 -5 -5""
•  » » » 4 months ago, # ^ |   0 sayedgkm output is same as mine, but it seems to be hard to understand what problem said now
•  » » 4 months ago, # ^ |   0 Even though I also made same mistake as the authors and you, and got AC. I believe that this mistake must be only made my idiots like me.
•  » » 4 months ago, # ^ |   +1 My solution gives -2 -2 -2 -3 -4 -5 -5 which is correct but I fail on pretest 5 so I'm assuming it's one of the pretests that they got wrong
•  » » » 4 months ago, # ^ |   0 how did you solve?
•  » » » » 4 months ago, # ^ | ← Rev. 4 →   +3 Consider the binary representation of n For each number i that 2^i is in the binary representation put i in the answer list.now update the answer list as follows until it's size is equal to K while (len(list) < k): if (len(list) + count(maximums) <= k): remove all maximums and put two (maximum - 1) for each one you remove else turn a min element into two (min - 1) elements 
•  » » 4 months ago, # ^ | ← Rev. 3 →   0 I am getting the same answer for the aforementioned test. And I was getting wrong answer in test #5. Can you please reveal the pretest #5?
»
4 months ago, # |
-31

Unfortunately, the writers and coordinator solutions for the problem B are incorrect. The round will be unrated. We apologize.

# WTF! -_-

 » 4 months ago, # |   0 I found problem B very interesting and loved the priority queue solution. I thought it was completely correct and had no clue it could be wrong, so I'm not surprised at all that authors did not realize the incorrectness of this solution too.Please, don't be angry on them. I enjoyed this round a lot :)
 » 4 months ago, # | ← Rev. 2 →   0 Probably author solution fails in test n=20, k=4. Correct answer is {3, 3, 1, 1} while my passed gave {3, 2, 2, 2}.Oops, sorry, didn't see above comment of gritukan.
 » 4 months ago, # |   +43 Those red in top 10 who got B correct should be moved back to Div 2.
•  » » 4 months ago, # ^ |   +10 inb4 dreamoon finally gets his long-wanted div2 rank1.
 » 4 months ago, # |   +40 1500+ people did the same mistake as the setter's solution?? :o
•  » » 4 months ago, # ^ |   0 good question indeed! :p
 » 4 months ago, # |   +41
 » 4 months ago, # |   -16 The round is rated....
•  » » 4 months ago, # ^ |   0 what ?
 » 4 months ago, # |   +50 "... Let me close this blog post by answering the most frequently asked question in Codeforces. This round is ..." 0-ratedOn a more serious note, setters should not sub estimate easy problems. I had a similar experience with my problem KNICOV at CodeChef. The moral is that we have to double check greedy problems and have a formal proof.
 » 4 months ago, # |   -7 When you have solved C and open the page to submit but find out the round became unrated..
 » 4 months ago, # |   +37 Come on guys, no need to be so harsh.Everyone makes mistakes. Maybe they had a rough day and didn't properly check their solutions. Look at the number of up votes for this announcement before and after the UPD.It is tougher to come up with a quality question than to solve it so we have to appreciate them.Good job guys!! Make sure you double check your solutions next time ;)
 » 4 months ago, # |   +14 I think the correct answer is more important than rating.
 » 4 months ago, # |   -17
 » 4 months ago, # | ← Rev. 2 →   0 Why "Idleness limit exceeded on pretest 1" in http://codeforces.com/contest/916/submission/34316902 ? UPD: This happens because I am trying to read an integer in queries and removes
•  » » 4 months ago, # ^ |   0 side note: Wouldn't your memory requirement become quadratic? vector ?
•  » » » 4 months ago, # ^ |   0 The vector just keeps a pointer, so no .
 » 4 months ago, # |   0 Scanner scanner = new Scanner(System.in); int x = scanner.nextInt(); int hh = scanner.nextInt(); int mm = scanner.nextInt();i have a runtime error, i guess it didn't read the input num or just waited for input why it doesn't work？ it can work in my computer......
 » 4 months ago, # |   +3 Can someone please explain solutions for problems D and E?
•  » » 4 months ago, # ^ |   +8 For D, you can use a implicit persistent segment tree to keep the values of the words and another to keep the amount of words with value equals to X.
•  » » » 4 months ago, # ^ |   0 i know persistent segment tree and implicit treap but what is this implicit persistent segment tree what are it's applications ?
•  » » 4 months ago, # ^ |   0 for D, i think just use pbds and some implement... but i didn't do it before the end of the contest
•  » » 4 months ago, # ^ |   +8 For E, let's solve a simpler problem, suppose you just have to change the root and query the sum in a subtree, if we preprocess the sum of subtrees with the tree rooted at X, there's only three cases to handle when answering queries to a vertex V, if (current_root = V), the answer is the sum of all nodes if (current_root in V subtree), the answer is the sum of all nodes minus the sum of nodes in subtree of vertex that leads to current_root in the sons of V if (current_root not in V subtree), the answer is the sum of the nodes in the subtree of V To process the updates you have to find the lca(u,v) considering the tree rooted in current_root, the vertex is one of the nodes in {lca(u,v), lca(u, current_root), lca(v, current_root)} and then you process the update similar to the queries, to update a subtree and to query the sum in a subtree, you just need a bit and euler tour.
•  » » » 4 months ago, # ^ |   0 Thank you. That is quite hard (idea and implementation).
•  » » 4 months ago, # ^ |   +5 and these are very interesting problems for me
•  » » » 4 months ago, # ^ |   +5 I agree. D and E are very interesting.
 » 4 months ago, # |   +34
 » 4 months ago, # |   0 How about the system test for B?Can the first successful submission be considered as the last submission? (for time and for score)
 » 4 months ago, # |   +21 problem setter make bug in problem B program and this round unrated if the solution of problem setter can accept, I think the problem is a good problem But problem D, E are very trouble, I don't think DS and long code and many details can be contest good if the round is div 2 , please problem setter use some hard and not template problemso if the solution of problem setter can accept B, I also think this round should be unratedthe contest value > the contest rating :)
 » 4 months ago, # |   +3 Nice contest dudes too bad it's unrated but the problems were good!
 » 4 months ago, # |   +16 Alternatively u guys can fix B prroblem description to "Of all satisfied sets with elements sorted in non-increasing order, print out the lexicographically smallest one. THEN greedy sol would be correct.
•  » » 4 months ago, # ^ | ← Rev. 2 →   0 Can you please explain why this would work for lexicographically smallest one.
 » 4 months ago, # |   +29 Common guys mistakes happen. Don't discourage problem setters
 » 4 months ago, # |   +27 Is it good idea to change statement of problem B — only minimize max(a_i)? In this case problem is good for div2B and all solutions will get ok.
•  » » 4 months ago, # ^ |   0 Yes , Then the question gets quite easy right , just calculate the exponent of 2 for which (2^exp)*k >= n (i.e all k terms are exp initially) and exp will be the max a_i and decrease the remaining a_i's such that sum = n and print them .
 » 4 months ago, # |   +29 Lesson to problem setters: If you are including a greedy problem, write a Formal proof of it. If you say after contest that the greedy solution seemed correct, I think it straight away implies that there was no formal proof written / verified.
 » 4 months ago, # |   0 Pretest 5 of Problem B gives me another chance to look my life again, how almost competitors wrong here?
•  » » 4 months ago, # ^ |   +17 "It's a div2B so 90% of the time it doesn't require deeper thoughts" <--- Probably why
 » 4 months ago, # |   +7 It was the first experience of contest setters. Sure, in the next time they will make better contest. Everything is ok.
 » 4 months ago, # |   +11 You guys need to calm down a little bit. In the end, this is just one round that, in the long run, will have very little impact on your life. Everyone makes mistakes. There's no need to curse out the problem writers, who clearly worked hard to make interesting problems. I can't imagine the difficulty it takes to write a set of problems that have absolutely no flaws in them, and most people complaining can't either, since Div 2 people rarely write rounds.It's not the end of the world if one round you were doing well on goes unrated. If your performance was part of a trend, you'll do well on future contests. If your performance was an outlier, then future contests would have corrected your rating anyway.
 » 4 months ago, # |   0 Because problem B and the unrated contest they got more than (-100) on this post
•  » » 4 months ago, # ^ |   0 Actually I still don't know how I can receive a WRONG ANSWER ON PRETEST 5
•  » » » 4 months ago, # ^ |   0 we will see after testing ends.it's -135 now
•  » » » » 4 months ago, # ^ |   0 Before contest: About +190 or higherAfter unrated: wait for it...
 » 4 months ago, # |   0 editorial?
 » 4 months ago, # |   0 why system testing is too slow ? -_-
•  » » 4 months ago, # ^ |   0 1) So many hacks on A2) So many submissions on A
•  » » 4 months ago, # ^ |   +11 Problem A has more than 250 test cases! :/
•  » » » 4 months ago, # ^ | ← Rev. 2 →   -7 UPD: it's my fault
 » 4 months ago, # | ← Rev. 2 →   +3 For problem E, is it: 1. dfs the tree and build LCA and record the dfs order 2. build segment tree 3. do query ?
•  » » 4 months ago, # ^ |   0 Yes
 » 4 months ago, # | ← Rev. 2 →   +1 worked on B for quite a long time but can't solve. feel released now.
 » 4 months ago, # | ← Rev. 2 →   +3 Over 250 test cases for problem A... personally I think 50 would be enough and thanks to that judging time would be much shorter :P
 » 4 months ago, # |   0 Can you please reveal the test #5 of problem B?
 » 4 months ago, # |   +21 I wish I was the writer of this round, so I can get a lot of downvotes.
 » 4 months ago, # | ← Rev. 5 →   -13 Very cool round!(no)
 » 4 months ago, # |   +19
 » 4 months ago, # |   0 You end up in fourth in the contest and then the contest was declared unrated, so sad
•  » » 4 months ago, # ^ |   +28 you know that you are not in div2,right?! :))
 » 4 months ago, # |   0 How to solve D and E ?
 » 4 months ago, # |   +31 i don't get the point of putting Persistent Implicit segment tree in the D problem if someone has a decent template of it he can solve it in a little under 30 minutes i think putting a problem that required more thinking would have been better.
•  » » 4 months ago, # ^ |   0 i don't get the point of putting Euler Tour Tree in the E problem if someone has a decent template of it he can solve it in a little under 30 minutes i think putting a problem that required more thinking would have been better.
 » 4 months ago, # | ← Rev. 2 →   +8 Don't you guys think that putting a persistent data structure problem on Div. 2D is not suitable ? I was going to compete in a Div. 2 contest for fun. However, got stuck on problem B and D........ :(
•  » » 4 months ago, # ^ |   0 I agree with you.I have no idea to D and E. They are not friendly to us newbies. I also made lots of small mistakes when I held a small contest in my school for the first time. So I believe the tiny flaws of this round are acceptable. I wish the authors,coordinators and testers will prepare a better round the next time.
•  » » 4 months ago, # ^ |   0 Coincidentially I was first exposed to "persistent" data structure problems was also a div2D.http://codeforces.com/problemset/problem/707/D
•  » » 4 months ago, # ^ |   +3 I remembered I saw a problem which is several yrs old and is a div2E. It's just dfs order. Now it is dfs order + segment tree + lca. So we can conclude that the average intelligence of human beings is increasing right? haha
 » 4 months ago, # |   -26 ваша тестирующая система некорректно работает, у меня ответы все правильные которые вы выдаете за неправильный ответ!!!
 » 4 months ago, # |   0 expected that situation after phrase "He has got an idea for a problem, but does not know how to solve it."...