比赛 NOIP水题争霸赛 评测结果 AAAAAAAAAA
题目名称 打扑克 最终得分 100
用户昵称 AHOI_Captain 运行时间 0.005 s
代码语言 Pascal 内存使用 0.07 MiB
提交时间 2018-02-11 19:16:44
显示代码纯文本
Var a:array[0..13]of longint;
i,j,m,n,x,Flag:longint;
Begin
Assign(input,'poker1.in');Reset(input);
Assign(output,'poker1.out');Rewrite(output);
	Readln(m);
	For j:=1 to m do begin
		Fillchar(a,sizeof(a),0);
		Readln(n);Flag:=0;
		For i:=1 to n do begin
			Read(x);
			If (x>=3)and(x<=13) then inc(a[x-2])
				else Inc(a[14-x]); 
		End;x:=0;
		For i:=1 to 13 do begin 
			If a[i]>4 then flag:=1;
			If (a[i]=4)and(x=0) then x:=i;
		End;
		If Flag=0 then 
		Case x of
			0:Writeln('no bomb');
			1..11:Writeln(x+2);
			12..13:Writeln(14-x);
		End
		else Writeln('cheat');
	End;
Close(input);Close(output);
End.