0
My solution is quite strang and not elegant. I recommand you to read this guide:http://codeforces.com/blog/entry/51567?#comment354676. I think this guide is more easy to understand and to write the code. 
Created or updated the text 
0
got the case where it is failing input : abcfefg output : abceffg 
0
Please also discuss the approach for problem E. 
0
What special about test case 17? could not pass case 17 after multiple tries. my solutions: 26491308 , 26469800 
0
Can you provide a link or even better explain it yourself the details of the optimization ? 
0
What is the logic behind problem E? 
0
Just a moment after I posted, I realized sorting was enough to assign contiguous mice to a hole. As for the hole capacities, yep, I meant that (and I missed it's as simple as that!) Thank you :) 
+4
The group of mice assigned to some hole is always contiguous, i.e. there will never exist a situation that a,b,c are three consecutive mice (in increasing order of coordinate) but a and c are assigned to hole1 but b is assigned to hole2. 
0
How do you deal with hole capacities and the fact that contiguous mice are not necessary assigned to the same hole? 
+3
Is it normal that problems B and C now have duplicate tests? For example, there is the test #48 "1 // 1" that repeats further as #50, 51, and 54. Problem C also has such tests, e. g. "a" by #40, 41, 42, 45, 47, and 51. 
+1
I'm unable to submit a solution for the contest. It shows that System Testing is going on, while it was over hours ago. On clicking the submit button, it shows the message "Practice is allowed only for finished and unfrozen contests". 
0
nice warm up round man.... thanks for all these... i luv this website <3 
0

+16
You can solve it using dynamic programming. Let DP[j][i] denote the minimum cost to assign the first i mice to the first j holes. For each state, iterate over the leftmost mouse you will assign the jth hole to. This takes O(m*n*n) time. But notice that for a fixed j, the optimal leftpoint is nondecreasing for nondecreasing i, i.e. optima[j][i] <= optima[j][i+1]. So you can speed up the DP using divideandconquer optimisation. 
0
Nice contest and nice problems 
0
http://codeforces.com/contest/797/submission/26402069 why this submission always wrong at 25th test case???who can help me ?? 
+31
I don't know the time complex of the std. But the time limit makes me think that the std have the time complex of O(n^{2}). My solution's time complex is , and it costs 858ms. First it's easy to come up with the DP of O(n^{3}). Then let's look at the programme carefully, and we can find out that it's very similar to Knapsack problem. And this classic problem have a classic way(divide each original item into items) to optimize it to We can use the same way to opimize the original problem. Then we solve the origine problem in 
+6
I noticed that if I submit a solution after a previous solution got hacked, then my new solution runs only the original system tests, and not the hack(s) that caught my previous solution(s). That's too bad, because that way I can be "Accepted" again without fixing my problem (in fact, I have no idea whether I fixed my problem unless the hacker is kind enough to keep trying the hack on my new solution). UPDATE: Appears to be fixed now. 
0
I tried reloading many times, and also clearing my browser cache/cookies before trying again. This happens after I submit the input for hacking by the way. 
+3
There were two mistakes. One was a syntax error at line 92. Second mistake was I was remembering the nodes which are visited instead of values. AC solution: 26398128 
0
Its quite confusing . He has considered even more cases . Can you read my code once and tell me , which case I might be missing ?? 
+1
Your code fails for this testcase : abcbabbcc Your code outputs aabbccbcb whereas the correct answer is aabbbcbcc 
0
^This implementation is similar to yours. You can refer to this one. 
+17
That's how you try to cheat even in an unrated round!! 
0
Can anybody tell why my code is failing in one of the tests ?? https://pastebin.com/GC45xUAa 
0
Reload 
+6
It's my first time to try hacking here on CF. Not sure how it works. It seems to be just stuck loading forever. Is this supposed to happen? 
0
No successful submissions on E in Python 2 or Python 3. I tried to rewrite one Java solution to Python, it TLEed on test 7. Isn't the time limit of problem E too tight for Python? 
+3
Can someone tell me where I am wrong in D? I made a fucntion I am getting WA at Test Case 20. And my answer differs by 1 from expected answer. Submission Link: 26396243 
0
Can someone please help me in finding mistake in my Solution for problem C. 
+40
Please discuss the approach for problem F. 
0
Ah, I see. Thanks! I completely missed the fact that when p changes the array element chages as well. 
0
In the first operation p = 1 p = p + a[p] + k p = 1 + 3 + 1 p = 5 In the second operation p = 5 p = 5 + 7 + 1 p = 13 p > 10 
0
Can someone explain to me why in the second test for E the 8th number is 2?
p = 1, a[1] = 3, k = 1, n = 10; 
0
Thank you man! 
0
How did you manage to solve A and B if you consider yourself as dumb? :) 
0
I am so dumb :( ....I really do not know anything :( 
0
Check the edit up there /. You can't use 1000 not because of time but because of overflow on short int operations. 
0
You can solve it greedily.

0
I still get TLE even with this :/ 26394497 
0
How to solve C ???? 
0
Never thought I could make more points than some reds or oranges. Strange contest =) 
0
The precomputation is probably too slow. Change 10^3 to sqrt(10^5) and it will probably pass. Edit: you didn't calculate the dp properly http://codeforces.com/contest/797/submission/26394436 
0
Did someone pass TL42 with mincost maxflow on F? 
0
sqrt decomposition 
0
Just precalculate answers p, k for p <= n && k <= B, and use naive algo when k > B. If B = sqrt(n) complexity is O(N * sqrt(N)) 
0
Can anyone tell me why im getting TLE on E. My idea is precompute for every k below 1000 in O(N) each and just simulate all k bigger than 1000 (worst case scenario is 100 operations if im correct) 26393091 
+8
very interesting problem set. I hope to see more problem set like this! :D 
+16
How to solve F? 
+30
Why not all the contests have clear problem statements like this one. Thank you for this interesting contest. 
+3
OOPS, I missed it, I'm very sorry .. thanks KieranHorgan and yinanzhu 
+28
Really? 
+10
Exactly. When the educational round starts (16:35) 11 hours after the Code Jam round ends (05:30). 
42
is it rated? 
+2
Google code Jam round 1A Educational Codeforces Round 19 
0
You must messed up the time zone of either contest. Hope you find out before it's too late. 
+4
Actually It doesn't. 
0
so, go for only one, which you like more! 
29
It overlaps with GoogleCodeJam round 1A ! UPD: It doesn't overlap .. thanks for yinanzhu and KieranHorgan 
0
ohh so that was the problem. Thank you ^^ I will keep that in mind from now on 
0
It should be 
0
If ak%i == 0 then we don't know if (pki,pki+1) can combinate all box, If it can make it, they will be the maximum size. If not, then(pki1,pki) also can combinate this box ak, so I think we should try this case. 
0
Why we are treating the case when a[0]%k==0 differently? 
0
Why on earth would he do that ? 
0
Sorry, my mistake. I've just found a bug in my source code. CodeForces forever ! 
Created or updated the text 
0
Actually, the solution worked. I had error in implementation. The algorithm is passing all the test cases. My AC Solution: Link 
+4
Java has a method called P.S. To fix this just use 
+9
In problem A, Antiquicksort hack cases work. 
+9
for problem A, there are more than 150 hacks in java.what's wrong with java ? 
0
I think the method you decide if a node is a left child or right child is wrong, because everything else that you said is like mine solution. Instead of checking if current_node is a right child or left child by some formula, I simply keep a stack on the moves I have made. You can look at my solution if you want 25872554 
0
And here is my poor code... I'm sorry about I forgot it.25873907 
0

+1
Yup, the problem turned out to be bitwise operations, i simply changed the line root=1<<(levels1); to root=(n+1)/2 and it got accepted. 
0
thanks, binary search seems not appropriate to this problem. I'm turning to learn with tutorial.... 
0
Well, when I switch to c++14 from c++11 I got more YES, but still wa on test 3. I feel quite confused. 
+1
Maybe the stl is different. 
+14
Someone pls help me with this. this program runs pretty well on my own computer. But it does not work in the test. It got wa on test 3, where the output should be all YES (and it is on my computer) 
0
the problem C's datas are too strong,,,I had WA many times. 
8
Somebody please HACK this — http://codeforces.com/contest/792/submission/25851911 
+1
I also got a WA on test 10, then I removed all the pow() operations and computed the values on my own, and this got me an AC. I think it's due to the inaccuracy of pow(), that you are getting a WA. 
0

0
You can, but probably you will have many bugs in code (like me :P). So, you can try :) 
0
When are the editorials scheduled? 
0
isn't it able to solve with normal logic? 
0
What is wrong with this approach of D ? IF IF IF Else I am maintaing Getting WA at test case 6. 
0
It can be solved by dynamic programming. 
0
It can be solved with DP 
+3
Find K = sum%3. If its 0, you are done. 
0
I made a function that receives a number x and returns info = {value, level, left/right, difference with parent} about it in log(n). 
0
How to solve C ? Is this a greedy problem ? 
0
How do I solve C? 
0
Hi, Thanks to the organizers for these problems. Just to be sure : I get an error on the C, it's said my output is not "0", it's "0" followed by a random character. I think there is an error in the evaluation test. In fact, my string is obtained this way : string s; s=""; s+='0'; The result must be : s=="0" (cast of '0' in a string format), don't you think ? Thanks, Regards. 
18
ARE YOU ON DRUGS? 
+10
Generally speaking, only 25% of world population speaks English, rest of the people use google translate and add "Sorry for my poor English" at the end.:D Sorry for my poor English. 
0
Good to see educational rounds back. I am Hoping for the rounds to be on Saturdays(2nd and 4th of the month) so that everyone can participate as it is a weekend. 
0
I did that solution during the contest, but i keep getting WA on test 10, do you have an idea why that happens 25855671 
0
I used two variables l and r to mark the leftmost (smallest) number and rightmost (largest) number of the subtree of current node. For 'L' and 'R' operations: When l = r, it means that the current node is at the deepest layer, so we should ignore these operations. Otherwise, shrink the range by making l = mid+1 for 'R' operations, or r = mid1 for 'L' operations, where mid = (l+r)/2 (the current node). For 'U' operations: When l = 1 and r = n, it means that the current node is the root, and we should ignore this operation. Otherwise, check the (x+1)th bit where xth bit is the lowest bit containing 1. If that bit is 1, the current node is in the right subtree of its parent. If that bit is 0, the current node is in the left subtree of its parent. Expand the range by moving l and r pointers. 
+11
How do you solve E? 
Name 
