记录编号 |
265691 |
评测结果 |
AAAAAAA |
题目名称 |
牛式 |
最终得分 |
100 |
用户昵称 |
ConanQZ |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
0.003 s |
提交时间 |
2016-06-03 20:36:19 |
内存使用 |
0.17 MiB |
显示代码纯文本
- program P1112;
- var
- n,a1,a2,a3,b1,b2,ans,i:longint;
- a:array[1..10]of longint;
- p:array[0..10]of boolean;
-
- function check(x,v:longint):boolean;
- begin
- if ((x>=10000)and(v=2))or((x>=1000)and(v=1)) then exit(false);
- while x<>0 do
- if p[x mod 10] then x:=x div 10 else exit(false);
- exit(true);
- end;
-
- function cow(a1,b1,c1,a2,b2:integer):boolean;
- var
- x:longint;
- begin
- x:=a1*100+b1*10+c1;
- if (check(x*a2,1))and(check(x*b2,1)) then
- begin
- if check(x*(a2*10+b2),2) then exit(true) else exit(false);
- end else exit(false);
- end;
-
- begin
- //assign(input,'11.in'); reset(input);
- assign(input,'crypt1.in'); reset(input);
- assign(output,'crypt1.out'); rewrite(output);
- readln(n);
- for i:=1 to n do begin read(a[i]); p[a[i]]:=true; end;
- for a1:=1 to n do
- for a2:=1 to n do
- for a3:=1 to n do
- for b1:=1 to n do
- for b2:=1 to n do
- if cow(a[a1],a[a2],a[a3],a[b1],a[b2]) then inc(ans);
- writeln(ans);
- end.