ural 1494 Monobilliards

 1 #include <cstdio>
 2 #include <cstring>
 3 #include <algorithm>
 4 using namespace std;
 5 
 6 int a[200000],b[200000];
 7 int main()
 8 {
 9     int n;
10     while(scanf("%d",&n)!=EOF)
11     {
12         for(int i=1; i<=n; i++)
13             scanf("%d",a+i);
14         int top=0,top1=1;
15         for(int i=1; i<=n; i++)
16         {
17             b[++top]=i;
18             while(top&&b[top]==a[top1]){
19                top--;top1++;
20             }
21         }
22         if(top) printf("Cheater\n");
23         else printf("Not a proof\n");
24     }
25     return 0;
26 }
View Code

 

posted @ 2014-03-17 12:33  null1019  阅读(293)  评论(0编辑  收藏  举报