namespace{
const int lim=2e5+2;
int T,n,a[lim],cur;
ll s=0;
priority_queue<ll> q;
void work(){
T=read();
while(T--){
n=read();s=0;cur=n;
F(i,1,<=n) a[i]=read(),s+=a[i];
sort(a+1,a+n+1);
q.push(s);
while(!q.empty()){
Ll x=q.top();q.pop();
if(a[cur]==x){
--cur;
}else if(x>1){
q.push((x+1)/2);
q.push(x/2);
}
}
if(cur) puts("NO");
else puts("YES");
}
}
}
然后 TLE+MLE 了,不知道为什么,痛失上青好机会/kk