HDU - 1036
题意描述很垃圾,后来看别人代码才知道怎么回事:对(题目所给d/总时间:所有时间加起来)四舍五入并取整,然后对结果/60得到用了几分钟;对结果%60得到用了几秒。
presentation error一次,因为没注意到输出的队伍编号占3格,要用%3d
代码
#include<bits/stdc++.h>
using namespace std;
#define maxn 100
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define ll long long
char s[maxn][maxn];
int vis[maxn][maxn]; int main()
{
int n;
double d;
scanf("%d%lf",&n,&d);
int x;
while(~scanf("%d",&x)){
int c3=;
int f=;
rep(i,,n){
char x1,x2,x3,x4,x5;
int m1,m2,m3;
scanf(" %c:%c%c:%c%c",&x1,&x2,&x3,&x4,&x5);
if(x1=='-')
f=;
m1=x1-'';
m2=(x2-'')*+x3-'';
m3=(x4-'')*+x5-'';
c3+=m1*+m2*+m3;
}
int ans1,ans2;
ans1=(int)(c3/d+0.5)/;
ans2=(int)(c3/d+0.5)%;
if(f)
printf("%3d:%2d:%02d min/km\n",x,ans1,ans2);
else
printf("%3d: -\n",x);
} return ;
}
HDU - 1036的更多相关文章
- hdu 1036 (I/O routines, fgets, sscanf, %02d, rounding, atoi, strtol) 分类: hdoj 2015-06-16 19:37 32人阅读 评论(0) 收藏
thanks to http://stackoverflow.com/questions/2144459/using-scanf-to-accept-user-input and http://sta ...
- HDU 1036(平均速度 **)
题意是求出跑了 n 圈每圈 m km 的个人的平均速度. 控制格式,特别注意,题意是输出 -:--:-- 的该人成绩作废,但要把他其他的成绩输进去,不能直接就 break ,输出也就只有一个 - ,而 ...
- HDU——PKU题目分类
HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...
- [转] HDU 题目分类
转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...
- HDU ACM 题目分类
模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...
- hdu 1038 Biker's Trip Odometer(水题)
题目链接:http://acm.hdu.edu.cn/showproblem.php? pid=1038 Biker's Trip Odometer Time Limit: 2000/1000 MS ...
- HDU 5643 King's Game 打表
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...
- 转载:hdu 题目分类 (侵删)
转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...
- hdu 分类
HDU分类 http://www.cnblogs.com/ACMan/archive/2012/05/26/2519550.html#2667329 努力A完.方便自己系统A题 不断更新中...... ...
随机推荐
- 使用RAP2和Mock.JS实现Web API接口的数据模拟和测试
最近一直在思考如何对Web API的其接口数据进行独立开发的问题,随着Web API的越来越广泛应用,很多开发也要求前端后端分离,例如统一的Web API接口后,Winform团队.Web前端团队.微 ...
- opendir函数和readdir函数内涵及用法
工作中遇到奇怪的事,加载增量的时候加载不上.于是开始分析原因,log里边没有任何错误信息,只有加载完成的标志.增量的数据在目录里边是存在的,但是显示的目录大小却不是4096,而是17,不知道为什么.后 ...
- iview render Datepicker 起止时间限制
{ title: '开始时间', key: 'planDateFrom', minWidth: 120, sortable: true, align: 'center', render: (h, pa ...
- PHP二维数组去重(指定键名)
本例对二维数组中某个指定键名进行去重,发现网上大多使用array_unique或是foreach遍历等方式去重,效果不佳且较为繁琐. 本文以二维数组去重为引,介绍array_column函数的三种用法 ...
- NodeJs之文件上传
NodeJs之文件上传 一,介绍与需求 1.1,介绍 1,multer模块 multer用于处理文件上传的nodejs中间件,主要跟express框架搭配使用,只支持表单MIME编码为multipar ...
- eclipse中查看字节码
1:在线安装ByteCode插件 打开Eclipse Go to"Help -> Install new Software... -> Work with:"中选择By ...
- 解决SecureCRT无法连接虚拟机的问题
- bzoj 1926: [Sdoi2010]粟粟的书架 (主席树+二分)
链接:https://www.lydsy.com/JudgeOnline/problem.php?id=1926 题面; 1926: [Sdoi2010]粟粟的书架 Time Limit: 30 Se ...
- 【CF1152F】Neko Rules the Catniverse(动态规划)
[CF1152F]Neko Rules the Catniverse(动态规划) 题面 CF 题解 我们先考虑一个需要扫一遍所有位置的做法. 那么状态一定是\(f[i]\)然后什么什么表示考虑到当前第 ...
- opencv+codeblocks +anaconda
study from : https://www.jianshu.com/p/c16b7c870356 #include <cstdio> #include <cstdlib> ...