Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- #include <vector>
- using namespace std;
- int main()
- {
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- #endif
- int n;
- vector<int> now;
- now.push_back(1);
- int last = 1;
- cin >> n;
- for(int i = 0; i < n; i++)
- {
- int buf;
- cin >> buf;
- if(!now.empty() && (now.back() > buf))
- {
- cout << "Cheater";
- return 0;
- }
- while(now.empty() || (now.back() != buf))
- {
- now.push_back(last + 1);
- last++;
- }
- if(now.back() == buf)
- now.pop_back();
- }
- cout << "Not a proof";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement