记录编号 322927 评测结果 AAAAAAAAAA
题目名称 [NOIP 2014]生活大爆炸版石头剪刀布 最终得分 100
用户昵称 Gravatarwzz 是否通过 通过
代码语言 Pascal 运行时间 0.016 s
提交时间 2016-10-15 19:18:33 内存使用 0.15 MiB
显示代码纯文本
  1. {var
  2. a,b:array[0..100000]of integer;
  3. biao:array[0..4,0..4]of integer=
  4. ((0,-1,1,1,-1),
  5. (1,0,-1,1,-1),
  6. (-1,1,0,-1,1),
  7. (-1,-1,1,0,1),
  8. (1,1,-1,-1,0));
  9. i,k,j,m,n,c,ans1,ans2:integer;
  10. begin
  11. assign(input,'rps.in');
  12. assign(output,'rps.out');
  13. reset(input);
  14. rewrite(output);
  15.  
  16. read(c,m,n);
  17. for i:=1 to m do read(a[i]);
  18. for i:=1 to n do read(b[i]);
  19.  
  20. i:=1;
  21. j:=1;
  22. for k:=1 to c do
  23. begin
  24. if j>m then j:=1;
  25. if i>n then i:=1;
  26. if biao[a[j],b[i]]=-1 then inc(ans2);
  27. if biao[a[j],b[i]]=1 then inc(ans1);
  28. inc(j);
  29. inc(i);
  30. end;
  31. write(ans1,' ',ans2);
  32. close(input);
  33. close(output);
  34. end.}
  35. // 万恶的编译器 , 打表编译不了 。。。。。。。
  36. program p2019;
  37. var n,na,nb,i,j,k,fa,fb:integer;
  38. a,b:array[1..200]of integer;
  39. begin
  40. assign(input,'rps.in'); reset(input);
  41. assign(output,'rps.out'); rewrite(output);
  42. readln(n,na,nb);
  43. for i:=1 to na do read(a[i]); readln;
  44. for i:=1 to nb do read(b[i]); i:=1; j:=1;
  45. for k:=1 to n do
  46. begin
  47. if i>na then i:=1;
  48. if j>nb then j:=1;
  49. if a[i]<>b[j] then
  50. begin
  51. if a[i]=0 then
  52. if (b[j]=2) or (b[j]=3) then inc(fa) else inc(fb);
  53. if a[i]=1 then
  54. if (b[j]=0) or (b[j]=3) then inc(fa) else inc(fb);
  55. if a[i]=2 then
  56. if (b[j]=1) or (b[j]=4) then inc(fa) else inc(fb);
  57. if a[i]=3 then
  58. if (b[j]=2) or (b[j]=4) then inc(fa) else inc(fb);
  59. if a[i]=4 then
  60. if (b[j]=0) or (b[j]=1) then inc(fa) else inc(fb);
  61. end;
  62. inc(i); inc(j);
  63. end;
  64. write(fa,' ',fb);
  65. close(input); close(output);
  66. end.
  67.  
  68.