记录编号 |
109389 |
评测结果 |
AAAAAAA |
题目名称 |
方块转换 |
最终得分 |
100 |
用户昵称 |
甘罗 |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
0.000 s |
提交时间 |
2014-07-08 16:53:34 |
内存使用 |
0.14 MiB |
显示代码纯文本
program zht;
var
z,p:array[1..10] of string;
x,c,i,s,a:longint;
q,d:string;
v:char;
begin
assign(input,'transformations.in');
assign(output,'transformations.out');
reset(input);
rewrite(output);
readln(a);
for i:=1 to a*2 do
readln(z[i]);
for i:=a+1 to a*2 do
q:=q+z[i,a-1];
for i:=a+1 to a*2 do
d:=d+z[i,a];
if (q=z[2]) and (d=z[1]) then begin writeln('1');exit;end;
d:='';
q:='';
for i:=a downto 1 do
q:=q+z[a*2-1,i];
for i:=a downto 1 do
d:=d+z[a,i];
if (q=z[2]) and (d=z[1]) then begin writeln('2');exit;end;
q:='';
d:='';
for i:=a*2 downto a+1 do
q:=q+z[i,1];
for i:=a*2 to a+1 do
d:=d+z[i,4];
if (q=z[2]) and (d=z[1]) then begin writeln('3');exit;end;
q:='';
d:='';
for i:=1 to a do
if z[i]<>z[i+a] then x:=1;if x=0 then begin writeln('6');exit;end;
x:=1;
c:=a;
while x<c do
begin
for i:=1 to a do
begin
v:=z[i,c];
z[i,c]:=z[i,x];
z[i,x]:=v;
end;
x:=x+1;
c:=c-1;
end;
x:=0;
q:='';
for i:=1 to a do
if z[i]<>z[i+a] then x:=1;
if x=0 then begin writeln('4');exit;end;
for i:=a+1 to a*2 do
q:=q+z[i,a-1];
if q=z[2] then begin writeln('5');exit;end;
d:='';
q:='';
for i:=a downto 1 do
q:=q+z[a-1,i];
if q=z[a+2] then begin writeln('5');exit;end;
q:='';
for i:=a*2 downto a+1 do
q:=q+z[i,2];
if q=z[2] then begin writeln('5');exit;end;
q:='';
writeln('7');
close(input);
close(output);
end.