题目(From NOCOW) 暴力的枚举... { ID:asdcyt01 PROB:crypt1 LANG:PASCAL } program crypt1(input,output); var n,i,i1,i2,i3,j1,j2,tot,x,y,z,num:longint; a:set of byte; function analyze(x:longint):boolean; var y:longint; begin while x>0 do begin y:=x mod 10; x:=x div 10; if not(y in a)then exit(false); end; exit(true); end; begin assign(input,'crypt1.in');reset(input); assign(output,'crypt1.out');rewrite(output); readln(n); a:=[]; tot:=0; for i:=1 to n do begin read(num);a:=a+[num];end; for i1:=1 to 9 do if i1 in a then for i2:=1 to 9 do if i2 in a then for i3:=1 to 9 do if i3 in a then for j1:=1 to 9 do if j1 in a then for j2:=1 to 9 do if j2 in a then begin x:=j2*(i1*100+i2*10+i3); y:=j1*(i1*100+i2*10+i3); z:=x+y*10; if (x>999)or(y>999)or(z>9999)then continue; if analyze(x)and analyze(y)and analyze(z) then inc(tot); end; writeln(tot); close(input);close(output); end.