记录编号 |
322927 |
评测结果 |
AAAAAAAAAA |
题目名称 |
[NOIP 2014]生活大爆炸版石头剪刀布 |
最终得分 |
100 |
用户昵称 |
wzz |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
0.016 s |
提交时间 |
2016-10-15 19:18:33 |
内存使用 |
0.15 MiB |
显示代码纯文本
- {var
- a,b:array[0..100000]of integer;
- biao:array[0..4,0..4]of integer=
- ((0,-1,1,1,-1),
- (1,0,-1,1,-1),
- (-1,1,0,-1,1),
- (-1,-1,1,0,1),
- (1,1,-1,-1,0));
- i,k,j,m,n,c,ans1,ans2:integer;
- begin
- assign(input,'rps.in');
- assign(output,'rps.out');
- reset(input);
- rewrite(output);
-
- read(c,m,n);
- for i:=1 to m do read(a[i]);
- for i:=1 to n do read(b[i]);
-
- i:=1;
- j:=1;
- for k:=1 to c do
- begin
- if j>m then j:=1;
- if i>n then i:=1;
- if biao[a[j],b[i]]=-1 then inc(ans2);
- if biao[a[j],b[i]]=1 then inc(ans1);
- inc(j);
- inc(i);
- end;
- write(ans1,' ',ans2);
- close(input);
- close(output);
- end.}
- // 万恶的编译器 , 打表编译不了 。。。。。。。
- program p2019;
- var n,na,nb,i,j,k,fa,fb:integer;
- a,b:array[1..200]of integer;
- begin
- assign(input,'rps.in'); reset(input);
- assign(output,'rps.out'); rewrite(output);
- readln(n,na,nb);
- for i:=1 to na do read(a[i]); readln;
- for i:=1 to nb do read(b[i]); i:=1; j:=1;
- for k:=1 to n do
- begin
- if i>na then i:=1;
- if j>nb then j:=1;
- if a[i]<>b[j] then
- begin
- if a[i]=0 then
- if (b[j]=2) or (b[j]=3) then inc(fa) else inc(fb);
- if a[i]=1 then
- if (b[j]=0) or (b[j]=3) then inc(fa) else inc(fb);
- if a[i]=2 then
- if (b[j]=1) or (b[j]=4) then inc(fa) else inc(fb);
- if a[i]=3 then
- if (b[j]=2) or (b[j]=4) then inc(fa) else inc(fb);
- if a[i]=4 then
- if (b[j]=0) or (b[j]=1) then inc(fa) else inc(fb);
- end;
- inc(i); inc(j);
- end;
- write(fa,' ',fb);
- close(input); close(output);
- end.
-
-