tlg:wrong answer

i am getting wrong answer for the lead game question hereso please help me!!

#include<stdio.h>

int main()
{
int n,s[10000],t[10000],i,r,l[10000],w[10000],max,win;

scanf("%d",&n);

if(n>0&&n<=10000)
{
   for(i=0;i<n;i++)
   {
	scanf("%d %d",&s[i],&t[i]);
	r=s[i]-t[i];

	if(r>0)
	{
	    l[i]=r;
	    w[i]=1;
	}
	else
	{
	    l[i]=-r;
	    w[i]=2;
	}


   }

}

max=l[0];win=w[0];
for(i=1;i<n;i++)
{
	if(l[i]>max)
	{
	     max=l[i];
	     win=w[i];
	}

}

printf("%d %d",win,max);

return 0;

}

Where is the question? First post that only then we can help you.

bro !!!for the test case given in the lead game question im getting the correct answer on my machine but its showing wrong answer on submission can u please help wer the above code is going wrong

For your previous post if you have understood please go and close it.
I am looking your code. I will try my best. :slight_smile:

I recently found that i forgot to answer this question. I am sorry :slight_smile:

Try this


[1]. I tried to de-bug your code. I removed all the arrays and just working with 2 variables. Please check whether this will work or not 

**Happy Coding**


  [1]: http://ideone.com/ifzKeI