11249 - Game
Moderator: Board moderators
-
- 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
Output a blank line after each test case, not every line.
Check input and AC output for thousands of problems on uDebug!
Re: Why WA for 11249, please give me some critical i/p & o/p
![:oops:](./images/smilies/icon_redface.gif)
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;
}
-
- 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
Input: AC output WINNING
Code: Select all
1
5 1
10 100
Check input and AC output for thousands of problems on uDebug!