题解

205 条题解

  • 0
    @ 2013-08-21 14:29:04

    label 1;
    var flag,n,i,j,k,time1,time2,sum1,sum2:longint;
    a:array[1..10,1..10] of longint;
    begin
    readln(n);
    for i:=1 to n do begin
    flag:=1;
    for j:=1 to 9 do begin
    for k:=1 to 9 do read(a[j,k]);
    readln();
    end;
    if i<>n then readln();

    for j:=1 to 9 do begin
    time1:=1;
    time2:=1;
    sum1:=0;
    sum2:=0;
    for k:=1 to 9 do begin
    time1:=time1*a[j,k];
    time2:=time2*a[k,j];
    sum1:=sum1+a[j,k];
    sum2:=sum2+a[k,j];
    end;

    if (time1<>362880) or (sum1<>45) then goto 1;
    if (time2<>362880) or (sum2<>45) then goto 1;
    end;
    time1:=1;
    sum1:=0;

    for j:=1 to 3 do begin
    for k:=1 to 3 do begin
    time1:=time1*a[j,k];
    sum1:=sum1+a[j,k];
    end;
    end;
    if (time1<>362880) or (sum1<>45) then goto 1;

    time1:=1;
    sum1:=0;

    for j:=1 to 3 do begin
    for k:=4 to 6 do begin
    time1:=time1*a[j,k];
    sum1:=sum1+a[j,k];
    end;
    end;
    if (time1<>362880) or (sum1<>45) then goto 1;

    time1:=1;
    sum1:=0;

    for j:=1 to 3 do begin
    for k:=7 to 9 do begin
    time1:=time1*a[j,k];
    sum1:=sum1+a[j,k];
    end;
    end;
    if (time1<>362880) or (sum1<>45) then goto 1;

    time1:=1;
    sum1:=0;

    for j:=4 to 6 do begin
    for k:=1 to 3 do begin
    time1:=time1*a[j,k];
    sum1:=sum1+a[j,k];
    end;
    end;
    if (time1<>362880) or (sum1<>45) then goto 1;

    time1:=1;
    sum1:=0;

    for j:=4 to 6 do begin
    for k:=4 to 6 do begin
    time1:=time1*a[j,k];
    sum1:=sum1+a[j,k];
    end;
    end;
    if (time1<>362880) or (sum1<>45) then goto 1;

    time1:=1;
    sum1:=0;

    for j:=4 to 6 do begin
    for k:=7 to 9 do begin
    time1:=time1*a[j,k];
    sum1:=sum1+a[j,k];
    end;
    end;
    if (time1<>362880) or (sum1<>45) then goto 1;

    time1:=1;
    sum1:=0;

    for j:=7 to 9 do begin
    for k:=1 to 3 do begin
    time1:=time1*a[j,k];
    sum1:=sum1+a[j,k];
    end;
    end;
    if (time1<>362880) or (sum1<>45) then goto 1;

    time1:=1;
    sum1:=0;

    for j:=7 to 9 do begin
    for k:=4 to 6 do begin
    time1:=time1*a[j,k];
    sum1:=sum1+a[j,k];
    end;
    end;
    if (time1<>362880) or (sum1<>45) then goto 1;

    time1:=1;
    sum1:=0;

    for j:=7 to 9 do begin
    for k:=7 to 9 do begin
    time1:=time1*a[j,k];
    sum1:=sum1+a[j,k];
    end;
    end;
    if (time1<>362880) or (sum1<>45) then goto 1;

    time1:=1;
    sum1:=0;

    for j:=1 to 3 do begin
    for k:=1 to 3 do begin
    time1:=time1*a[j,k];
    sum1:=sum1+a[j,k];
    end;
    end;
    if (time1<>362880) or (sum1<>45) then goto 1;

    flag:=0;
    1:if flag=1 then writeln('Wrong') else writeln('Right');
    end;
    end.

  • 0
    @ 2013-08-03 18:44:27

    我先求和,但没通过。后来用集合,才通过的。
    var
    a:array[1..9,1..9]of integer;
    i,j,n,k,s,l:integer;
    b:boolean;
    t:set of 1..9;
    begin
    read(n);
    for k:=1 to n do
    begin
    b:=true;
    for i:=1 to 9 do
    for j:=1 to 9 do read(a[i,j]);
    for i:=1 to 9 do
    begin
    t:=[];
    for j:=1 to 9 do
    if not(a[i,j]in t) then t:=t+[a[i,j]]
    else b:=false;
    end;
    for j:=1 to 9 do
    begin
    t:=[];
    for i:=1 to 9 do
    if not(a[i,j]in t) then t:=t+[a[i,j]]
    else b:=false;
    end;
    for i:=1 to 3 do
    for j:=1 to 3 do
    begin
    t:=[];
    t:=t+[a[i*3-2,j*3-2]]+[a[i*3-1,j*3-2]]+[a[i*3,j*3-2]]+[a[i*3-2,j*3-1]]+[a[i*3-1,j*3-1]]+[a[i*3,j*3-1]]+[a[i*3-2,j*3]]+[a[i*3-1,j*3]]+[a[i*3,j*3]];
    s:=0;
    for l:=1 to 9 do
    if (l in t) then s:=s+1;
    if s<>9 then b:=false;
    end;
    if b then writeln('Right')
    else writeln('Wrong');
    end;
    end.

  • 0
    @ 2012-10-06 16:51:21

    30行,超时。。。

    program p1335;

    var a:array[1..9,1..9] of 1..9;

    num:array[1..27] of set of 1..9;

    n,i,j,k,p:longint;

    flag:array[1..10] of boolean;

    procedure check;

    begin

    for i:=1 to 27 do num[i]:=[1..9];

    for i:=1 to 9 do

    begin

    for j:=1 to 9 do

    begin

    read(a);

    num[i]:=num[i]-[a];

    num[9+j]:=num[9+j]-[a];

    p:=((i-1) div 3)*3+(j-1) div 3+19;

    num[p]:=num[p]-[a];

    end;

    readln;

    end;

    for i:=1 to 27 do if num[i][] then

    begin

    flag[k]:=false;

    break;

    end;

    end;

    begin

    readln(n);

    for k:=1 to n do begin flag[k]:=true;check;end;

    for k:=1 to n do if flag[k] then writeln('Right')

    else writeln('Wrong');

    end.

  • 0
    @ 2009-11-04 21:11:39

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    program p1335;

    var a,sum:array[0..9,0..9] of longint;

    v:array[0..9] of boolean;

    i,j,k,l,m,n:longint;

    function check:boolean;

    var g,t,s,l,r:longint;

    begin

    for g:=1 to 9 do begin fillchar(v,sizeof(v),false);

    for t:=1 to 9 do

    if v[a[g,t]]=true then exit(false) else v[a[g,t]]:=true;

    end;

    for g:=1 to 9 do begin fillchar(v,sizeof(v),false);

    for t:=1 to 9 do

    if v[a[t,g]]=true then exit(false) else v[a[t,g]]:=true;

    end;

    for l:=0 to 2 do

    for r:=0 to 2 do

    begin

    fillchar(v,sizeof(v),false);

    for g:=1 to 3 do

    for t:=1 to 3 do

    if v[a[l*3+g,r*3+t]] then exit(false) else v[a[l*3+g,r*3+t]]:=true;

    end;

    exit(true);

    end;

    begin

    readln(n);

    for k:=1 to n do

    begin

    for i:=1 to 9 do

    for j:=1 to 9 do read(a);

    if check then writeln('Right') else writeln('Wrong');

    end;

    end.

  • 0
    @ 2009-11-04 13:14:43

    光用和的话会导致第四个数据出错,还要判断积是不是等于362880

    var a:array[1..9,1..9] of byte;

    i,j,k,l,p:byte;

    s1,s2,s3:integer;

    sl,sh,sg:longint;

    n:integer;

    function find:boolean;

    begin

    fillchar(a,sizeof(a),0);

    s1:=0;s2:=0;

    for i:=1 to 9 do begin

    for j:=1 to 9 do

    read(a);

    readln;

    end;

    for i:=1 to 9 do begin

    s1:=0;s2:=0;sl:=1;sh:=1;

    for j:=1 to 9 do

    begin

    s1:=s1+a;

    sl:=sl*a;

    sh:=sh*a[j,i];

    s2:=s2+a[j,i];

    end;

    if (s145)or(s245)or(sl362880)or(sh362880) then begin find:=false;

    exit;

    end;

    end;

    for l:=1 to 3 do

    for p:=1 to 3 do begin s3:=0;sl:=1;

    for i:=1+(l-1)*3 to l*3 do

    for j:=1+(p-1)*3 to P*3 do

    begin s3:=s3+a;sl:=sl*a;end;

    if (s345)or(sl362880) then begin find:=false;exit;end;

    end;

    find:=true;

    end;

    begin

    readln(n);

    for k:=1 to n do begin

    if find then writeln('Right') else writeln('Wrong');

    readln;

    end;

    end.

  • 0
    @ 2009-10-27 13:15:02

    1次秒杀...

    这种情况现在对我来说貌似很少见了

    庆祝一下:

    #include

    int n;

    main()

    {

    scanf("%d",&n);

    for(;n>0;n--)

    {

    int a[9][9],i=0,j=0,flag=0;

    for(;i

  • 0
    @ 2009-10-21 16:31:45

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    var a:array [1..9,1..9] of integer;

    b,c:array [1..9] of boolean;

    i,j,k,p,q,r,s:Integer;

    n:integer;

    result:boolean;

    begin

    read(n);

    for i:=1 to n do

    begin

    fillchar(a,sizeof(a),0);

    result:=true;

    for p:=1 to 9 do

    for q:=1 to 9 do

    begin

    read(a[p,q]);

    end;

    for p:=1 to 9 do

    begin

    fillchar(b,sizeof(b),false);

    fillchar(c,sizeof(c),false);

    for q:=1 to 9 do

    begin

    if b[a[p,q]]=false then b[a[p,q]]:=true

    else begin result:=false;break;end;

    if c[a[q,p]]=false then c[a[q,p]]:=true

    else begin result:=false;break;end;

    end;

    if result=false then break;

    end;

    if result=true then

    for p:=0 to 2 do

    begin

    for q:=0 to 2 do

    begin

    fillchar(b,sizeof(b),false);

    for r:=1 to 3 do

    begin

    for s:=1 to 3 do

    if b[a[p*3+r,q*3+s]]=false then b[a[p*3+r,q*3+s]]:=true

    else begin result:=false;break;end;

    if result=false then break;

    end;

    if result=false then break;

    end;

    if result=false then break;

    end;

    if result=true then writeln('Right') else writeln('Wrong');

    end;

    end.

  • 0
    @ 2009-10-06 20:14:22

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    很简单 50+ 一次ac

  • 0
    @ 2009-10-05 18:25:11

    晕,交了两次....记住,要读完再跳出来!

    ---|---|---|---|---|---|---|---|---|---|---|-

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    const num:array[1..9]of longint=(1,2,4,8,16,32,64,128,256);

    all=511;

    var n,i,j:longint;

    function init:boolean;

    var a,i,j,k:longint;

    h,z,gong:array[1..9]of longint;

    begin

    fillchar(z,sizeof(z),0);

    fillchar(h,sizeof(h),0);

    fillchar(gong,sizeof(gong),0);

    for i:=1 to 9 do

    begin

    for j:=1 to 9 do

    begin

    read(a);

    k:=((i-1) div 3)*3+((j-1) div 3)+1;

    gong[k]:=gong[k] or num[a];

    h[i]:=h[i] or num[a];

    z[j]:=z[j] or num[a];

    end;

    readln;

    end;

    for i:=1 to 9 do

    begin

    if z[i]all then exit(false);

    if gong[i]all then exit(false);

    if h[i]all then exit(false);

    end;

    exit(true);

    end;

    begin

    readln(n);

    for i:=1 to n do

    begin

    if init then writeln('Right') else writeln('Wrong');

    readln;

    end;

    end.

  • 0
    @ 2009-09-24 11:01:44

    好水啊 一次AC

    program p1335;

    var

    n :integer;

    a :array[1..9,1..9] of integer;

    b :array[1..9] of boolean;

    m :integer;

    i,j :integer;

    flag :boolean;

    procedure make(p,q:integer);

    var s :integer;

    begin

    b[a[p,q]]:=false;

    b[a[p+1,q]]:=false;

    b[a[p+2,q]]:=false;

    b[a[p,q+1]]:=false;

    b[a[p+1,q+1]]:=false;

    b[a[p+2,q+1]]:=false;

    b[a[p,q+2]]:=false;

    b[a[p+1,q+2]]:=false;

    b[a[p+2,q+2]]:=false;

    for s:=1 to 9 do

    if b=true then flag:=true;

    end;

    begin

    readln(n);

    for m:=1 to n do

    begin

    for i:=1 to 9 do

    for j:=1 to 9 do

    read(a);

    flag:=false;

    for i:=1 to 9 do

    begin

    if flag=true then break;

    fillchar(b,sizeof(b),true);

    for j:=1 to 9 do

    begin

    b[a]:=false;

    end;

    for j:=1 to 9 do

    if b[j]=true then begin flag:=true;break;end;

    end;

    for i:=1 to 3 do

    begin

    if flag=true then break;

    for j:=1 to 3 do

    begin if flag=true then break;

    fillchar(b,sizeof(b),true);

    make(3*i-2,3*j-2);

    end;

    end;

    if flag=true then writeln('Wrong') else writeln('Right');

    end;

    end.

  • 0
    @ 2009-09-07 22:56:02

    "没有读完一个数独的数而又已经能判断其为‘WRONG’时,直接跳到第2个数独,可能产生第2个和第9个测试数据错误"

    WA了3次……

    • @ 2015-07-12 11:23:19

      反例?没搞明白

  • 0
    @ 2009-09-07 15:08:38

    他喵的.....我恨

    我交第一遍的时候过4个点,然后我用数据自己测,觉得输出没错, 仔细一看

    原来 我把 right 打成了 rignt

    不容易看出来吧.......

  • 0
    @ 2009-09-06 16:39:27

    我晕,居然就没看到前面还有一个n。

    偶的通过率啊!

    这题怎么就会多个n呢!!!!!!

    不过这样也能过个点,怪吧…………

  • 0
    @ 2009-08-31 12:10:48

    看到我的最短,发上来让大家看看思路吧

    var i,j,k,n:longint;

    cols,rows,boxs:array[0..10,0..10] of boolean; bool:boolean;

    procedure check;

    var i,j,d:longint;

    begin

    bool:=false;

    fillchar(cols,sizeof(cols),false);

    fillchar(rows,sizeof(rows),false);

    fillchar(boxs,sizeof(boxs),false);

    for i:=1 to 9 do

    begin

    for j:=1 to 9 do

    begin

    read(d);

    if (not(cols[j,d])) and (not(rows)) and (not(boxs[(((i-1) div 3)*3)+((j+2) div 3),d])) and (d0) then

    begin

    cols[j,d]:=true;

    rows:=true;

    boxs[(((i-1) div 3)*3)+((j+2) div 3),d]:=true;

    end

    else bool:=true;

    end;

    end;

    if bool then writeln('Wrong') else writeln('Right');

    end;

    begin

    readln(n);

    for i:=1 to n do

    begin

    check;

    end;

    end.

  • 0
    @ 2009-08-20 17:43:15

    var

    a,b,c:array[1..9,1..9]of boolean;

    n,i:longint;

    procedure init;

    begin

    readln(n);

    end;

    procedure main;

    var

    i,j,k,tmp:longint;

    flag:boolean;

    begin

    fillchar(a,sizeof(a),false);

    fillchar(b,sizeof(b),false);

    fillchar(c,sizeof(c),false);

    tmp:=0;

    k:=0;

    for i:=1 to 9 do

    begin

    for j:=1 to 9 do

    begin

    read(tmp);

    if (i>=1) and (i=1) and (j=4) and (j=7) and (j=4) and (i=1) and (j=4) and (j=7) and (j=7) and (i=1) and (j=4) and (j=7) and (j

  • 0
    @ 2009-08-16 17:54:28

    巨猥琐的题目 336行!整整10KB

  • 0
    @ 2009-08-07 08:43:03

    话说用集合做比较不错

    type

    dare=set of 1..9;

    var

    a:array[1..3,1..3] of dare;

    b,c:array[1..9] of dare;

    i,j,n,p,q,k,w,h:integer;

    boo1,boo2:boolean;

    begin

    readln(n);

    for h:=1 to n do

    begin

    for i:=1 to 3 do

    for j:=1 to 3 do

    a:=[];

    for i:=1 to 9 do

    begin

    b[i]:=[];

    c[i]:=[];

    end;

    for j:=1 to 9 do

    begin

    for k:=1 to 9 do

    begin

    read(w);

    b[j]:=b[j]+[w];

    c[k]:=c[k]+[w];

    if (j/3)

  • 0
    @ 2009-08-02 20:37:01

    我就140行哈~~

    不断复制程序就可以了...

    就是简单的模拟啦

  • 0
    @ 2009-07-28 14:43:15

    228行,巨繁无比。

    program p1335;

    var n,i,j,k,l,s:integer;

    t:boolean;

    a:array[1..9,1..9] of 1..9;

    b:array[1..9] of 1..9;

    begin

    read(n);

    for i:=1 to n do

    begin

    for j:=1 to 9 do

    for k:=1 to 9 do read(a[j,k]);

    t:=true;

    for j:=1 to 9 do

    begin

    for k:=1 to 8 do

    begin

    for l:=k+1 to 9 do

    if a[j,k]=a[j,l] then

    begin

    t:=false;

    writeln('Wrong');

    break;

    end;

    if not t then break;

    end;

    if not t then break;

    end;

    if not t then continue;

    t:=true;

    for k:=1 to 9 do

    begin

    for j:=1 to 8 do

    begin

    for l:=j+1 to 9 do

    if a[j,k]=a[l,k] then

    begin

    t:=false;

    writeln('Wrong');

    break;

    end;

    if not t then break;

    end;

    if not t then break;

    end;

    if not t then continue;

    s:=0;

    for j:=1 to 3 do

    for k:=1 to 3 do

    begin

    s:=s+1;

    b:=a[j,k];

    end;

    t:=true;

    for j:=1 to 8 do

    begin

    for k:=j+1 to 9 do

    if b[j]=b[k] then

    begin

    t:=false;

    writeln('Wrong');

    break;

    end;

    if not t then break;

    end;

    if not t then continue;

    s:=0;

    for j:=1 to 3 do

    for k:=4 to 6 do

    begin

    s:=s+1;

    b:=a[j,k];

    end;

    t:=true;

    for j:=1 to 8 do

    begin

    for k:=j+1 to 9 do

    if b[j]=b[k] then

    begin

    t:=false;

    writeln('Wrong');

    break;

    end;

    if not t then break;

    end;

    if not t then continue;

    s:=0;

    for j:=1 to 3 do

    for k:=7 to 9 do

    begin

    s:=s+1;

    b:=a[j,k];

    end;

    t:=true;

    for j:=1 to 8 do

    begin

    for k:=j+1 to 9 do

    if b[j]=b[k] then

    begin

    t:=false;

    writeln('Wrong');

    break;

    end;

    if not t then break;

    end;

    if not t then continue;

    s:=0;

    for j:=4 to 6 do

    for k:=1 to 3 do

    begin

    s:=s+1;

    b:=a[j,k];

    end;

    t:=true;

    for j:=1 to 8 do

    begin

    for k:=j+1 to 9 do

    if b[j]=b[k] then

    begin

    t:=false;

    writeln('Wrong');

    break;

    end;

    if not t then break;

    end;

    if not t then continue;

    s:=0;

    for j:=4 to 6 do

    for k:=4 to 6 do

    begin

    s:=s+1;

    b:=a[j,k];

    end;

    t:=true;

    for j:=1 to 8 do

    begin

    for k:=j+1 to 9 do

    if b[j]=b[k] then

    begin

    t:=false;

    writeln('Wrong');

    break;

    end;

    if not t then break;

    end;

    if not t then continue;

    s:=0;

    for j:=4 to 6 do

    for k:=7 to 9 do

    begin

    s:=s+1;

    b:=a[j,k];

    end;

    t:=true;

    for j:=1 to 8 do

    begin

    for k:=j+1 to 9 do

    if b[j]=b[k] then

    begin

    t:=false;

    writeln('Wrong');

    break;

    end;

    if not t then break;

    end;

    if not t then continue;

    s:=0;

    for j:=7 to 9 do

    for k:=1 to 3 do

    begin

    s:=s+1;

    b:=a[j,k];

    end;

    t:=true;

    for j:=1 to 8 do

    begin

    for k:=j+1 to 9 do

    if b[j]=b[k] then

    begin

    t:=false;

    writeln('Wrong');

    break;

    end;

    if not t then break;

    end;

    if not t then continue;

    s:=0;

    for j:=7 to 9 do

    for k:=4 to 6 do

    begin

    s:=s+1;

    b:=a[j,k];

    end;

    t:=true;

    for j:=1 to 8 do

    begin

    for k:=j+1 to 9 do

    if b[j]=b[k] then

    begin

    t:=false;

    writeln('Wrong');

    break;

    end;

    if not t then break;

    end;

    if not t then continue;

    s:=0;

    for j:=7 to 9 do

    for k:=7 to 9 do

    begin

    s:=s+1;

    b:=a[j,k];

    end;

    t:=true;

    for j:=1 to 8 do

    begin

    for k:=j+1 to 9 do

    if b[j]=b[k] then

    begin

    t:=false;

    writeln('Wrong');

    break;

    end;

    if not t then break;

    end;

    if not t then continue;

    writeln('Right');

    end;

    end.

  • 0
    @ 2009-07-27 14:18:28

    program das;

    var n,i1,i,j,x,y:integer;

    a:array[1..9,1..9] of integer;

    b:array[1..9] of integer;

    f1,f2,f3:boolean;

    begin

    assign(input,'p1335.in');assign(output,'p1335.out');

    reset(input);rewrite(output);

    read(n);

    for i1:=1 to n do

    begin

    for i:=1 to 9 do

    for j:=1 to 9 do read(a);

    for i:=1 to 9 do

    begin

    fillchar(b,sizeof(b),0);

    f1:=true;

    for j:=1 to 9 do if b[a]=0 then b[a]:=1

    else

    begin

    writeln('Wrong');

    f1:=false;

    break;

    end;

    if not(f1) then break;

    end;

    if f1 then

    begin

    for i:=1 to 9 do

    begin

    fillchar(b,sizeof(b),0);

    f2:=true;

    for j:=1 to 9 do if b[a[j,i]]=0 then b[a[j,i]]:=1

    else

    begin

    writeln('Wrong');

    f2:=false;

    break;

    end;

    if not(f2) then break;

    end;

    end;

    if f1 and f2 then

    begin

    fillchar(b,sizeof(b),0);

    f3:=true;

    for i:=1 to 3 do

    begin

    for j:=1 to 3 do if b[a]=0 then b[a]:=1

    else

    begin

    writeln('Wrong');

    f3:=false;

    break;

    end;

    if not(f3) then break;

    end;

    if f3 then

    begin

    fillchar(b,sizeof(b),0);

    f3:=true;

    for i:=1 to 3 do

    begin

    for j:=4 to 6 do if b[a]=0 then b[a]:=1

    else

    begin

    writeln('Wrong');

    f3:=false;

    break;

    end;

    if not(f3) then break;

    end;

    end;

    if f3 then

    begin

    fillchar(b,sizeof(b),0);

    f3:=true;

    for i:=1 to 3 do

    begin

    for j:=7 to 9 do if b[a]=0 then b[a]:=1

    else

    begin

    writeln('Wrong');

    f3:=false;

    break;

    end;

    if not(f3) then break;

    end;

    end;

    if f3 then

    begin

    fillchar(b,sizeof(b),0);

    f3:=true;

    for i:=4 to 6 do

    begin

    for j:=1 to 3 do if b[a]=0 then b[a]:=1

    else

    begin

    writeln('Wrong');

    f3:=false;

    break;

    end;

    if not(f3) then break;

    end;

    end;

    if f3 then

    begin

    fillchar(b,sizeof(b),0);

    f3:=true;

    for i:=4 to 6 do

    begin

    for j:=4 to 6 do if b[a]=0 then b[a]:=1

    else

    begin

    writeln('Wrong');

    f3:=false;

    break;

    end;

    if not(f3) then break;

    end;

    end;

    if f3 then

    begin

    fillchar(b,sizeof(b),0);

    f3:=true;

    for i:=4 to 6 do

    begin

    for j:=7 to 9 do if b[a]=0 then b[a]:=1

    else

    begin

    writeln('Wrong');

    f3:=false;

    break;

    end;

    if not(f3) then break;

    end;

    end;

    if f3 then

    begin

    fillchar(b,sizeof(b),0);

    f3:=true;

    for i:=7 to 9 do

    begin

    for j:=1 to 3 do if b[a]=0 then b[a]:=1

    else

    begin

    writeln('Wrong');

    f3:=false;

    break;

    end;

    if not(f3) then break;

    end;

    end;

    if f3 then

    begin

    fillchar(b,sizeof(b),0);

    f3:=true;

    for i:=7 to 9 do

    begin

    for j:=4 to 6 do if b[a]=0 then b[a]:=1

    else

    begin

    writeln('Wrong');

    f3:=false;

    break;

    end;

    if not(f3) then break;

    end;

    end;

    if f3 then

    begin

    fillchar(b,sizeof(b),0);

    f3:=true;

    for i:=7 to 9 do

    begin

    for j:=7 to 9 do if b[a]=0 then b[a]:=1

    else

    begin

    writeln('Wrong');

    f3:=false;

    break;

    end;

    if not(f3) then break;

    end;

    end;

    end;

    if f1 and f2 and f3 then writeln('Right');

    readln;

    end;

    close(input);close(output);

    end.

    农夫山泉

    大把的时间花在敲代码上

信息

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