📄 ac1012.pas
字号:
program tju1012;
const
maxn=99;
var
code,pre,next:array[1..maxn]of word;
n,m,i,p,j:byte;
begin
repeat
read(n,m);
for i:=1 to n do begin
read(code[i]);
if i=1 then pre[i]:=n else pre[i]:=i-1;
if i=n then next[i]:=1 else next[i]:=i+1;
end;
m:=m mod n;if m=0 then m:=n;write(m);p:=m;
for i:=n-1 downto 1 do begin
m:=code[p] mod i;pre[next[p]]:=pre[p];next[pre[p]]:=next[p];p:=pre[p];
if m*2>i then
for j:=1 to i-m do p:=pre[p]
else
for j:=1 to m do p:=next[p];
write(' ',p);
end;
writeln;
until seekeof;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -