The problem is that LLD requires wa for both G ++ and C ++.
I thought I was doing something wrong. I changed it to i64d and then I got AC.
Find the most sugar, eat one, and then eat another. As long as the other sugar is less than the most sugar.
#include<cstdio>#include<cstring>#include<string>#include<queue>#include<algorithm>#include<map>#include<stack>#include<iostream>#include<list>#include<set>#include<cmath>#define INF 0x7fffffff#define eps 1e-8#define LL long long#define PI 3.141592654#define CLR(a,b) memset(a,b,sizeof(a))#define FOR(n) for(int i=0;i<n;i++)#define debug puts("==fuck==")#define acfun std::ios::sync_with_stdio(false)using namespace std;int main(){ int t; scanf("%d",&t); while(t--) { int n; scanf("%d",&n); LL maxn=0,sum=0,tmp; FOR(n) { scanf("%I64d",&tmp); sum+=tmp; maxn=max(maxn,tmp); } if(sum-maxn>=maxn-1) puts("Yes"); else puts("No"); }}
HDU 1205 eats candy