WA in LEADGAME

http://www.codechef.com/viewsolution/3651481

I am getting Wrong Answer in LEADGAME. What have I missed out?

You have understood the question incorrectly. The exact solution is somewhat different. You have to find out the difference between the cumulative values at any instance and among that you have to give the maximum difference. The example is explained below : <brL

3

1 2 Cummulative difference upto this index 0 and is 1 with winner 2

2 3 Cummulative difference upto this index 1 and is 2 with winner 2

3 4 Cummulative difference upto this index 2 and is 3 with winner 2

So answer is 1 3.

2 Likes

Oh yes! I totally ignored the 1st scoresheet in the problem! Thanks a lot! :slight_smile:

Your Welcome! @sandy999 Please accept the solution so that the question could be closed.