/ SB域 /

记录详情

Accepted

/usr/bin/ld.bfd: warning: /out/link.res contains output sections; did you forget -T?
# 状态 耗时 内存占用
#1 Accepted 11ms 4.125 MiB
#2 Accepted 9ms 4.219 MiB
#3 Accepted 9ms 4.203 MiB
#4 Accepted 306ms 6.539 MiB
#5 Accepted 303ms 6.652 MiB
#6 Accepted 308ms 6.879 MiB
#7 Accepted 299ms 6.488 MiB
#8 Accepted 300ms 6.605 MiB
#9 Accepted 300ms 6.656 MiB
#10 Accepted 301ms 6.613 MiB

代码

var n,k,i,j,x,y:longint;
    ch:char;
    dx,dy:array[1..10000000]of longint;
    a:array[1..1000,1..1000]of longint;
    s:ansistring;
procedure swap(var a,b:longint);
var t:longint;
begin
 t:=a; a:=b; b:=t;
end;
begin

 readln(n,k);
 for i:=1 to n do begin
  for j:=1 to n do begin
   read(a[i,j]);
   dx[i]:=i;
   dy[j]:=j;
  end;
 readln;
 end;
 for i:=1 to k do begin
  readln(s);
  ch:=s[1];
  delete(s,1,2);
  val(copy(s,1,pos(' ',s)-1),x);
  delete(s,1,pos(' ',s));
  val(s,y);
  if ch='R' then swap(dx[x],dx[y])
  else if ch='C' then swap(dy[x],dy[y])
  else if ch='A' then writeln(a[dx[x],dy[y]]);
 end;
 close(input);
 close(output);
end.

信息

递交者
类型
递交
题目
【模板】矩阵变换(操作)
题目数据
下载
语言
Pascal
递交时间
2017-08-22 14:56:33
评测时间
2017-08-22 14:56:33
评测机
分数
100
总耗时
2149ms
峰值内存
6.879 MiB