标签:can pac name desc ace 否则 数据 scanf break
Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 49345 Accepted Submission(s): 13982
Problem Description
#include <cstdio> #include<math.h> #include<algorithm> using namespace std; int main() { int i,j,n,sum,max_,t; scanf("%d",&t); { while(t--) { sum=max_=0; scanf("%d",&n); int *a=(int*)malloc(sizeof(int)*n); for(i=0;i<n;i++) { scanf("%d",&a[i]); max_=max(max_,a[i]); } for(i=0;i<n;i++) { if(a[i]!=max_) sum+=a[i]; if(sum>=max_-1) break; } if(i==n) printf("No\n"); else printf("Yes\n"); } } }
标签:can pac name desc ace 否则 数据 scanf break
原文地址:https://www.cnblogs.com/fromzore/p/9792618.html