Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int n;
  4. int t[1000000];
  5. int main()
  6. {
  7. ios_base::sync_with_stdio(0);
  8. cin >> n;
  9. for (int i=1; i<=n; i++)
  10. {
  11. cin >> t[i];
  12. }
  13. sort (t, t+n);
  14. for (int i=1; i<=n-1; i++)
  15. {
  16. if (t[i]==t[i+1])
  17. {
  18. cout << "NIE";
  19. return 0;
  20. }
  21. if ((t[i]+1)!=(t[i+1]))
  22. {
  23. cout << "NIE";
  24. return 0;
  25. }
  26. }
  27. cout << "TAK";
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement