标签:
1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 #define LL long long 5 6 const int MAX = 1000024; 7 int arr[MAX]; 8 9 int main() 10 { 11 #ifdef CDZSC_OFFLINE 12 freopen("in.txt", "r", stdin); 13 freopen("out.txt", "w", stdout); 14 #endif 15 int n, t; 16 scanf("%d", &t); 17 while(t--) 18 { 19 scanf("%d", &n); 20 LL sum = 0; 21 for(int i = 0; i < n; i++) 22 { 23 scanf("%d", &arr[i]); 24 sum += arr[i]; 25 } 26 std::sort(arr, arr + n); 27 sum -= arr[n - 1]; 28 printf("%s\n", (sum >= (arr[n - 1] - 1)) ? "Yes" : "No"); 29 } 30 return 0; 31 }
标签:
原文地址:http://www.cnblogs.com/LiuACG/p/4246948.html