hdoj-1031-Design T-Shirt
2024-09-07 02:01:15
/*
两次排序,搞定
*/
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
struct node {
int key;
double sum;
bool operator <(const node& para) const {
if (sum > para.sum )return true;
else if (sum == para.sum) {
if (key > para.key) return true;
else return false;
}else return false;
}
}arr[];
bool cmp(node a, node b) {
return a.key > b.key;
}
int main() {
int n,m ,k;
while (cin>>n>>m>>k) {
memset(arr, , sizeof(arr));
for (int i=; i<n; i++) {
for (int j=; j<m; j++) {
double tmp;
scanf("%lf", &tmp);
arr[j].sum += tmp;
arr[j].key = j;
}
}
sort(arr, arr+m);
sort(arr, arr+k, cmp);
printf("%d", arr[].key + );
for (int i=; i<k; i++) {
printf(" %d",arr[i].key + );
}
printf("\n");
}
return ;
}
最新文章
- 启动mysql服务 报1067 错误
- a标签
- ubuntu 休眠之后网络间接失败 can not connect to network after suspend (wake up)
- js init : function ()
- C语言:其他进制转换为十进制(方法二)
- 踏着前人的脚印学hadoop&mdash;&mdash;ipc中的Client
- EditText 监听回车事件 避免2次触发
- labview中的文件格式
- Codeforces Good Bye 2015 A. New Year and Days 水题
- 有用好看的CSS+JS+table 导航
- cocos2d-x 2.2 wp8 开发手记
- BZOJ 4059: [Cerc2012]Non-boring sequences ( )
- Sublime text 3编辑python时出现方框的解决办法
- Netbeans IDE 安装Emmet插件并解决Emmet插件无效果问题
- AngularJS 四大特性
- 教你如何使用云服务器去搭建SS
- win10 Xshell5连ubuntu服务器
- jquery 带农历天干地支的日期选择控件
- 【数组】Missing Number
- ubuntu14.04 忘记了登录密码和root密码