标签:
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 1817 Accepted Submission(s): 840
#include<stdio.h> #include<string.h> #include <iostream> using namespace std; const int N = 1000005; int a[N]; int main() { int tcase; scanf("%d",&tcase); while(tcase--){ int n; scanf("%d",&n); for(int i=1;i<=n;i++){ scanf("%d",&a[i]); } bool flag = false; for(int i=2;i<=n;i++){ if(a[i]<a[i-1]){ flag = true; break; } a[i]-=a[i-1]; a[i-1] = 0; /*for(int j=1;j<=n;j++){ printf("%d ",a[j]); } printf("\n");*/ } if(a[n]!=0) flag = true; if(flag) printf("I will never go out T_T\n"); else printf("yeah~ I escaped ^_^\n"); } return 0; }
标签:
原文地址:http://www.cnblogs.com/liyinggang/p/5617972.html