DEFACING - Editorial

http://www.codechef.com/viewsolution/1790134
This code is producing right result on my machine(for the above mentioned case as well). Sorry to sound cynical but it is truth

19 hours the last submission was 1784916 and it produces wrong answer.
The test for the new version is 2926618 18735670.
The answer is 12988898.

1 Like

For a line like this

value    707496
max    10257511

why the answer “10089998” is wrong?
Your test give me “10099989”, but the last “6” cannot become “9”.

we add the empty slot after 707496:


 707496 
10257511

Then we can get 10099989.

Your WA is actually RE. It seems that for this test
2454 211622
the following happens

Error:-1
Error:java.lang.ArrayIndexOutOfBoundsException: -1
Error:java.lang.Exception: java.lang.ArrayIndexOutOfBoundsException: -1
1 Like

Ohhh
You are right, thanks for the input, I’ll work on the bug

Actually there were several AC in Java even during live contest:
http://www.codechef.com/submissions?language=10&status=15&pcode=DEFACING
But AFAIK EgorK invent an O(lg(M)) solution in order to solve the problem while having TLE with O(lg(M) * lg(S)) solution.
So probably for Java TL is a bit strict, though it is twice as usual TL.