记录编号 |
78083 |
评测结果 |
AAAAAAA |
题目名称 |
方块转换 |
最终得分 |
100 |
用户昵称 |
铁策 |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
0.007 s |
提交时间 |
2013-11-03 10:23:09 |
内存使用 |
0.14 MiB |
显示代码纯文本
program P666;
type
f=array[1..10,1..10] of char;
var
a,b,c,d:f;
i,j,k,n:longint;
function xd2:boolean;
var i,j:longint;
begin
for i:=1 to n do
for j:=1 to n do if d[i,j]<>c[i,j] then exit(false);
exit(true);
end;
function xd:boolean;
var i,j:longint;
begin
for i:=1 to n do
for j:=1 to n do if b[i,j]<>c[i,j] then exit(false);
exit(true);
end;
procedure p1;
var i,j:integer;
begin
for i:=1 to n do
for j:=1 to n do
b[j,n-i+1]:=a[i,j];
end;
procedure p2;
var i,j:integer;
begin
for i:=1 to n do
for j:=1 to n do
b[n-i+1,n-j+1]:=a[i,j];
end;
procedure p3;
var i,j:integer;
begin
for i:=1 to n do
for j:=1 to n do
b[n-j+1,i]:=a[i,j];
end;
begin
assign(input,'transformations.in');
reset(input);
assign(output,'transformations.out');
rewrite(output);
readln(n);
for i:=1 to n do
begin
for j:=1 to n do read(a[i,j]);
readln;
end;
for i:=1 to n do
begin
for j:=1 to n do read(c[i,j]);
readln;
end;
b:=a;
d:=a;
p1;
if xd then begin writeln(1); halt; end;
p2;
if xd then begin writeln(2); halt; end;
p3;
if xd then begin writeln(3); halt; end;
for i:=1 to n do
for j:=1 to n do
b[i,n-j+1]:=a[i,j];
a:=b;
if xd then begin writeln(4); halt; end;
p1;
if xd then begin writeln(5); halt; end;
p2;
if xd then begin writeln(5); halt; end;
p3;
if xd then begin writeln(5); halt; end;
if xd2 then writeln(6)else writeln(7);
end.