The lead game

Please check this code and point out my mistake.

#include
#include<stdio.h>

using namespace std;

int main ()

{
unsigned int N,s[10000]={0},t[10000]={0},w[10000],l[10000],i;
scanf("%d", &N);

for(i=1;i<=N;i++)
    {
    scanf("%d", &s[i]);
    scanf("%d", &t[i]);
    }

for(i=1;i<=N;i++)
{
    s[i] = s[i] + s[i-1];
    t[i] = t[i] + t[i-1];

    if(s[i]>t[i])
        {
            w[i]=1;
            l[i]=s[i]-t[i];
        }

    else
        {
            w[i]=2;
            l[i]=t[i]-s[i];
        }
}


for(i=1;i<=N;i++)
{
    if(l[i]>l[i+1])
    {
        l[i+1]=l[i];
        w[i+1]=w[i];
    }
}

printf("%d", w[N]);
cout<<" ";
printf("%d", l[N]);

}

//