总算过了,唉……

var
n,max,i,j,x:longint;
space,ch:char;
a,b,c:array[1..9,1..9] of boolean;
f:boolean;
begin
readln(n);
for max:=1 to n do
begin
for i:=1 to 9 do
for j:=1 to 9 do
begin
a[i,j]:=false;
b[i,j]:=false;
c[i,j]:=false;
end;
f:=true;
for i:=1 to 9 do
begin
for j:=1 to 9 do
begin
read(ch);
x:=ord(ch)-ord('0');
if j<>9 then
read(space);
if f then
begin
if a[i,x] then
f:=false
else
a[i,x]:=true;
if b[j,x] then
f:=false
else
b[j,x]:=true;
if c[((i+2) div 3-1)*3+(j+2) div 3,x] then
f:=false
else
c[((i+2) div 3-1)*3+(j+2) div 3,x]:=true;
end;
end;
readln;
end;
if f then
writeln('Right')
else
writeln('Wrong');
if max<>n then readln;
end;
end.

0 条评论

目前还没有评论...

信息

ID
1335
难度
4
分类
模拟 点击显示
标签
递交数
5130
已通过
1978
通过率
39%
被复制
20
上传者