## 246 - 10-20-30

Moderator: Board moderators

Mr.south
New poster
Posts: 11
Joined: Thu Jan 25, 2007 1:45 pm

### 246 - 10-20-30

i got WA, but the run time is only 0.006 second

why??

this is part of my code of scan file
int pile[8][52];

while(1)
{
scanf("%d", &pile[0][0]);
if(pile[0][0] == 0)
{
break;
}
else
{
for(i=1;i<52;i++)
{
scanf("%d", &pile[0]);
}
........continue
}
}
baodog
Experienced poster
Posts: 202
Joined: Wed Jul 04, 2007 6:53 am

### When is Draw

How do we know how many cards is dealt for a draw??
The problem does not state this. It says a draw occurs
if you can never win or loss. But how many cards for the output?
(Draw: ???) Theoretically,
it should be 0, because you know the cards in the
deck, but instead it's some >0 number as shown in the
sample input. Can someone clarify this? Thanks in advance.
baodog
Experienced poster
Posts: 202
Joined: Wed Jul 04, 2007 6:53 am
Nevermind, I get it now. Same state repeated = draw step.
bleed1979
New poster
Posts: 8
Joined: Thu Oct 08, 2009 5:34 am

### Re: 246 WA

Does anyone have a efficient method?

I use string and functions like sprintf() and strcmp() to memorize all cards, and got AC 0.392s.

but I thknk this method is too slow to detect "state repeated".
Judge World - problem solving is a routine.
http://bleed1979.myweb.hinet.net