记录编号 |
80053 |
评测结果 |
AAAAAAAAAA |
题目名称 |
拱猪计分 |
最终得分 |
100 |
用户昵称 |
Alan |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
0.002 s |
提交时间 |
2013-11-06 18:28:33 |
内存使用 |
0.17 MiB |
显示代码纯文本
const
h:array[1..13]of integer=(-50,-2,-3,-4,-5,-6,-7,-8,-9,-10,-20,-30,-40);
var
b:array[1..4]of integer;
a:array[1..4,1..4,1..13]of boolean;
ch:char;
p,pp:boolean;
i,j,k,e:integer;
function see:boolean;
var
i,k,n,j,l,sum:integer;
begin
fillchar(a,sizeof(a),false);
k:=0;
for i:=1 to 4 do
begin
read(n);
sum:=0;
if n=0 then
k:=k+1
else
begin
repeat read(ch) until ch<>' ';
for j:=1 to n do
begin
read(l);
if ch='S' then
a[i,1,l]:=true
else if ch='H' then
begin
a[i,2,l]:=true;
sum:=sum+1;
end
else if ch='D' then
a[i,3,l]:=true
else
a[i,4,l]:=true;
if j<n then
repeat read(ch) until ch<>' ';
end;
if sum=13 then
begin
p:=true;
e:=i;
end;
end;
readln;
end;
if k=4 then see:=false
else see:=true;
end;
begin
assign(input,'heart.in');
assign(output,'heart.out');
reset(input);
rewrite(output);
p:=false;
while see do
begin
fillchar(b,sizeof(b),0);
if p then
begin
b[e]:=200;
if a[e,1,12] and a[e,3,11] then b[e]:=500;
if a[e,4,10] then b[e]:=b[e]*2;
if a[e,1,12] then b[e]:=b[e]-100;
if a[e,3,11] then b[e]:=b[e]+100;
for i:=1 to 4 do
if i<>e then
begin
if a[i,4,10] then
begin
if not (a[i,1,12] or a[i,3,11]) then
b[i]:=50
else
begin
if a[i,1,12] then b[i]:=-100;
if a[i,3,11] then b[i]:=b[i]+100;
b[i]:=b[i]*2;
end;
end
else
begin
if a[i,1,12] then b[i]:=-100;
if a[i,3,11] then b[i]:=b[i]+100;
end;
end;
end
else
begin
for i:=1 to 4 do
if a[i,4,10] then
begin
pp:=true;
for j:=1 to 13 do
if a[i,2,j] then
begin
b[i]:=b[i]+h[j];
pp:=false;
end;
if a[i,1,12] then begin b[i]:=b[i]-100;pp:=false;end;
if a[i,3,11] then begin b[i]:=b[i]+100;pp:=false;end;
if pp then b[i]:=50
else b[i]:=b[i]*2;
end
else
begin
for j:=1 to 13 do
if a[i,2,j] then
b[i]:=b[i]+h[j];
if a[i,1,12] then b[i]:=b[i]-100;
if a[i,3,11] then b[i]:=b[i]+100;
end;
end;
p:=false;
for i:=1 to 4 do
if b[i]>0 then write('+',b[i],' ')
else write(b[i],' ');
writeln;
end;
close(input);
close(output);
end.