HDU-1031(水题)
Design T-Shirt
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
using namespace std;
#define INF 100000
typedef long long ll;
const int maxn=;
struct object{
double v;
int id;
}a[maxn];
bool cmp1(object a,object b){
if(a.v!=b.v) return a.v>b.v;
else return a.id<b.id;
}
bool cmp2(object a,object b){
return a.id>b.id;
}
int main()
{
int n,m,k;
while(scanf("%d%d%d",&n,&m,&k)==){
for(int i=;i<m;i++) a[i].v=;
while(n--){
double tmp;
for(int i=;i<m;i++){
scanf("%lf",&tmp);
a[i].v+=tmp;
a[i].id=i+;
}
}
sort(a,a+m,cmp1);
sort(a,a+k,cmp2);
for(int i=;i<k-;i++)
printf("%d ",a[i].id);
printf("%d\n",a[k-].id);
}
return ;
}
HDU-1031(水题)的更多相关文章
- HDU-1042-N!(Java大法好 && HDU大数水题)
N! Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Subm ...
- HDU 5391 水题。
E - 5 Time Limit:1500MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Statu ...
- hdu 1544 水题
水题 /* * Author : ben */ #include <cstdio> #include <cstdlib> #include <cstring> #i ...
- HDU排序水题
1040水题; These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fa ...
- hdu 2710 水题
题意:判断一些数里有最大因子的数 水题,省赛即将临近,高效的代码风格需要养成,为了简化代码,以后可能会更多的使用宏定义,但是通常也只是快速拿下第一道水题,涨自信.大部分的代码还是普通的形式,实际上能简 ...
- Dijkstra算法---HDU 2544 水题(模板)
/* 对于只会弗洛伊德的我,迪杰斯特拉有点不是很理解,后来发现这主要用于单源最短路,稍稍明白了点,不过还是很菜,这里只是用了邻接矩阵 套模板,对于邻接表暂时还,,,没做题,后续再更新.现将这题贴上,应 ...
- hdu 5162(水题)
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5162 题解:看了半天以为测试用例写错了.这题玩文字游戏.它问的是当前第i名是原数组中的第几个. #i ...
- hdu 3357 水题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3357 #include <cstdio> #include <cmath> # ...
- hdu 5038 水题 可是题意坑
http://acm.hdu.edu.cn/showproblem.php?pid=5038 就是求个众数 这个范围小 所以一个数组存是否存在的状态即可了 可是这句话真恶心 If not all ...
- hdu 5138(水题)
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5138 反着来. #include<iostream> #include<cstdi ...
随机推荐
- 巧架个人BT服务器
BT的流行比之当年的江湖,传奇等的流行有过之而无不及.现在我们常说的话题是:“今天你BT了吗?”哇K!兄弟们你们怎么吐了?!假如你还不知道BT是什么,那似乎证明你已经到了归隐Internet的时候了, ...
- DataGrid能否动态合并一笔订单下面的多个交易
/** * author ____′↘夏悸 * create date 2012-11-5 **/ $.extend($.fn.datagrid.methods, { autoMergeCells : ...
- VS2010中的调试技巧
作者: scottgu 这是我的博客中关于VS 2010和.NET 4发布系列的第二十六篇文章. 今天的博文将介绍Visual Studio中的一些实用调试技巧.这是受我朋友Scott Cate (他 ...
- C# 线程知识--使用ThreadPool执行异步操作
C# 线程知识--使用ThreadPool执行异步操作 在应用程序中有许多复杂的任务,对于这些任务可能需要使用一个或多个工作线程或I/O线程来协作处理,比如:定时任务.数据库数据操作.web服务.文件 ...
- zabbix2.2.2-hostgroups.php代码分析(1)
想模仿hostgroups.php仿写一个主机组页面.直接从页面展示开始分析. if (isset($_REQUEST['form'])) { //这里面是点击创建主机组的页面展示 }else{ // ...
- JSP---JSP中4个容器-pageContext使用
这里重点只讲pageContext容器的用法哦. 因为另外的3个容器(request,session,application)在前面的servlet中已经演示过很多遍了 容器 作用域 pageCont ...
- sqlplus中常用设置参数
一.各种设置参数解释 转自http://baike.baidu.com/view/1239908.htm Sql*plus是一个最常用的工具,具有很强的功能,主要有: 1. 数据库的维护,如启动,关闭 ...
- bzoj 1030 [JSOI2007]文本生成器(AC自动机+DP)
[题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=1030 [题意] 给n个小串,随机构造一个长为m的大串,一个串合法当且仅当包含一个或多个 ...
- HW5.10
public class Solution { public static void main(String[] args) { int count = 0; for(int i = 1; i < ...
- SSDT – Error SQL70001 This statement is not recognized in this context-摘自网络
March 28, 2013 — arcanecode One of the most common errors I get asked about when using SQL Server Da ...