比赛 20110928 评测结果 C
题目名称 拱猪计分 最终得分 0
用户昵称 feng 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2011-09-28 20:23:48
显示代码纯文本
  1. program olx;
  2. const
  3. filename='heart';
  4. inf=filename+'.in';
  5. ouf=filename+'.out';
  6. maxn=16;
  7. var
  8. i,j,k,l,m,n,sum,s:longint;
  9. a:array[1..4,0..maxn]of boolean;
  10. v:array[1..13]of longint=(-50,-2,-3,-4,-5,-6,-7,-8,-9,-10,-20,-30,-40);
  11. f:array[1..4]of longint;
  12. q,t:boolean;
  13. ch,ch1:char;
  14. begin
  15. assign(input,inf); reset(input);
  16. assign(output,ouf);rewrite(output);
  17. t:=false;
  18. while not(eof) do
  19. begin
  20. fillchar(a,sizeof(a),false);
  21. if t then begin
  22. for j:=1 to 4 do
  23. write(f[j],' ');
  24. writeln; end;
  25.  
  26. for i:=1 to 4 do
  27. begin
  28. read(n);
  29. read(ch);
  30. for j:=1 to n do
  31. begin
  32. read(ch);
  33. ch1:=ch;
  34. s:=0;
  35. repeat
  36. read(ch);
  37. if ch in ['0'..'9'] then
  38. s:=s*10+ord(ch)-ord('0');
  39. until not(ch in ['0'..'9']);
  40. if ch1='H' then a[i,s]:=true
  41. else if (ch1='C')and(s=10) then a[i,14]:=true
  42. else if (ch1='D')and(s=11) then a[i,15]:=true
  43. else if (ch1='S')and(s=12) then a[i,16]:=true;
  44. end;
  45. readln;
  46. q:=true;
  47. sum:=0;
  48. for j:=1 to 13 do
  49. begin
  50. if not(a[i,j]) then q:=false;
  51. if a[i,j] then sum:=sum+v[j];
  52. end;
  53. if q then
  54. begin
  55. sum:=200;
  56. if (a[i,15])and(a[i,16]) then sum:=500
  57. else if a[i,15] then sum:=sum+100
  58. else if a[i,16] then sum:=sum-100;
  59. end
  60. else begin
  61. if a[i,15] then sum:=sum+100;
  62. if a[i,16] then sum:=sum-100;
  63. end;
  64. if a[i,14] then sum:=sum*2;
  65. f[i]:=sum;
  66. end;
  67. t:=true;
  68. end;
  69.  
  70.  
  71.  
  72.  
  73.  
  74. close(input);close(output);
  75. end.