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题 不断更新中...... ...
随机推荐
- ValueError: too many values to unpack
Error msg: 执行: python manage,py makemigrations 报错:Value: too many values to unpack 问题: django第一次数据库迁 ...
- 一入OI深似海 3 —— 纪念我最后一次PJ(上)
其实在比赛前一天中午上车前, 我还在机房打 I wanna, 感觉就是去杭州旅游的. 诶,还真是这样! 我和jwj在绍兴服务区买了金拱门, 拎着吃的回到车上的时候, 迎面而来羡慕的小眼神. 下午很早就 ...
- Django(五)母版继承、Cookie、视图装饰器等
大纲 一.内容回顾 补充:默认值 补充:命名空间 二.模板语言 1.母版继承 2.include 3.自定义simple_tag 三.Cookie Cookie 使用总结 四.视图 1.获取用户请求相 ...
- array数组(n,1)和(n,)互相转换
data.shape #(172,1) result = [arr[0] for arr in data] result.shape #(172,) (172,1)表示是一个(172,1)shape大 ...
- 【HTML+CSS】在书写代码时的便捷应用
创建多个相同元素: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> < ...
- git的安装(和远程仓库建立连接)
安装完git 1.配置用户名和邮箱 $ git config --global user.name "My Name" $ git config --global user.em ...
- Cnblogs美化总结
测试 扩展阅读 [转载]详谈如何定制自己的博客园皮肤 - 云+社区 - 腾讯云谢谢!! [PS]3步搞定博客园界面风格 - nowgood - 博客园 [分享]博客美化(6)为你的博文自动添加目录 - ...
- Python 练习——计算1-2+3-4...+99
# 求1-99的所有数的和 count = 1 s = 0 while count < 100: s += count count += 1 print(s) 当都为正数时,即1+2+3+... ...
- 20175206迭代与JDB测试
迭代与JDB测试 C(n,m)组合数的判定 实验要求 1 使用C(n,m)=C(n-1,m-1)+C(n-1,m)公式进行递归编程实现求组合数C(m,n)的功能 2 m,n 要通过命令行传入 实验案例 ...
- python类的两种创建方式
参考: https://blog.csdn.net/likunkun__/article/details/81949479