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 ...
随机推荐
- DedeCMS 5.7 config.php 跨站脚本漏洞
漏洞版本: DedeCMS 5.7 漏洞描述: DeDeCMS v5.7 在/include/dialog/config.php文件中存在XSS漏洞,攻击者可以利用该漏洞盗取用户Cookie.挂马等. ...
- Linux Kernel ‘/net/socket.c’本地信息泄露漏洞
漏洞名称: Linux Kernel ‘/net/socket.c’本地信息泄露漏洞 CNNVD编号: CNNVD-201312-037 发布时间: 2013-12-04 更新时间: 2013-12- ...
- grb文件的读取
grb文件的读取(转自:http://blog.sciencenet.cn/blog-922140-713837.html) read_grib.r4.rar 今天来斟酌了下grb文件格式的读取,现在 ...
- 结合Zen Coding快速编写HTML代码(sublime text2篇)
首先说下,如何在sublime text2加上zen coding插件 按 Ctrl+`(就是~这个键) 复制下面的代码 确认 重新启动sublime text2 import urllib2,os; ...
- MVC中的扩展点(六)ActionResult
ActionResult是控制器方法执行后返回的结果类型,控制器方法可以返回一个直接或间接从ActionResult抽象类继承的类型,如果返回的是非ActionResult类型,控制器将会将结果转换为 ...
- STSdb
打开数据库并写入数据 ? using (StorageEngine engine = new StorageEngine("stsdb4.sys", "stsdb4.da ...
- 南阳理工OJ 15 括号匹配
思路:动态规划,设dp[i][j]表示第i个字符到第j个字符所需要的最少匹配数,则:(1),如果从第i到j-1个字符中没有一个与第j个字符匹配,那么状态转移方程为 dp[i][j] = dp[i][j ...
- CentOS设置在同一窗口打开文件夹
默认情况下,CentOS双击文件夹会打开一个新窗口.这对于习惯Windows的用户会感觉非常别扭.其实,如果用鼠标中键双击文件夹,就不会打开新窗口了.当然,也可以按照如下设置: 1. 打开任意一个文 ...
- spring注入Properties
最近项目中向将某个Properties注入到Bean中,经百度知以下代码. <bean id="settings" class="org.springframewo ...
- pm 2.5
定陵</a></div><div class="staaqi"><span class="label pmsmall" ...