Time Limit: 3000MS |
|
Memory Limit: Unknown |
|
64bit IO Format: %lld & %llu |
Submit Status
|
#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
long long sum;
int t;
int f[100000000];
struct node
{
int zg;
int id;
};
node a[8000010];
int cmp(node x,node y)
{
return x.zg>y.zg;
}
int main()
{
while(cin>>t)
{
long long sum=0;
for(int i=0; i<t; i++)
{
cin>>a[i].zg;
a[i].id=i;
f[i]=-1;
sum+=a[i].zg;
}
if(sum%2||t==1) cout<<"No"<<endl;
else
{
cout<<"Yes"<<endl;
sort(a,a+t,cmp);
int s=0;
for(int i=0; i<t; i++)
{
if(s+a[i].zg<=sum/2)
{
s+=a[i].zg;
f[a[i].id]=1;
if(s==sum/2)
break;
}
}
cout<<f[0];
for(int i=1; i<t; i++)
{
cout<<' '<<f[i];
}
cout<<endl;
}
}
return 0;
}