savrasov

Untitled

Jan 20th, 2017
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. program Project2;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. uses
  6. SysUtils;
  7.  
  8. var
  9. a: array [1..100000] of integer;
  10. i, j, n, m, f, max: integer;
  11.  
  12. function mx(a, b: integer): integer;
  13. begin
  14. if(a > b)then mx := a
  15. else mx := b;
  16. end;
  17.  
  18. begin
  19. readln(n);
  20. for i := 1 to n do
  21. begin
  22. for j := 1 to 10000 do a[j] := 0;
  23. max := 0;
  24. readln(m);
  25. for j := 1 to m do
  26. begin
  27. read(f);
  28. inc(a[j]);
  29. inc(a[f]);
  30. max := mx(max, a[j]);
  31. max := mx(max, a[f]);
  32. end;
  33. writeln(max);
  34. end;
  35. end.
Add Comment
Please, Sign In to add comment