Recent actions
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 23 hours ago 0 Why my output for large inputs coming 0 for question C ? https://ideone.com/0wQyKD
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 23 hours ago Created or updated the text
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 23 hours ago 0 Solved,Thank you!
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 24 hours ago +9 You made well-known mistake: Arrays.sort() -> Collections.sort(). Sort in Arrays has O(n^2) in worst case.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 24 hours ago 0 You're welcome ;D
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 25 hours ago 0 Same issue!
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 25 hours ago 0 Same issue
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 25 hours ago +6 In Question C,I had got time limit exceed in test case 19 in java while with same algorithm (same code) in C++ is able to pass all test cases.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 28 hours ago +5 For fun.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 28 hours ago 0 Most people also do the problems in order because they expect them to be in order of difficulty.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 28 hours ago 0 Thank you very much ! I ever never know :D
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 29 hours ago 0 Auto comment: topic has been updated by PikMike (previous revision, new revision, compare).
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 29 hours ago +17
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 29 hours ago +5 To educate others :D
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 29 hours ago +5 then why do Div1 participate in Div2/ Div3 or Educational rounds?
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 29 hours ago 0 http://codeforces.com/blog/entry/59587?#comment-432798
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 29 hours ago +5 ideone is by default public. you can see submissions in https://www.ideone.com/recent. Maybe someone copied from there. keep your submissions private from now on. Its an incognito type icon near stdin below input text box.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 30 hours ago +8 Where is the editorial ?
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 30 hours ago 0 Yeah figured it out. Thanks for the help :)
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 30 hours ago 0 __i use ideone to run the code but the solution is copied and i get unrate. Does my computer have malicious code? Explain me, please.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 30 hours ago +37 Thanks for div2 only contests !11!1
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 30 hours ago 0 How could i optimize my submission which got TLE on 68the case ?
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 30 hours ago 0 Soon
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 31 hour(s) ago +8 When will you upload Editorial??
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 31 hour(s) ago 0 Auto comment: topic has been updated by PikMike (previous revision, new revision, compare).
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 31 hour(s) ago 0 Thanks for the help Jiburiru
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 32 hours ago 0 only use long double when you dont need accurate number
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 32 hours ago 0 I am getting WA using long double...I am pretty sure it's due to floating errors.38530049..Please help
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 32 hours ago +1 then what's the fun of hacking other's solution
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 33 hours ago +18 Is there any solution for F except O(N * 26)?
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 33 hours ago 0 In educational rounds, No.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 34 hours ago +4 In last box there are at least k pencils so we have to find rightmost j thatj <= d — k and dp[j] = 1 now check that pencils j + 1 to i can be in one box or not?
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 34 hours ago +9 It works like this:First we replace each letter in S with the distance to the nearest same letter on the right, or ∞ if there's no such letter. E.g. "abacaba" becomes [2, 4, 2, ∞, 2, ∞, ∞]. This takes O(n) time. Now instead of a sequence of letters, we have ≤26 interleaved linked lists — one for each letter type in S.If substrings X and Y are isomorphic, then all elements of linked lists that form X must be identical to those which form Y, except the last elements, since they point outside our region of interest.Therefore, X and Y are non-isomorphic, iff there is an index i, s.t. X[i] != Y[i] && (X[i]+i < len(X) || Y[i]+i < len(Y)). To find i, we quickly (using a lcp array) iterate over all j, X[j] != Y[j] and check X[j]+j < len(X) || Y[j]+j < len(Y). We will do at most 26 iterations, because X[j]+j >= len(X) means that j was the last occurrence of the letter at j.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 34 hours ago 0 does hacking a solution not effect our rating
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 34 hours ago 0 UR?My Rating was changed a few minute ago.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 34 hours ago 0 Why not wait 10 more minutes and then discuss whether it is rated? :)
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 34 hours ago +10 I tried to hack solutions of rolling hash of 2 const modulo after waking up, but the contest had finished.To hack rolling hash by 1 const modulo is very easy by birthday attack.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 34 hours ago 0 is this contest really unrated.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 34 hours ago 0 The rating were changed so it's rated
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 34 hours ago +4 when will the editorials be updated?
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 34 hours ago -6 The test case was fixed after 45min the contest started(and affected some verdict).I think some contestants waste the time because of the issue, so it's good that this contest change to unrated (or semi-rated).
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 34 hours ago 0 so it's unrated? but Problem E's tests are right?
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 34 hours ago -14 Issue of the writer's solution was wrong on Problem E(And not clear words on Problem D?)
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 34 hours ago 0 why not rated?
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 35 hours ago 0 To make it more clear — maybe it wasn't understood for the first time.If there were no issues, that would have been my fault 100%. However in this particular case, my decision was biased by the bug in writer's solution.I also think that it might be the case with more people as the difference in accepted solutions between D and E is very small, while it should be something like 250 for D and 450 for E, but I guess that many more competitors jumped to D as they saw that nobody was able to solve E for almost an hour.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 35 hours ago 0 Fix my code to use STL sort, I got AC. thank you! 38527514
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 35 hours ago 0 The test was designed specifically to counter quicksortsI was hacked with this once actually
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 35 hours ago 0 Use inbuilt STL sort — sort(ar,ar+n) where ar ->array and n->size of the array.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 35 hours ago 0 Oh... I understand thxHow to fix it?
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 35 hours ago 0 qsort has worst case O(n^2) I think.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 35 hours ago 0 maybe it's magic..hah
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 35 hours ago 0 System test has finished,so is it rated?
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 35 hours ago 0 get it. thank you.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 35 hours ago 0 yes...thanks
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 35 hours ago 0 maybe you are right. modified code got ac...thanks...but i still can't understand why i got a different result
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 36 hours ago 0 Problem C:Why I got TLE Verdict?38494646I didn't use while() so there are some troubles on sort?
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 36 hours ago 0 If you mean On after sort, it can use deque to maintain dp arrays .
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 36 hours ago +5 emmm.. I think your code "if(n-que.front().w
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 36 hours ago +5 Submit with diagnostics. Perhaps you have some undefined behavior due to the overflow or memory access.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 36 hours ago 0 Editorial??
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 36 hours ago 0 As a novice, I have a question for everyone. Why did I submit the same code twice, but one got AC, another got WA. 38509969 during the game. 38524984 after the game
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 37 hours ago 0 you can use radix sort. but i meant O(n) algorithm after sort.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 37 hours ago +5 This is the first time I know that it looks so magical. Thank you very much for your reply.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 38 hours ago +3 Don't write hashes modulo 2^64 linkThe string in 16's test is Thue–Morse sequence
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 38 hours ago -16 *English
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 38 hours ago 0 Can anyone tell me Problem F why my solution get WA on test 16's 9259th query? I have been debugging for more than five hours. qaq. this is my submission code: 38512729
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 38 hours ago +1 Why are you taking x = d[i — k]? Can you elaborate more on that?UPD : Got it NVM.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 38 hours ago 0 I don't think there is
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 39 hours ago 0 first sort all numbers, now you just need to group consecutive elements, we can use dp to solve this problem. Let dp[i] indicate whether the first i elements can be successfully grouped, dp[i] is transferred by dp[l] | dp[l + 1] | ... | dp[r — 1] | dp[r]. l, r is the interval endpoint that makes dp[i] exactly satisfy condition, As i increases, l increase, r increase, so you can use deque to maintain.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 39 hours ago +5 For problem F,if the size of alphabet is up to 10^5 or larger and other constraints remain the same,is there any approach to solve it?
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 39 hours ago 0 Is it possible to do it without sorting the array at all then ?
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 39 hours ago 0 We can hashes subscripts for each letter within each query range.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 39 hours ago +3 Problem D is similar to SRM 721 Div1 Easy.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 40 hours ago +6 Educational rounds are rated for users with rating below 2100, but it doesn't mean other users are unofficial. I think, In those rounds all users are welcome to participate officialy.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 40 hours ago +22 In contests page, the hacking phase for this round seems to be for 12 hours rather than a day.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 40 hours ago -8 Hi, I just wanted to mention that it seems that users with rating above 2100 are registered as official contestants... or at least they don't disappear when I unset the "show unofficial" checkbox.Hope that doesn't causes any problem.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 41 hour(s) ago 0 The error is caused in this line:while(cnt && abs( *(s.rbegin()) - *L ) > l )You are trying to access to the value pointed by L, but a few lines before, you erased that value from the set. I saved *L in a variable before deleting it from the set, and the Runtime Error was gone, but now it gives Wrong Answer. I'm not really sure what's the idea behind your code, so I can't help you with that. I hope this comment helps you solving the problem :)PD: there is another error in that line: you forgot to check that the multiset is not empty before trying to erase an element from it. That may cause Runtime Error too. Bye!
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 41 hour(s) ago 0 maybe the number of a【i】will exceed n-1
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 41 hour(s) ago +5 No problem, it happens :D
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 41 hour(s) ago +5 Yeah, I just saw that.Thanks. Sorry for bothering. It's my fault.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 41 hour(s) ago +5 Actually, you output 2e+009 instead of 1999999999. Maybe this was the problem, not the precision of calculations?
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 41 hour(s) ago 0 ...
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 41 hour(s) ago 0 No, not that, I said I avoid long long mutiplications.I got WA using ceill(n/X) but AC (preliminary) using following code:for(; n>0; n -= X, ++Ans);I don't think it is wrong using ceill(n/X).
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 41 hour(s) ago 0 If you have to multiply numbers that big then you are doing something wrong? I mean, use long double as much as you want to if you are sure in the correctness of the answer you get. Or you can think a bit more and get a much smaller estimation on the borders of binary search.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 41 hour(s) ago 0 I pass it using long double...(after contest q_q)
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 41 hour(s) ago +3 Thanks for replying. We had a solution and didn't really want it too pass. It's like one step easier than the intended one. OK, then I have no problem with D's limit. All calculations in my solution are performed using only integer types and fit into long long. So, you mean that long double is intended to fail ? Should "using long long instead of long double" be a part of the contest ? Maybe it should be but I don't know ? Really, worst time ever : getting WA on test 7 but the logic of the program is absolutely right, struggling whether to submit again or to give up.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 42 hours ago +6 We had a solution and didn't really want it to pass. It's like one step easier than the intended one.All calculations in my solution are performed using only integer types and fit into long long.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 42 hours ago +2 UPD: My fault... See comments below.Well, it is a good round ... but problem D. (No offensive).Even though problem D itself is a good one, but it is not very friendly to the CPPers.We need to handle two long long multiplication carefully. ( Aha! I know it! I avoid this! )And then math functions bring floating errors! ( WHAT? )Should "handling floating errors" really be the part of the contest?My key point is : D is a good problem, but it shouldn't make certain languages better than others.(Making D's limit into 109 would be a better choice, I don't know any brute force that can pass 109 but not 1018).
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 42 hours ago +9 1+2+3+4+5+5=20.If 1 is your h1, meaning that it is the pillar that is leaning against the fence, then the other side has to descend from 5 to 1. It can't just stop at 5 abruptly.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 44 hours ago +16 Nah, it was so standard.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 44 hours ago +6 I got 5 wrong submissions because of this. Luckily I realized it during the contest. Misreading statements is one of my specialties.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 44 hours ago -30 I checked more precisely. At the time I was looking at the next task (after solving C), there should have been 23 E solutions accepted already, this was the last one:http://codeforces.com/contest/985/submission/38494892At the same time there was 0 accepted solutions to E and there were 11 accepted solutions to D, the last one: http://codeforces.com/contest/985/submission/38495105I have no reason to lie, as I said I expect a positive rating change. If I had seen these numbers when I was making a decision I would have started with E.I just have a feeling that the issue with E is sufficient to make this contest unrated. I was impacted indirectly but many people were impacted directly.Besides — there was incorrect author's solution, this fact should make the whole round unrated, given ACM rules. I object to policy of making rounds rated just to please the maximum number of people. Rounds should be unrated unless they ran perfectly in 100%.What do you think MikeMirzayanov?
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 45 hours ago 0 Okay, then why the answer to the case 20 4 be not 6? here 1 2 3 4 5 5 = 30.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 45 hours ago 0 wow ._.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 45 hours ago +12 I have time, but unfortunately, I lack patience.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 46 hours ago +5 I came up with this algorithm:Let's call a vertex heavy if it has degree >= sqrt(M).Let's call a triangle heavy if it contains at least one heavy vertex. We can count the light triangles as follows: Iterate over all edges (u,v) were both u and v are light. Now for every light vertex w adjacent to u, check if (w,v) exists in the graph. For heavy triangles, let's iterate over every heavy vertex u, and mark its adjacent vertices as visited. Now for every edge of the graph check if it has both of its endpoints visited.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 46 hours ago 0 can anyone help with a good test case for problem E ? cannot Figure out where it could go wrong. #noob
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 46 hours ago 0 If you have time, you can just wait for editorial.
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 46 hours ago -6 It is not an excuse as I will probably get positive rating change after this contest (at least this was my knowledge when writing this post)... And I'd rather give it up for unrated round as I feel that this contest was interrupted by the bug.It just demonstrates the subtle impact of the issue. I based my decision on the number of problems solved and I got stuck on D until the end of the contest and I have a reason to believe it would not have been the case, but for the mistake.As regards previous comment — it is not true. After 40 minutes I should have seen comparable number of solutions to both problems. If I see around 30 solutions on D and 0 on E, it is a clear indicator for me that D should be easier than E (not everyone should follow this logic).
 On PikMike → Educational Codeforces Round 44 [Rated for Div. 2], 46 hours ago +3 I firstly calculated the max height I can reach such that I have enough sand bags to come down, then I calculated how many sand bags are left from reaching that height and then coming down to the ground . After that I calculated the length of the plateau by diving the remaining bags with max height and if now there is some remaining bag , I just increase the answer by one because that can be compensated by a dual move of that height when we reach that height while coming down. We can prove that it will always be equal to one of the coming down heights.