标签:style blog http color os io strong 2014
greater<float> 从小到大
lesser<float> 总大到小
#include<queue>
#include<iostream>
using namespace std;
int main()
{ int n,m,t,x,y;
long long s;
priority_queue <int,vector<int>,greater<int> > my;
cin>>n;
while (n--)
{
s=0;
cin>>m;
while (m--)
{
cin>>t;
my.push(t);
}
while (my.size()!=1)
{
x=my.top(); my.pop();
y=my.top(); my.pop();
my.push(x+y);
s+=x+y;
}
cout<<s<<endl;
my.pop();
}
}
优先队列 priority_queue 55 nyist,布布扣,bubuko.com
标签:style blog http color os io strong 2014
原文地址:http://www.cnblogs.com/2014acm/p/3903201.html