- 粘贴文本
- 2009-10-11 20:44:04 @
program p1058;
var i,j,n,k,a,b,c:integer;
na,temp:array[1..1000000] of integer;
begin
readln(n,k);
fillchar(na,sizeof(na),0);
fillchar(temp,sizeof(temp),0);
for i:=1 to n do
na[i]:=i;
for i:=1 to k do
begin
readln(a,b,c);
for j:=a to b do
temp[j]:=na[j];
for j:=b+1 to n do
na[j-(b-a+1)]:=na[j];
for j:=c to (n-(b-a+1)) do
na[j+(b-a+1)]:=na[j];
for j:=c to c+(b-a+1) do
na[j]:=temp[j-c+a];
end;
for i:=1 to 10 do
writeln(na[i]);
end.
0 条评论
目前还没有评论...