标签:show case bbb namespace bit clu short c++ ++
///@link http://acm.hdu.edu.cn/showproblem.php?pid=5999
///@author Sycamore
///@date Aug, 16
#include<bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int T;
cin>>T;
for(int t=1;t<=T;t++)
{
int n;
cin>>n;
vector<unsigned short>p(n);
for(auto &e:p)cin>>e;
sort(p.begin(),p.end());
int ans=0;
for(int i=n-1;i>=0;i-=3)
ans+=p[i];
for(int i=n-2;i>=0;i-=3)
ans+=p[i];
cout<<"Case #"<<t<<": "<<ans<<‘\n‘;
}
return 0;
}
HDU 5999: The Third Cup is Free
标签:show case bbb namespace bit clu short c++ ++
原文地址:http://www.cnblogs.com/zjnu/p/7376501.html