fork download
  1. #include <iostream>
  2. #include <list>
  3. #include <ctype.h>
  4.  
  5. int main(){
  6. std::list<int> balls;
  7. int n, ball, curr;
  8. bool cheater;
  9.  
  10. std::cin >> n;
  11.  
  12. while(!std::cin.eof()){
  13. std::cin >> ball;
  14. balls.push_back(ball);
  15. }
  16.  
  17. cheater = false;
  18. std::list<int>::iterator it = balls.begin();
  19. while(it != balls.end()){
  20. std::cout << *it << " ";
  21. curr = *it;
  22. if(curr >= *(++it)) cheater = true;
  23. std::cout << "curr = " << curr << ", it = " << *it << std::endl;
  24. curr = *it;
  25. //it++;
  26. }
  27.  
  28. if(cheater)
  29. std::cout << "Cheater";
  30. else
  31. std::cout << "Not a proof";
  32. }
Success #stdin #stdout 0s 3416KB
stdin
4 1 3 4 5 7
stdout
1 curr = 1, it = 3
3 curr = 3, it = 4
4 curr = 4, it = 5
5 curr = 5, it = 7
7 curr = 7, it = 1
Cheater