my code is as:
#include <iostream>
#include "stdio.h"
using namespace std ;
int main()
{ int test,x,y,z,w,lead,max=0;
cin>>test;
if (test>10000)
return 0;
while(test--)
{
int sc1=0 ,sc2=0 ;
cin>> x >> y ;
if ((x<0)||(x>1000)|| (y<0)||(y>1000))
return(0);
sc1+=x; sc2+=y;
if(sc1>sc2)
{
w=1;lead=sc1-sc2;
}
else
if ( sc2>sc1)
{
w=2; lead=sc2-sc1;
}
if(lead>max)
{
max=lead;
z=w;
}
}
cout<<z<<" "<<max;
return (0);
}
Afterreading a lot of comments I realised sum of scores was to be done. But still its wrong answe.
Any help would be appreciated !