Advertisement
Guest User

Untitled

a guest
May 28th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. #ifndef ONLINE_JUDGE
  10. freopen("input.txt", "r", stdin);
  11. freopen("output.txt", "w", stdout);
  12. #endif
  13. int n;
  14. vector<int> now;
  15. now.push_back(1);
  16. int last = 1;
  17. cin >> n;
  18. for(int i = 0; i < n; i++)
  19. {
  20. int buf;
  21. cin >> buf;
  22. if(!now.empty() && (now.back() > buf))
  23. {
  24. cout << "Cheater";
  25. return 0;
  26. }
  27. while(now.empty() || (now.back() != buf))
  28. {
  29. now.push_back(last + 1);
  30. last++;
  31. }
  32. if(now.back() == buf)
  33. now.pop_back();
  34. }
  35. cout << "Not a proof";
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement