Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- a: array[1..5, 1..5] of boolean;
- i, j, k, x, y, m: longint;
- begin
- for i := 1 to 5 do
- for j := 1 to 5 do
- a[i, j] := false;
- read(m);
- for i := 1 to m do begin
- read(x, y);
- a[x, y] := true;
- a[y, x] := true;
- end;
- for i := 1 to 5 do
- for j := 1 to i-1 do
- for k := 1 to j-1 do
- 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
- writeln('WIN');
- halt;
- end;
- writeln('FAIL');
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement