10646 - What is the Card?

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

Moderator: Board moderators

b3yours3lf
New poster
Posts: 44
Joined: Wed Aug 14, 2002 3:02 am

10646 - What is the Card?

Post by b3yours3lf » Wed May 05, 2004 3:32 pm

hi,

i think this is a straightforwad problem but i got wa for many time.
could someone give me some input output sample? or i there some tricky case?

thanks before.

User avatar
UFP2161
A great helper
Posts: 277
Joined: Mon Jul 21, 2003 7:49 pm
Contact:

Post by UFP2161 » Wed May 05, 2004 8:11 pm

Just some random data:

Input:
20
5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H
JC 3C 9H KC TH 2D AC 6D 2S TC 2H 6H 8C 5D 3S JH AS JS 4C 9S 9D 6S 8H 2C 8D 8S JD 5H QD 7D KH KD AD KS 3H 5S TD 6C 7C TS 9C 7H 4S QS QC AH 3D 5C 7S 4D QH 4H
7C TD AS 8C 6H AH AC QH 9S 5H 2D JS 9D 9C 3C 5S 8D 4S 6D 4D 9H 2C 7S KH 8H QD KC JD KS 3S TS 5D 2H 4H 5C 6C 2S QS 6S TH QC KD JC JH TC 3H 3D 7D 8S 7H AD 4C
7D 8D 9C QS 2S 7H TS 4D JS QC TD 2H AS 4C TC 2C 2D QD KS KD JD 4H JC 6C AD KC KH JH 8C 9S 3S 8H AH 5H 3H 5C 6D 6H QH 5S 9D 5D AC 8S 3C 9H 7C TH 6S 3D 4S 7S
5S 6C JD AD TD 3D 4S 8H 2D 7H QD 9D 8C 4H KH AH QC 2C QH 7C 4C 4D 3C 5C 6D 7D JS 2H KD 6H JC QS AS 6S 8D KC AC 7S 8S 2S KS TS 5H 3H 9H JH 5D TC 9S 3S 9C TH
6H TH 3H 6C JD AD TC KS QC 8C 9C KH 5C 3S 9S JC 9D 2D AS 4D KD 2S TD 5H 5S AH KC QS 7H 8H 7S TS 3C 6S 7C 5D 8S QD 4C 4S 7D 3D 2H AC 6D 4H JS QH 8D JH 2C 9H
2S 7S 6D JS 5H KS AH KC 3S AS TD KH QC 4C AD JH 4S 2C QH 4D 6C JC 8D 8S 3D 9S 2H 6S TS JD 5S 9C 9H 9D 7C 5D 7H TH 8H 4H 3H 5C 6H KD 7D 3C TC 2D QS 8C QD AC
8C 2S JS 3D 7D 6S 9S 9D 5D QC 6D TC 8H 3H 6H KS AC KH 4C AS 4H 4S 5C TD QH QD KC 3C QS JH 5H 8D AD 3S 8S TH AH JD TS 9C 4D 6C KD 2C JC 7S 7C 9H 5S 2H 2D 7H
JC 6S 9H 3C KD 9C TS 8H QC 2D 7D 9D JH 8C 6C AS TC 7H 4D JS 6D 2S 3S 2C 4C KH 4S 5D 8S 8D TD 6H TH 3H KS 5H KC 5C QH AC 9S QD AH 7S JD 3D 5S 7C QS 2H 4H AD
QD 7C 4H KS 6D JC 3D 9D QH TS TD 2S 5S AH JH KD 9H 7H AC 5H 7S 2H 8H 8D 6S 5D JD AS 3S 3H 2C 7D QS 6C TC 4C JS 3C 6H TH 2D AD 9S KC 9C 8S 8C KH 4S QC 5C 4D
TH 4H TC QS 6S 5D 2D 7D AH 3H TD 5C 5S AD KD 9C 8C JC QH 4C 7C AC 3C 2C 2H 6H 8D 8H 9H 2S KC KH 7S KS 3S 3D 8S JS 5H 4D JD 6D QC 4S 9S QD TS 7H AS 6C JH 9D
KC 9C 5S TH 6D KH TS 2S 3C AC 4H 3H 6S JD QD QH 7S TD JC 9H 8D 2C TC KS 7H 2D QS 9D 8S QC 6C AD JS 7D JH 9S 3D 5D 5H 7C 8C KD 2H 8H 4S AH 6H 3S 4C AS 5C 4D
8S 8D TD 3S 4S JC KD QS 5H 7S 2S 2H 6S 6C QD 8H AS 8C 9D 9S 2D 2C 7D 5D 5C 3C TC TH JH 3D 7C 9C 7H JD JS KC 5S 6D 4H KS 3H AD 4C TS 9H AC AH QC KH 4D 6H QH
KD 8D 8C 9D 8H 5C QC 8S 6S TS 3D KC KS 5S AC JD 6C 4H JS 7H 4D 2S 4C 2D QH 3S QS 7C 5D QD JH TH TD 4S 6D 3C JC 6H 9S AS 7D 2C KH 9H 3H 5H AD 7S AH TC 9C 2H
QS 4H 4D JS 2C 3C TD 5H JD QC 8C 2D 5D 2S 6C 2H 7H 6S AC 3H 9D 4C 4S 7D 8D TH QH 5S 7C 3D 9H AS KS AD 6H 9S 8H TC KH 8S KD AH JH 3S KC QD TS 6D 7S 9C JC 5C
4S JC 3D 5D QH 9S 2D 9C TS AC 8H JD 5S 2S KD 2H TH 6D 8D 6H TC AS 3S 8S QD KH 3C 7S QC 7C QS 6S 4C 9D AH KS JS 8C 6C 2C 7D 5H 5C 3H 4H 7H JH 9H TD AD 4D KC
5D 8C AD 7C JS KS KH 2D 9C 7H 6H 7D 4D AS KC 2S JC 2C 6S AH KD 7S 9S 9H 6D 3C JD AC TC 4C 8H 4H 5C 5S QH QD 5H JH 3S TS 8D 3D QC QS TD 9D 2H 6C 3H 4S 8S TH
TC 2H AC 9D 4S 3H QH 5H 5S AD TD 7D 6H AH KS 2C 7C 8C 3D 2D 4D 3S 8S TH 9S 4H QC AS 6D 4C QS 2S 6S 6C 7S 8D TS JS KH 7H QD KC 5C JC 8H KD JH JD 3C 9H 9C 5D
4D 5H 9C 5S 5C 8C 2C 6D 8S TH 8H 7D 6H 9D TC 6S 8D 3H 2D 4C AH JD 4H 3C QD KH JH QS AC AD KC 7H KD KS 9H 3S 4S 7S JS JC 7C 6C 3D TS 5D AS 2S 2H TD QC QH 9S
2D 6C 7C QC QS 5C 3S 7D 4D 6S 4S 6D 4H 2S 8H TD 9D JD AD 2C 9S 9H TH AC KD JH QH KC TC 2H 6H 8S 3H 5H 5S JC 7H 3D 3C 7S 5D KS 4C 8D AH 9C KH QD TS JS 8C AS
Output:
Case 1: 8H
Case 2: AD
Case 3: 2H
Case 4: AH
Case 5: AS
Case 6: 3C
Case 7: 9H
Case 8: AD
Case 9: TH
Case 10: QS
Case 11: 7S
Case 12: JS
Case 13: 7H
Case 14: TD
Case 15: KS
Case 16: 4C
Case 17: 5C
Case 18: 6S
Case 19: KD
Case 20: 3H
[java][/java]

b3yours3lf
New poster
Posts: 44
Joined: Wed Aug 14, 2002 3:02 am

Post by b3yours3lf » Thu May 06, 2004 8:06 am

got AC-ed, thanks.

miras
Learning poster
Posts: 98
Joined: Sat Jun 14, 2003 1:45 pm

10646 what card is it... Small problem... plz. HeLLLLLPPPPP

Post by miras » Fri Aug 13, 2004 12:27 pm

hello i have a small prob. with this task ??
i tested it with my firend and we had same outputs but he got AC but i WA.. ;-(

[pascal]
program p10646;
var tab:array[1..52] of string;
x1,x2,x3:char;
pz,ile,iile,x,y,nm,index,a:longint;




function wart(x:longint):longint;
begin
if (tab[x][1]='A') or (tab[x][1]='T') or (tab[x][1]='Q') or (tab[x][1]='K') then
wart:=10 else wart:=ord(tab[x][1])-48;
end;




procedure read_data;
begin
read(x1,x2);
tab[1]:=x1+x2;
for a:=2 to 52 do
begin
read(x3,x1,x2);
tab[a]:=x1+x2;
end;
readln;
end;



procedure wykonaj;
begin
y:=0;
x:=0;
index:=27;
nm:=0;
repeat
inc(nm);
x:=wart(index);
y:=y+x;
DEC(INDEX);
index:=index-(10-x);
until nm=3;
if y<index then writeln(tab[y]) else writeln(tab[27+(Y-INDEX)]);
end;





BEGIN

readln(ile);
for iile:=1 to ile do

begin
Write('Case ',iile,': ');

read_data;

wykonaj;
end;



END.

[/pascal]

Do u know what is wrong here ??

plz. tell me it..
Remember Never Give Up
Regrads
Miras

htl
Experienced poster
Posts: 185
Joined: Fri Jun 28, 2002 12:05 pm
Location: Taipei, Taiwan

Post by htl » Tue Aug 31, 2004 5:44 am

I didn't read your code completely. But I can tell you that the position of the card is constant. You can figure out by simple math.

Mushfiqur Rahman
Learning poster
Posts: 56
Joined: Tue Jun 13, 2006 5:18 pm
Location: (CSE, SUST) Sylhet, Bangladesh
Contact:

I am giving some I/O for this problem.

Post by Mushfiqur Rahman » Sun Apr 22, 2007 7:57 am

Here,s some input for this problem. One can check it.

Code: Select all

52
5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D
TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS
3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D
5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S
TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH
AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD
JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS
8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D
7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H
2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D
2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H
QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD
KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS
QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS
KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD
JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD
AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH
4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D
5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H
9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S
4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H
6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C
7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C
9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D
TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC
9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C
9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H
TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD
4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S
8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C
7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D
JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH
8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H
7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S
KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH
8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S
2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C
2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S
QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH
6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D
3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H
3C KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C
KC 6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC
6S AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S
AS 5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS
5C 3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C
3S QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S
QC AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC
AC JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC
JC 4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC
4C 6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C
6H 5D TS 3D 5S TH AD JS 8D 7H 2D 2H QD KS QS KD JD AH 4D 5H 9S 4H 6C 7C 9D TC 9C 9H TD 4S 8C 7D JH 8H 7S KH 8S 2C 2S QH 6D 3H 3C KC 6S AS 5C 3S QC AC JC 4C 6H
All outputs ( produced by my Accepted code ) are same as case 1 they are 8H. So I am giving only the fist output.

Code: Select all

Case 1: 8H

Gator
New poster
Posts: 3
Joined: Wed May 29, 2013 8:28 am

Re: 10646 - What is the Card?

Post by Gator » Wed May 29, 2013 8:33 am

The output for the 20 test cases above is correct.

The output for the 52 test cases just above is not correct. My AC program does not produce 52 8H results.

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

Re: 10646 - What is the Card?

Post by brianfry713 » Thu May 30, 2013 12:11 am

My AC code agrees with Mushfiqur Rahman and prints 8H for all 52 Cases.
Check input and AC output for thousands of problems on uDebug!

AmirAz
New poster
Posts: 8
Joined: Tue May 20, 2014 12:34 pm

10646 - What is the Card?

Post by AmirAz » Wed May 28, 2014 1:04 pm

This code works fine in VS 2013, but it gets runtime error for both C++ and C++11. What's wrong?

Code: Select all

#include <cstdlib>
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <list>
#include <vector>
#include <algorithm>
#include <ctype.h>

using namespace std;

int main(void) {

	
	int T;
	std::cin >> T;
	
	for (int j = 0; j < T; j++)
	{
		string s; list<string> pile;
		for (int i = 0; i < 26; i++)
		{
			std::cin >> s;
			//std::cout << s << " ";
			pile.push_front(s);
		}
		

		int y = 0, x= 0;
		for (int i = 0; i < 3; i++){
			s = *pile.begin();
			pile.pop_front();
			x = isdigit(s[0])? s[0] - '0' : 10;
			y += x;
			for (int j = 0; j < 10 -x; j++) pile.pop_front();
		}
		
		for (int i = 0; i < 26; i++){
			std::cin >> s;
			pile.push_front(s);
		
		}
	

		list<string>::iterator itr = pile.end(); 
		for (int i = 0; i < y; i++) itr--;
		std::cout << "Case " << j + 1<< ": "<<*itr << "\n";
	}
	return 0;
}

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

Re: 10646 - What is the Card?

Post by brianfry713 » Wed Jun 11, 2014 8:21 pm

When I solved this I first read in all 52 cards.
Why are you only reading in the first 26 cards before running the game?
Check input and AC output for thousands of problems on uDebug!

sv_jan5
New poster
Posts: 1
Joined: Thu Oct 23, 2014 7:06 am

Re: 10646 - What is the Card?

Post by sv_jan5 » Thu Oct 23, 2014 7:08 am

http://ideone.com/yH8Ur6

Please help me to find problem with my solution its giving runtime error on submission but working correctly on my computer.

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

Re: 10646 - What is the Card?

Post by brianfry713 » Thu Oct 23, 2014 10:48 pm

Each case consists of 52 cards given in the order of the initial pile, from bottom to top.
The first card you should consider in the sample input is the AH, not the 2D.
Check input and AC output for thousands of problems on uDebug!

Lim.YuDe
New poster
Posts: 15
Joined: Sat Dec 13, 2014 1:32 pm

Re: 10646 - What is the Card?

Post by Lim.YuDe » Sun Dec 14, 2014 6:38 am

My code outputs all 8H, the same as the AC code of Mushfiqur Rahman and brianfry713.
My code also outputs the output given by UFP2161 for that given input.
However, I still get WA. Can anybody help me see what is going wrong here?

Edit after AC: Got AC after excluding 2 and 9. "Between 2 and 9" meant exclusive of 2 and 9. Silly me!

Code: Select all

#include <cmath>
#include <limits>
#include <cstdio>
#include <cstring>
#include <vector>
#include <iostream>
#include <sstream>
#include <algorithm>
using namespace std;

int getValue(int c) {
    c -= '0';
    if (c >= 2 && c <= 9) return c; // Edit after AC: This line was wrong. It should NOT include 2 and 9.
    else return 10;
}

The rest removed after AC


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

Re: 10646 - What is the Card?

Post by uDebug » Fri Mar 13, 2015 11:36 am

Replying to follow the thread.
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.

Joth
New poster
Posts: 11
Joined: Sat Mar 10, 2007 8:29 pm

Re: 10646 - What is the Card?

Post by Joth » Fri Apr 29, 2016 4:39 pm

there are 53 cards in that input

Post Reply

Return to “Volume 106 (10600-10699)”