My issue
can anyone tell me the test case for which my code is wrong?
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t,lead=0,winner;
cin>>t;
for(int i=1;i<=t;i++)
{
int x,y,diff;
cin>>x>>y;
if(x>y)
{
diff=x-y;
if(diff>lead)
{
winner=1;
lead=diff;
}
}
else
{
diff=y-x;
if(diff>lead)
{
winner=2;
lead=diff;
}
}
}
cout<<winner<<" "<<lead;
}
Problem Link: The Lead Game Practice Coding Problem - CodeChef