fork download
  1. program paradox;
  2. var n, i, j, count:integer;
  3. S: array[1..325] of string;
  4. A,B,SY: array [1..325] of char;
  5. nodo : array[1..26] of integer;
  6. lettere : array[1..26,1..26] of boolean;
  7. risposta: string;
  8. ciclo : boolean;
  9.  
  10. begin
  11. readln(N);
  12. for i:=1 to N do readln(S[i]);
  13. for i:=1 to N do begin A[i]:=S[i][1]; SY[i]:=S[i][3]; B[i]:=S[i][5];end;
  14. for i:=1 to 26 do nodo[i]:=0; ciclo:=false; count:=0;
  15. for i:=1 to N do begin nodo[ord(A[i])-96]:=nodo[ord(A[i])-96]+1; nodo[ord(B[i])-96]:=nodo[ord(B[i])-96]+1; end;
  16. for i :=1 to 26 do if nodo[i]<>0 then count:=count+1;
  17. writeln (count);
  18. if N<=count+1 then ciclo:=false
  19. else ciclo:=true;
  20. if ciclo=true then risposta:=':('
  21. else risposta:=':)';
  22. writeln(risposta);
  23. end.
Success #stdin #stdout 0.01s 5324KB
stdin
5
a > f
b > c
a < d
d < c
f < b
stdout
5
:)