记录编号 109463 评测结果 AAAAAAA
题目名称 方块转换 最终得分 100
用户昵称 GravatarFoolMike 是否通过 通过
代码语言 Pascal 运行时间 0.000 s
提交时间 2014-07-08 18:16:43 内存使用 0.17 MiB
显示代码纯文本
var
a,b,n,p:longint;
s:string;
z1,z2,z3:array[1..10,1..10]of char;
begin
assign(input,'transformations.in');
assign(output,'transformations.out');
reset(input);
rewrite(output);
readln(n);
for a:=1 to n do
begin
readln(s);
for b:=1 to n do
z1[a,b]:=s[b];
end;
for a:=1 to n do
begin
readln(s);
for b:=1 to n do
z2[a,b]:=s[b];
end;

p:=0;
for a:=1 to n do
for b:=1 to n do
if z1[a,b]<>z2[b,n-a+1]then
begin
p:=1;
break;
end;
if p=0 then
begin
writeln('1');
exit;
end;

p:=0;
for a:=1 to n do
for b:=1 to n do
if z1[a,b]<>z2[n-a+1,n-b+1]then
begin
p:=1;
break;
end;
if p=0 then
begin
writeln('2');
exit;
end;

p:=0;
for a:=1 to n do
for b:=1 to n do
if z1[a,b]<>z2[n-b+1,a]then
begin
p:=1;
break;
end;
if p=0 then
begin
writeln('3');
exit;
end;

p:=0;
for a:=1 to n do
for b:=1 to n do
if z1[a,b]<>z2[a,n-b+1]then
begin
p:=1;
break;
end;
if p=0 then
begin
writeln('4');
exit;
end;

p:=0;
for a:=1 to n do
for b:=1 to n do
z3[a,b]:=z2[a,n-b+1];
p:=0;
for a:=1 to n do
for b:=1 to n do
if z1[a,b]<>z3[b,n-a+1]then
begin
p:=1;
break;
end;
if p=0 then
begin
writeln('5');
exit;
end;
p:=0;
for a:=1 to n do
for b:=1 to n do
if z1[a,b]<>z3[n-a+1,n-b+1]then
begin
p:=1;
break;
end;
if p=0 then
begin
writeln('5');
exit;
end;
p:=0;
for a:=1 to n do
for b:=1 to n do
if z1[a,b]<>z3[n-b+1,a]then
begin
p:=1;
break;
end;
if p=0 then
begin
writeln('5');
exit;
end;



p:=0;
for a:=1 to n do
for b:=1 to n do
if z1[a,b]<>z2[a,b]then
begin
p:=1;
break;
end;
if p=0 then
begin
writeln('6');
exit;
end;

writeln('7');
close(input);close(output);
end.