program ddd;
var
n,m,i,j,u,t,rt,bn:longint;
s,q:array[0..255]of boolean;
a,yu:array[1..200]of integer;
procedure pro(l1,l:integer);
var i,j,r,w:longint;
k:string;
begin
str(l,k);
w:=0;
for i:= 1 to length(k) do
begin
t:=ord(k[i])-ord(0);
r:=t;
for j:= 1to l1 do
r:=r*t;
w:=r+w;
{write(w, );}
if w>255 then
exit;
end;
inc(bn);
yu[bn]:=w;
end;
begin
readln(n);
m:=0;
fillchar(s,sizeof(s),false);
u:=0;
{fillchar(q,sizeof(q),false);}
while not eoln do
begin
inc(m);
read(a[m]);
s[a[m]]:=true;
end;
for i:= 1to n do
begin
bn:=0;
for j:= 1to m do
if s[a[j]] then
pro(i,a[j]);
for rt:= 1to bn do
begin
s[yu[rt]]:=false;
end;
end;
{for i:= 1 to m do
if s[a[i]] then
q[a[i]]:=true;}
for i:= 0to 255 do
if s[i] then
begin
inc(u);
if u=1 then write(i)
else
write( ,i);
end;
end.
我只有90分
测试结果错误.错误结果为:14 15 20 31 32 33 34 45 52 60 61 62 99 100 106 110 111 112 125 128 136 141 221 232
正确结果应为: 14 15 20 31 32 33 34 45 52 60 61 62 99 100 106 110 111 112 125 125 128 136 141 221 232