Advertisement
Guest User

dalex

a guest
Jun 30th, 2011
2,306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.48 KB | None | 0 0
  1. var
  2.     a: array[1..5, 1..5] of boolean;
  3.     i, j, k, x, y, m: longint;
  4.  
  5. begin
  6.     for i := 1 to 5 do
  7.         for j := 1 to 5 do
  8.             a[i, j] := false;
  9.  
  10.     read(m);
  11.     for i := 1 to m do begin
  12.         read(x, y);
  13.         a[x, y] := true;
  14.         a[y, x] := true;
  15.     end;
  16.  
  17.     for i := 1 to 5 do
  18.         for j := 1 to i-1 do
  19.             for k := 1 to j-1 do
  20.                 if (a[i, j] and a[i, k] and a[j, k]) or (not a[i, j] and not a[i, k] and not a[j, k]) then begin
  21.                     writeln('WIN');
  22.                     halt;
  23.                 end;
  24.  
  25.     writeln('FAIL');
  26. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement