Page 3 of 3

Re: Why WA for 11249, please give me some critical i/p & o/p

Posted: Thu Jul 05, 2012 7:29 am
by brianfry713
Output a blank line after each test case, not every line.

Re: Why WA for 11249, please give me some critical i/p & o/p

Posted: Fri Jul 06, 2012 4:29 pm
by esharif
:oops: Though I omit the possible error that said by U (brianfry713), I get WA yet, if U provide me some critical input....thnx
now my edited code is just like this:

Code: Select all

#include<stdio.h>

int main()
{
    long int i, j, a, b, t, k, q, sum, dif, res;
    while(scanf("%ld",&t)==1)
    {
        for(i=1; i<=t; i++)
        {
            scanf("%ld%ld", &k, &q);
            for(j=1; j<=q; j++)
            {
                scanf("%ld%ld", &a, &b);
                if(b>a)
                    dif=(b-a);
                else
                    dif=a-b;
                if(dif%2==1 && k>=dif/2)
                    printf("WINNING\n");
                else
                    printf("LOSING\n");
            }
            printf("\n");
        }
    }
    return 0;
}

Re: Why WA for 11249, please give me some critical i/p & o/p

Posted: Tue Jul 17, 2012 3:39 am
by brianfry713
Input:

Code: Select all

1
5 1
10 100
AC output WINNING