The code works fine for simple test case but giving wrong answer on evaluation.
My code is at the following link - [link text][1]
Please tell me what is wrong in the code
[1]: VAZF91 - Online C Compiler & Debugging Tool - Ideone.com
The code works fine for simple test case but giving wrong answer on evaluation.
My code is at the following link - [link text][1]
Please tell me what is wrong in the code
[1]: VAZF91 - Online C Compiler & Debugging Tool - Ideone.com
Try with:
3
20 100
20 100
1000 0
The result should be player 1 with (1000+20+20)-(100+100)=840 lead points.
Your program gives player 1 with 1000 lead points.
Yes , according to the question it should give 1 1000 as output if i am not mistaken . The question link is - TLG Problem - CodeChef.
Please see to it.
Oh yes you are right , i misunderstood the question