ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

Why 1433 wa at case 24??I enumerate all the diamonds as 4 faces
Posted by Xiao Kan @ Liuyang 1st Senior School 25 Sep 2006 06:04
var

        a,b,c        :       array[1..4] of longint;
        i,t          :       longint;
        s            :       string;

procedure ok;
var
        dd       :       longint;
begin
  for dd:=1 to 4 do
    if a[dd]<>b[dd] then exit;
  writeln('equal');
  halt;
end;

procedure rotate;
begin
  for i:=1 to 2 do
    begin
      t:=a[2];
      a[2]:=a[3];
      a[3]:=a[4];
      a[4]:=t;
      ok;
    end;
end;

begin
  fillchar(a,sizeof(a),0);
  fillchar(b,sizeof(b),0);
  readln(s);
  for i:=1 to 4 do
    case s[i] of
      'R' : a[i]:=1;
      'G' : a[i]:=2;
      'B' : a[i]:=3;
      'Y' : a[i]:=4;
    end;
  readln(s);
  for i:=1 to 4 do
    case s[i] of
      'R' : b[i]:=1;
      'G' : b[i]:=2;
      'B' : b[i]:=3;
      'Y' : b[i]:=4;
    end;

  ok;
  c:=a;
  t:=a[1];
  a[1]:=a[2];
  a[2]:=a[4];
  a[4]:=t;
  ok;
  rotate;


  a:=c;
  t:=a[1];
  a[1]:=a[4];
  a[4]:=t;
  t:=a[2];
  a[2]:=a[3];
  a[3]:=t;
  ok;
  rotate;

  a:=c;
  t:=a[1];
  a[1]:=a[3];
  a[3]:=a[4];
  a[4]:=t;
  ok;
  rotate;
  writeln('different');

end.