| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
郁闷了!!! 怎么到现在还是Presentation Error我用的是在另一个题库上类似的题目的AC程序(vijos 1049)来做的 可是总是Presentation Error 实在想不通
有没有那位大牛帮一下忙 谢谢了
var a:array[0..100,1..9,1..200]of integer;
st,st0:string;a00,a0,a1:array[1..200]of integer;
i,j,x,l,m,n:integer;k:longint;c:char;
procedure zd;
begin
for i:=1 to l-1 do begin
for j:=2 to m-1 do begin
for x:=1 to n do
a[i,j,x]:=a[i,j-1,a[i,1,x]];
end;
if i<l-1 then
for x:=1 to n do begin
a[i+1,1,x]:=a[i,m-1,a[i,1,x]];
end;
end;
end;
procedure chu(k:longint);
begin
st:='';
while k<>0 do begin
st:=st+chr((k mod m)+48);
k:=k div m;
end;
end;
begin
readln(n);
while n<>0 do begin
fillchar(a0,sizeof(a0),0);
for i:=1 to n do begin
read(a00[i]);
a[0,1,a00[i]]:=i;
end;
a0:=a[0,1];
m:=2;
for j:=1 to n do begin
a[1,1,j]:=a0[a[0,1,j]];
end;
read(k);
while k<>0 do begin
read(c);
readln(st0);
if length(st0)<n then begin
for j:=length(st0)+1 to n do
st0:=st0+' ';
end;
chu(k);
l:=length(st);
zd;
for j:=1 to n do a1[j]:=j;
for i:=l-1 downto 0 do begin
if st[i+1]<>'0' then begin
x:=ord(st[i+1])-48;
for j:=1 to n do
a0[j]:=a1[a[i,x,j]];
a1:=a0;
end;
end;
st:='';
for j:=1 to n do
st:=st+st0[a0[j]];
l:=length(st);
while st[l]=' ' do
begin st:=copy(st,1,l-1);l:=l-1;end;
writeln(st);
read(k);
end;
readln(n);
end;
end.
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator