#include<stdio.h>
int main()
{
int n,i,leader,sum1=0,sum2=0,largest,l=0;
scanf("%d",&n);
int ply1[n],ply2[n],lead[n];
for(i=1;i<=n;i++)
{
scanf("%d",&ply1[i]);
scanf("%d",&ply2[i]);
Found it! Firstly, change your logic, see the sample test in the question, it talks about cumulative difference in the rounds(take previous scores added up till that score).
Change your code here :-
change i<n to i<=n
Also at the time of declaring the array, declare it as ply1[10001] and ply2[10001] because arrays are declare with constant size. Maximum value of index can go upto 10000 hence the size can go upto 10001. Also initial value of l should be 1 not 0 because you are doing 1 based indexing.
hey…i didn’t get it…see i still didn’t understood why we are taking cumulative difference.on adding the previous score with the second one i got the difference of 71 which is greater than 58…
so…could you please make me understand