标签:
Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 30589 Accepted Submission(s):
8661
1 #include <iostream> 2 #include <cstring> 3 #include <algorithm> 4 #include <cstdio> 5 6 using namespace std; 7 8 int main() 9 { 10 int t,n; 11 scanf("%d", &t); 12 while(t--) 13 { 14 scanf("%d", &n); 15 int a; 16 long long sum = 0; 17 int MaxValue = 0; 18 for(int i = 1; i <= n; i++) 19 { 20 scanf("%d", &a); 21 sum += a; 22 MaxValue = max(MaxValue, a); 23 } 24 sum -= MaxValue; 25 if(sum >= MaxValue - 1) 26 printf("Yes\n"); 27 else 28 printf("No\n"); 29 30 } 31 32 return 0; 33 }
标签:
原文地址:http://www.cnblogs.com/zhaopAC/p/5040921.html