📄 ac1255.pas
字号:
program tju1255;
const
maxn=10000;
var
s,t:array[1..maxn]of char;
last:array[char]of word;
n,i,p:longint;
begin
repeat
fillchar(last,sizeof(last),0);
readln(n);
for i:=1 to n do begin
read(t[i]);inc(last[t[i]]);
end;
readln;read(p);
for i:=1 to 255 do inc(last[chr(i)],last[chr(i-1)]);
p:=last[pred(t[p])]+1;
for i:=n downto 1 do begin
s[i]:=t[p];
p:=last[s[i]];
dec(last[s[i]]);
end;
for i:=1 to n do write(s[i]);writeln;
until seekeof;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -