diff in code

-3 Removals
+2 Additions
vector v;
vector<int> v;
for(i=0;i<n;i++){
for(i=0;i<n;i++){
cin>>x; ch+=x; v.push_back(x);
cin>>x; ch+=x; v.push_back(x);
}
}
if(ch%360==0) cout<<"YES"<<endl;
if(ch%360==0) cout<<"YES"<<endl;
else if(ch%2==0){
else if(ch%2==0){
ch/=2;
for(mask=0;mask<(1LL<<n);mask++){
for(mask=0;mask<(1LL<<n);mask++){
ans=0;
ans=0;
for(i=0;i<n;i++){
for(i=0;i<n;i++){
if(mask & (1LL<<i)){
if(mask & (1LL<<i)){
ans+=v[i];
ans+=v[i];
}
}
if(ans==ch) {
if((ch-2*ans)%360 == 0) {
cout<<"YES"<<endl;
cout<<"YES"<<endl;
return 0;
return 0;
}
}
}
}
}
}
cout<<"NO"<<endl;
cout<<"NO"<<endl;
} else {
} else {
cout<<"NO"<<endl;
cout<<"NO"<<endl;
}
}
Editor
Clear
Export as PDF