zjut1066Superman's triangle II 怎么做啊?
//这是我自己写的代码,但是一提交就是wrong answer,调试没有问题。请高手指教//网址:http://cpp.zjut.,题目ID:1066
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<string>
using namespace std;
int main()
{
int d,n;
while(cin>>n&&n!=0)
{
int i,j;
vector<int> v;
for(i=0;i<n;i++)
{
cin>>d;
v.push_back(d);
}
if(n<3)
cout<<"No"<<endl;
else{
for(i=0;i<n-3;i++)
{
sort(v.begin(),v.end());
v[i+1]=v[i]+v[i+1];
}
if(v[v.size()-1]==v[v.size()-2]&&v[v.size()-1]==v[v.size()-3])
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;}
}
return 0;
}