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 }