0
Why my output for large inputs coming 0 for question C ? https://ideone.com/0wQyKD 
Created or updated the text 
0
Solved,Thank you! 
+9
You made wellknown mistake: Arrays.sort() > Collections.sort(). Sort in Arrays has O(n^2) in worst case. 
0
You're welcome ;D 
0
Same issue! 
0
Same issue 
+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. 
+5
For fun. 
0
Most people also do the problems in order because they expect them to be in order of difficulty. 
0
Thank you very much ! I ever never know :D 
0
Auto comment: topic has been updated by PikMike (previous revision, new revision, compare). 
+17

+5
To educate others :D 
+5
then why do Div1 participate in Div2/ Div3 or Educational rounds? 
0

+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. 
+8
Where is the editorial ? 
0
Yeah figured it out. Thanks for the help :) 
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. 
+37
Thanks for div2 only contests !11!1 
0
How could i optimize my submission which got TLE on 68the case ? 
0
Soon 
+8
When will you upload Editorial?? 
0
Auto comment: topic has been updated by PikMike (previous revision, new revision, compare). 
0
Thanks for the help Jiburiru 
0
only use long double when you dont need accurate number 
0
I am getting WA using long double...I am pretty sure it's due to floating errors.38530049..Please help 
+1
then what's the fun of hacking other's solution 
+18
Is there any solution for F except O(N * 26)? 
0
In educational rounds, No. 
+4
In last box there are at least k pencils so we have to find rightmost j that 
+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 nonisomorphic, 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. 
0
does hacking a solution not effect our rating 
0
UR?My Rating was changed a few minute ago. 
0
Why not wait 10 more minutes and then discuss whether it is rated? :) 
+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. 
0
is this contest really unrated. 
0
The rating were changed so it's rated 
+4
when will the editorials be updated? 
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 semirated). 
0
so it's unrated? but Problem E's tests are right? 
14
Issue of the writer's solution was wrong on Problem E (And not clear words on Problem D?) 
0
why not rated? 
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. 
0
Fix my code to use STL sort, I got AC. thank you! 38527514 
0
The test was designed specifically to counter quicksorts I was hacked with this once actually 
0
Use inbuilt STL sort — sort(ar,ar+n) where ar >array and n>size of the array. 
0
Oh... I understand thx How to fix it? 
0
qsort has worst case O(n^2) I think. 
0
maybe it's magic..hah 
0
System test has finished,so is it rated? 
0
get it. thank you. 
0
yes...thanks 
0
maybe you are right. modified code got ac...thanks...but i still can't understand why i got a different result 
0
Problem C:Why I got TLE Verdict?38494646 I didn't use while() so there are some troubles on sort? 
0
If you mean On after sort, it can use deque to maintain dp arrays . 
+5
emmm.. I think your code "if(nque.front().w<k)" has a little bug. if the queue is empty, then your code will runtime error? 
+5
Submit with diagnostics. Perhaps you have some undefined behavior due to the overflow or memory access. 
0
Editorial?? 
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 
0
you can use radix sort. but i meant O(n) algorithm after sort. 
+5
This is the first time I know that it looks so magical. Thank you very much for your reply. 
+3
Don't write hashes modulo 2^64 link 
16
*English 
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 
+1
Why are you taking x = d[i — k]? Can you elaborate more on that? 
0
I don't think there is 
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. 
+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? 
0
Is it possible to do it without sorting the array at all then ? 
0
We can hashes subscripts for each letter within each query range. 
+3
Problem D is similar to SRM 721 Div1 Easy. 
+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. 
+22
In contests page, the hacking phase for this round seems to be for 12 hours rather than a day. 
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. 
0
The error is caused in this line:
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 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! 
0
maybe the number of a【i】will exceed n1 
+5
No problem, it happens :D 
+5

+5
Actually, you output 2e+009 instead of 1999999999. Maybe this was the problem, not the precision of calculations? 
0

0
No, not that, I said I avoid long long mutiplications. I got WA using
I don't think it is wrong using 
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. 
0
I pass it using long double...(after contest q_q) 
+3
Thanks for replying.
OK, then I have no problem with D's limit.
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. 
+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. 
+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. 
+16
Nah, it was so standard. 
+6
I got 5 wrong submissions because of this. Luckily I realized it during the contest. Misreading statements is one of my specialties. 
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/38494892 At 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/38495105 I 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? 
0
Okay, then why the answer to the case 20 4 be not 6? here 1 2 3 4 5 5 = 30. 
0
wow ._. 
+12
I have time, but unfortunately, I lack patience. 
+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.

0
can anyone help with a good test case for problem E ? cannot Figure out where it could go wrong. #noob 
0
If you have time, you can just wait for editorial. 
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). 
+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. 
Name 
