HDU
来源:互联网 发布:php 微信拍卖系统源码 编辑:程序博客网 时间:2024/06/09 20:27
#include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <string>#include <cmath>#include <set>#include <map>#include <stack>#include <queue>#include <ctype.h>#include <vector>#include <algorithm>#include <sstream>#define PI acos(-1.0)#define in freopen("in.txt", "r", stdin)#define out freopen("out.txt", "w", stdout)using namespace std;const int maxn = 100000 + 7;int T, n;int a[maxn];bool cmp(int a, int b) { return a > b;}int main() { scanf("%d", &T); int kase = 1; while(T--) { scanf("%d", &n); int sum = 0; for(int i = 1; i <= n; ++i) { scanf("%d", &a[i]); sum += a[i]; } sort(a+1, a+n+1, cmp); for(int i = 1; i <= n; ++i) { if(i % 3 == 0) sum -= a[i]; } printf("Case #%d: %d\n", kase++, sum); //cout << sum << endl; } return 0;}
阅读全文
1 0
- hdu
- hdu
- HDU
- hdu ()
- hdu
- hdu
- HDU
- HDU
- hdu
- hdu
- HDU
- Hdu
- hdu
- hdu-
- hdu
- hdu
- hdu
- HDU
- HashSet vs. TreeSet vs. LinkedHashSet
- IOS 设置按钮的的图片和标题位置
- Tomcat与Servlet入门
- Java中的equals()和hashCode()契约
- 欢迎使用CSDN-markdown编辑器
- HDU
- 数学建模中的ARMA模型和ARIMA模型的使用实例(含代码)
- Presto单机/集群模式安装笔记
- 列表和元组
- The Moving Points HDU
- ArrayList vs. LinkedList vs. Vector
- 课程笔记之六:神经网络的代价函数和误差反向传播算法
- HDU
- 组装台式机流程