Design T-Shirt

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4370    Accepted Submission(s): 2124

Problem Description
Soon after he decided to design a T-shirt for our Algorithm Board on Free-City BBS, XKA found that he was trapped by all kinds of suggestions from everyone on the board. It is indeed a mission-impossible to have everybody perfectly satisfied. So he took a poll to collect people's opinions. Here are what he obtained: N people voted for M design elements (such as the ACM-ICPC logo, big names in computer science, well-known graphs, etc.). Everyone assigned each element a number of satisfaction. However, XKA can only put K (<=M) elements into his design. He needs you to pick for him the K elements such that the total number of satisfaction is maximized.
 
Input
The input consists of multiple test cases. For each case, the first line contains three positive integers N, M and K where N is the number of people, M is the number of design elements, and K is the number of elements XKA will put into his design. Then N lines follow, each contains M numbers. The j-th number in the i-th line represents the i-th person's satisfaction on the j-th element.
 
Output
For each test case, print in one line the indices of the K elements you would suggest XKA to take into consideration so that the total number of satisfaction is maximized. If there are more than one solutions, you must output the one with minimal indices. The indices start from 1 and must be printed in non-increasing order. There must be exactly one space between two adjacent indices, and no extra space at the end of the line.
 
Sample Input
3 6 4
2 2.5 5 1 3 4
5 1 3.5 2 2 2
1 1 1 1 1 10
3 3 2
1 2 3
2 3 1
3 1 2
 
Sample Output
6 5 3 1
2 1
 
Author
CHEN, Yue
 
Source
 
Recommend
 
几次排序就可以ac掉...没啥技术...水体
代码:
 #include<iostream>
#include<cstdio>
#include<cstring>
#include<climits>
#include<cstdlib>
#include<algorithm>
#include<vector>
using namespace std; typedef struct Nod
{
int num;
float value;
}nod;
/*二级排序*/
int cmp(nod a,nod b)
{
if(a.value==b.value)
{
return a.num<b.num; //小到大
}
else
return a.value>b.value; //降序大到小
} int Less(int a,int b)
{
return a>b; //降序大到小
}
int main()
{
int n,m,k,i;
float cnt;
while(scanf("%d %d %d",&n,&m,&k)!=EOF)
{
vector<nod>start(m);
vector<int>ans(k);
/*初始化*/
for(i=;i<m;i++)
{
scanf("%f",&start[i].value);
start[i].num=i+;
}
n--;
while(n--)
{
for(i=;i<m;i++)
{
scanf("%f",&cnt);
start[i].value+=cnt;
}
}
sort(start.begin(),start.end(),cmp);
for(i=;i<k;i++)
{
ans[i]=start[i].num;
}
sort(ans.begin(),ans.end(),Less);
printf("%d",ans[]);
for(i=;i<k;i++)
{
printf(" %d",ans[i]);
}
putchar();
}
return ;
}

HDUOJ----(1031)Design T-Shirt的更多相关文章

  1. Tcl与Design Compiler (十三)——Design Compliler中常用到的命令(示例)总结

    本文如果有错,欢迎留言更正:此外,转载请标明出处 http://www.cnblogs.com/IClearner/  ,作者:IC_learner 本文将描述在Design Compliler中常用 ...

  2. Tcl与Design Compiler (五)——综合库(时序库)和DC的设计对象

    本文如果有错,欢迎留言更正:此外,转载请标明出处 http://www.cnblogs.com/IClearner/  ,作者:IC_learner 前面一直说到综合库/工艺库这些东西,现在就来讲讲讲 ...

  3. 小学四则运算结对项目报告(GUI)

    小学四则运算结对项目报告(GUI) 一.Coding.Net项目地址: https://git.coding.net/wsshr/Calculation.git 二.PSP表格(完成前): PSP 任 ...

  4. Design Patterns Simplified - Part 2 (Singleton)【设计模式简述--第二部分(单例模式)】

    原文链接: http://www.c-sharpcorner.com/UploadFile/19b1bd/design-patterns-simplified-part-2-singleton/ De ...

  5. 自适应网页设计(Responsive Web Design)

    引用:http://www.ruanyifeng.com/blog/2012/05/responsive_web_design.html 随着3G的普及,越来越多的人使用手机上网. 移动设备正超过桌面 ...

  6. 领域模型驱动设计(Domain Driven Design)入门概述

    软件开发要干什么: 反映真实世界要自动化的业务流程 解决现实问题 领域Domain Domain特指软件关注的领域 在不能充分了解业务领域的情况下是不可能做出一个好的软件 领域建模 领域模型驱动设计 ...

  7. Scalaz(10)- Monad:就是一种函数式编程模式-a design pattern

    Monad typeclass不是一种类型,而是一种程序设计模式(design pattern),是泛函编程中最重要的编程概念,因而很多行内人把FP又称为Monadic Programming.这其中 ...

  8. 一个Activity掌握Design新控件 (转)

    原文地址:http://blog.csdn.net/lavor_zl/article/details/51295364 谷歌在推出Android5.0的同时推出了全新的设计Material Desig ...

  9. Waves:类Material Design 的圆形波浪(涟漪)点击特效插件

    Waves:类Material Design 的圆形波浪(涟漪)点击特效插件 2014/08/06 分类:前端开发, 素材分享 浏览:6,734次  来源:原创 1个评论       6,734   ...

  10. 自适应网页设计(Responsive Web Design)(转)

    随着3G的普及,越来越多的人使用手机上网. 移动设备正超过桌面设备,成为访问互联网的最常见终端.于是,网页设计师不得不面对一个难题:如何才能在不同大小的设备上呈现同样的网页? 手机的屏幕比较小,宽度通 ...

随机推荐

  1. flask_wtf/wtforms几个坑点,先简单记此

    1.@pluginquery.route('/app_include_plugins', methods=['GET','POST']) methods必须填写 2.plu_incl_app = St ...

  2. 充满未来和科幻的界面设计FUI在国内还没有起步在国外早起相当成熟

    所谓FUI可以是幻想界面(Fantasy User Interfaces).科幻界面(Fictional User Interfaces).假界面(Fake User Interfaces).未来主义 ...

  3. TPC-E在populate测试Database时需要注意的一些事项

    第一,  安装时不要使用named instance, 默认的instance就好. 否则会报连不上Database. 第二, TPC-E工具文件夹的完整路径中不可以有空格, 否则会在generate ...

  4. Git的简单介绍

    每次看到别人写Git的文章,同学中也有用Git感觉很高大上的感觉,工作中用的是SVN,周末倒腾了一下Git,Git是一款免费.开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目.Git 与 ...

  5. SQL语句大小写是否区分的问题,批量修改整个数据库所有表所有字段大小写

    一.实例介绍 SQL语句大小写到底是否区分呢?我们先从下面的这个例子来看一下: 例: --> 创建表,插入数据: declare @maco table (number int,myvalue ...

  6. 实用的表格内省略号和换行(兼容IE6)

    让连续的英文数字字符换行显示 word-break: break-all; 让单行文字超出的时候使用点点点表示 white-space: nowrap; overflow: hidden; text- ...

  7. 使用SqlServer中的float类型时发现的问题

    在做项目中,使用了float类型来定义一些列,如:Price,但是发现了很多问题1.当值的位数大于6位是float型再转varchar型的时候会变为科学技术法显示    此时只好将float型转换成n ...

  8. EF实体类的枚举属性映射设计方法

    public class FoundationInfo { [Column("id")] public int ID { get; set; } public InvestType ...

  9. 历尽折腾,终于把Unity3D 的demo发布安卓啦(问题)

    只要碰到两个比较蛋疼的问题: 1. Error generating final archive: Debug certificate expired on **** 从字面了解,是由于Debug证书 ...

  10. WdColor 枚举 (Word)

    指定要应用的 位颜色. 名称 值 说明 wdColorAqua 水绿色. wdColorAutomatic - 自动配色.默认值:通常为黑色. wdColorBlack 黑色. wdColorBlue ...