12366 - King's Poker

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

Moderator: Board moderators

Post Reply
nest
New poster
Posts: 6
Joined: Sun May 20, 2012 10:18 am

12366 - King's Poker

Post by nest » Sun May 20, 2012 10:33 am

#include<stdio.h>
int main()
{
int a,b,c;


while(scanf("%d%d%d",&a,&b,&c)==3){
if((a==0||b==0||c==0)||(a<0||b<0||c<0)||(a>13||b>13||c>13))
break;
if(a==13&&a==b&&a==c)
printf("*\n");

else if(a!=13&&a==b&&a==c)
printf("%d %d %d\n",a+1,b+1,c+1);
else if(a==b&&a!=13){
if(c<13){
if(c<a){

if(a==c+1)
printf("%d %d %d\n",a,b,c+2);
else
printf("%d %d %d\n",c+1,a,b);
}
else
printf("%d %d %d\n",a,b,c+1);
}
else
printf("1 %d %d\n",a+1,b+1);
}
else if(a==c&&a!=13){
if(b<13){
if(b<a){

if(a==b+1)
printf("%d %d %d\n",a,c,b+2);
else
printf("%d %d %d\n",b+1,a,c);
}
else
printf("%d %d %d\n",a,c,b+1);
}
else
printf("1 %d %d\n",a+1,c+1);
}
else if(b==c&&b!=13){
if(a<13){
if(a<c){

if(c==a+1)
printf("%d %d %d\n",b,c,a+2);
else
printf("%d %d %d\n",a+1,b,c);
}
else

printf("%d %d %d\n",b,c,a+1);
}
else
printf("1 %d %d\n",b+1,c+1);
}
else if(a!=b&&b!=c&&a!=c)
printf("1 1 2\n");
else if(a==13||b==13||c==13){
if(a==b||b==c||c==a){
if(a==12||b==12||c==12)
printf("1 1 1\n");
}
}



}


return 0;
}

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

Re: pls tell me ; why wa

Post by brianfry713 » Mon May 21, 2012 10:42 pm

What's the problem number?
Check input and AC output for thousands of problems on uDebug!

nest
New poster
Posts: 6
Joined: Sun May 20, 2012 10:18 am

Re: pls tell me ; why wa

Post by nest » Fri May 25, 2012 12:09 am

12366.
sorry for that

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

Re: pls tell me ; why wa

Post by brianfry713 » Fri Jun 01, 2012 1:44 am

Try input 1 13 13
Check input and AC output for thousands of problems on uDebug!

User avatar
uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

Re: pls tell me ; why wa

Post by uDebug » Sat Feb 15, 2014 1:25 pm

In this problem, I wasn't careful enough to read that the input's terminated by

Code: Select all

0 0 0
Make sure you don't process this input else you're bound to get a WA.

In regards to test cases, posting all the critical cases would be akin to giving the answer away since the problem's not necessarily hard - and doesn't have any major "gotchas".

Also, since the title of this thread's not clear, I'm repeating the problem number and title below in the hope that this thread is returned by the forum search engine when a search for this problem is done.

12366 - King's Poker
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.

Post Reply

Return to “Volume 123 (12300-12399)”