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

Discussion of Problem 1433. Diamonds

Ignat Zakrevsky Why WA 12? Help! [1] // Problem 1433. Diamonds 19 Nov 2007 16:00
Var a,b:array [0..3] of string;
c,d:string[4];
N,I,J:LongInt;
P:Boolean;
Begin
Readln(C);
Readln(D);
P:=FALSE;
A[0]:=C[1];A[1]:=C[2];A[2]:=C[3];A[3]:=C[4];
B[0]:=D[1];B[1]:=D[2];B[2]:=D[3];B[3]:=D[4];

If A[0]=B[0] Then
  If ((A[1]=B[1]) and (A[2]=B[2]) and (A[3]=B[3])) or
     ((A[1]=B[3]) and (A[2]=B[1]) and (A[3]=B[2])) or
     ((A[1]=B[2]) and (A[2]=B[3]) and (A[3]=B[1]))
        Then P:=True;

If A[0]=B[2] Then
  If ((A[1]=B[1]) and (A[2]=B[3]) and (A[3]=B[0])) or
     ((A[1]=B[3]) and (A[2]=B[0]) and (A[3]=B[1])) or
     ((A[1]=B[0]) and (A[2]=B[1]) and (A[3]=B[3]))
        Then P:=True;

If A[0]=B[3] Then
  If ((A[1]=B[1]) and (A[2]=B[0]) and (A[3]=B[2])) or
     ((A[1]=B[2]) and (A[2]=B[1]) and (A[3]=B[0])) or
     ((A[1]=B[0]) and (A[2]=B[2]) and (A[3]=B[1]))
        Then P:=True;

If P=True Then Writeln('equal')
          Else Writeln('different');
End.



Say me why this program not work?

Edited by author 01.12.2007 21:32

Edited by author 01.12.2007 21:33
Kaki Re: Why WA 12? Help! // Problem 1433. Diamonds 15 Dec 2012 00:14
What if A[0] = B[1]?