11249 - Game

All about problems in Volume 112. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

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

Post by brianfry713 »

Output a blank line after each test case, not every line.
Check input and AC output for thousands of problems on uDebug!
esharif
New poster
Posts: 18
Joined: Sun Jun 03, 2012 11:56 pm

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

Post 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;
}
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

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

Post by brianfry713 »

Input:

Code: Select all

1
5 1
10 100
AC output WINNING
Check input and AC output for thousands of problems on uDebug!
Post Reply

Return to “Volume 112 (11200-11299)”