记录编号 |
80031 |
评测结果 |
WAAAAAAAAW |
题目名称 |
拱猪计分 |
最终得分 |
80 |
用户昵称 |
C语言入门 |
是否通过 |
未通过 |
代码语言 |
Pascal |
运行时间 |
0.001 s |
提交时间 |
2013-11-06 18:07:15 |
内存使用 |
0.15 MiB |
显示代码纯文本
program o;
const
hx:array [1..13] of longint=(-50,-2,-3,-4,-5,-6,-7,-8,-9,-10,-20,-30,-40);
var
f,ss,d,c,one:array [1..4] of longint;
h:array [1..4,0..13] of longint;
i,j,num,hz:longint;
pd:boolean;
s:char;
begin
assign (input,'heart.in');
assign (output,'heart.out');
reset (input);
rewrite (output);
while not eof do
begin
fillchar (ss,sizeof(ss),0);
fillchar (d,sizeof(d),0);
fillchar (h,sizeof(h),0);
fillchar (c,sizeof(c),0);
fillchar (f,sizeof(f),0);
hz:=0;
for i:=1 to 4 do
begin
read(one[i]);
while not eoln do
begin
read (s);
if (s>'A')and(s<'Z') then
begin
read(num);
if (s='S')and(num=12) then
inc(ss[i]);
if s='H' then
begin
inc(h[i,0]);
inc(h[i,num]);
inc(hz);
end;
if (s='D')and(num=11) then
inc(d[i]);
if (s='C')and(num=10) then
inc(c[i]);
end;
end;
readln;
end;
if one[1]+one[2]+one[3]+one[4]=0 then
begin
close (input);
close (output);
halt;
end;
pd:=false;
for i:=1 to 4 do
if hz=h[i,0] then
begin
pd:=true;
num:=i;
break;
end;
if pd then
begin
for i:=1 to 4 do
begin
if i=num then
begin
if h[i,0]=13 then inc(f[i],200);
if (ss[i]>0)and(d[i]>0) then inc(f[i],500);
if c[i]>0 then
begin
inc(f[i],f[i]);
if (f[i]=0)and(d[i]=0)and(ss[i]=0) then f[i]:=50;
end;
end
else
begin
for j:=1 to 13 do
if h[i,j]<>0 then
inc(f[i],hx[j]);
if ss[i]>0 then inc(f[i],-100);
if d[i]>0 then inc(f[i],100);
if c[i]>0 then
begin
inc(f[i],f[i]);
if (f[i]=0)and(d[i]=0)and(ss[i]=0) then f[i]:=50;
end;
end;
end;
end
else
begin
for i:=1 to 4 do
begin
for j:=1 to 13 do
if h[i,j]<>0 then
inc(f[i],hx[j]);
if ss[i]>0 then inc(f[i],-100);
if d[i]>0 then inc(f[i],100);
if c[i]>0 then
begin
inc(f[i],f[i]);
if (f[i]=0)and(d[i]=0)and(ss[i]=0) then f[i]:=50;
end;
end;
end;
for i:=1 to 4 do
if f[i]>0 then write ('+',f[i],' ')
else write (f[i],' ');
writeln;
end;
close (input);
close (output);
end.