fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <stack>
  4. #include <ctype.h>
  5.  
  6. int main(){
  7. std::stack<int> balls;
  8. int n, current_ball, extracted_ball;
  9. bool cheater;
  10.  
  11. std::cin >> n;
  12.  
  13. current_ball = 1;
  14. while(n){
  15. std::cin >> extracted_ball;
  16. std::cout << "inside cycle" << std::endl;
  17. while(true){
  18. balls.push(current_ball);
  19. std::cout << "while true" << std::endl;
  20. std::cout << "extracted = " << extracted_ball << std::endl;
  21. std::cout << "current = " << current_ball << std::endl;
  22. if(current_ball == extracted_ball){
  23. std::cout << "stop: " << (current_ball == extracted_ball) << std::endl;
  24. balls.pop();
  25. break;
  26. }
  27. current_ball++;
  28. if(current_ball == 50) break;
  29. }
  30. n--; //Условие остановки - просмотрели всю последовательность
  31. }
  32. if(balls.empty())
  33. std::cout << "Not a proof" << std::endl;
  34. else
  35. std::cout << "Cheater" << std::endl;
  36.  
  37. int pause;
  38. std::cin >> pause;
  39. }
Success #stdin #stdout 0s 3420KB
stdin
2 2 1
stdout
inside cycle
while true
extracted = 2
current = 1
while true
extracted = 2
current = 2
stop: 1
inside cycle
while true
extracted = 1
current = 2
while true
extracted = 1
current = 3
while true
extracted = 1
current = 4
while true
extracted = 1
current = 5
while true
extracted = 1
current = 6
while true
extracted = 1
current = 7
while true
extracted = 1
current = 8
while true
extracted = 1
current = 9
while true
extracted = 1
current = 10
while true
extracted = 1
current = 11
while true
extracted = 1
current = 12
while true
extracted = 1
current = 13
while true
extracted = 1
current = 14
while true
extracted = 1
current = 15
while true
extracted = 1
current = 16
while true
extracted = 1
current = 17
while true
extracted = 1
current = 18
while true
extracted = 1
current = 19
while true
extracted = 1
current = 20
while true
extracted = 1
current = 21
while true
extracted = 1
current = 22
while true
extracted = 1
current = 23
while true
extracted = 1
current = 24
while true
extracted = 1
current = 25
while true
extracted = 1
current = 26
while true
extracted = 1
current = 27
while true
extracted = 1
current = 28
while true
extracted = 1
current = 29
while true
extracted = 1
current = 30
while true
extracted = 1
current = 31
while true
extracted = 1
current = 32
while true
extracted = 1
current = 33
while true
extracted = 1
current = 34
while true
extracted = 1
current = 35
while true
extracted = 1
current = 36
while true
extracted = 1
current = 37
while true
extracted = 1
current = 38
while true
extracted = 1
current = 39
while true
extracted = 1
current = 40
while true
extracted = 1
current = 41
while true
extracted = 1
current = 42
while true
extracted = 1
current = 43
while true
extracted = 1
current = 44
while true
extracted = 1
current = 45
while true
extracted = 1
current = 46
while true
extracted = 1
current = 47
while true
extracted = 1
current = 48
while true
extracted = 1
current = 49
Cheater