标签:des style blog java color strong
Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 22859 Accepted Submission(s): 6526
#include <stdio.h> int Mi[1000005]; int main() { int T; int n, maxn, mark; long long int sum; scanf("%d", &T); while(T--) { sum = 0; maxn = 0; mark = 0; scanf("%d", &n); for(int i = 1; i<=n; i++) { scanf("%d", &Mi[i]); maxn = maxn > Mi[i] ? maxn : Mi[i]; } if(n == 1 && maxn > 1) { printf("No\n"); continue; } sum = 2*maxn; for(int i = 1; i<=n; i++) { sum = sum-Mi[i]; if(sum <= 1) { mark = 1; break; } } if(mark) printf("Yes\n"); else printf("No\n"); } return 0; }
hdu 1205 吃糖果 (简单),布布扣,bubuko.com
标签:des style blog java color strong
原文地址:http://www.cnblogs.com/fengxmx/p/3862513.html