比赛 20110928 评测结果 C
题目名称 拱猪计分 最终得分 0
用户昵称 feng 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2011-09-28 20:23:48
显示代码纯文本
program olx;
const
  filename='heart';
  inf=filename+'.in';
  ouf=filename+'.out';
  maxn=16;
var
  i,j,k,l,m,n,sum,s:longint;
  a:array[1..4,0..maxn]of boolean;
  v:array[1..13]of longint=(-50,-2,-3,-4,-5,-6,-7,-8,-9,-10,-20,-30,-40);
  f:array[1..4]of longint;
  q,t:boolean;
  ch,ch1:char;
begin
  assign(input,inf); reset(input);
  assign(output,ouf);rewrite(output);
  t:=false;
  while not(eof) do
    begin
      fillchar(a,sizeof(a),false);
      if t then begin
        for j:=1 to 4 do
          write(f[j],' ');
        writeln; end;

      for i:=1 to 4 do
        begin
          read(n);
          read(ch);
          for j:=1 to n do
            begin
              read(ch);
              ch1:=ch;
              s:=0;
              repeat
                read(ch);
                if ch in ['0'..'9'] then
                s:=s*10+ord(ch)-ord('0');
              until not(ch in ['0'..'9']);
              if ch1='H' then  a[i,s]:=true
                else if (ch1='C')and(s=10) then a[i,14]:=true
                  else if (ch1='D')and(s=11) then a[i,15]:=true
                    else if (ch1='S')and(s=12) then a[i,16]:=true;
            end;
          readln;
          q:=true;
          sum:=0;
          for j:=1 to 13 do
            begin
              if not(a[i,j]) then q:=false;
              if a[i,j] then sum:=sum+v[j];
            end;
          if q then
            begin
              sum:=200;
              if (a[i,15])and(a[i,16]) then sum:=500
              else if a[i,15] then sum:=sum+100
              else if a[i,16] then sum:=sum-100;
            end
            else begin
                   if a[i,15] then sum:=sum+100;
                   if a[i,16] then sum:=sum-100;
                 end;
          if a[i,14] then sum:=sum*2;
          f[i]:=sum;
        end;
        t:=true;
    end;





  close(input);close(output);
end.