题意描述很垃圾,后来看别人代码才知道怎么回事:对(题目所给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的更多相关文章

  1. 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 ...

  2. HDU 1036(平均速度 **)

    题意是求出跑了 n 圈每圈 m km 的个人的平均速度. 控制格式,特别注意,题意是输出 -:--:-- 的该人成绩作废,但要把他其他的成绩输进去,不能直接就 break ,输出也就只有一个 - ,而 ...

  3. HDU——PKU题目分类

    HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...

  4. [转] HDU 题目分类

    转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...

  5. HDU ACM 题目分类

    模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...

  6. hdu 1038 Biker&#39;s Trip Odometer(水题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php? pid=1038 Biker's Trip Odometer Time Limit: 2000/1000 MS ...

  7. HDU 5643 King's Game 打表

    King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...

  8. 转载:hdu 题目分类 (侵删)

    转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...

  9. hdu 分类

    HDU分类 http://www.cnblogs.com/ACMan/archive/2012/05/26/2519550.html#2667329 努力A完.方便自己系统A题 不断更新中...... ...

随机推荐

  1. 我用Python爬取了李沧最近一年多的二手房成交数据得出以下结论

    前言 去年年底,博主有购房的意愿,本来是打算在青岛市北购房,怎奈工作变动,意向转移到了李沧,坐等了半年以后,最终选择在红岛附近购置了期房. 也许一些知道青岛红岛的小伙伴会问我,为什么会跑到那鸟不拉屎的 ...

  2. flutter 本地存储 (shared_preferences)

    Flutter本地存储 和Android.Ios类似,Flutter也支持Preferences(Shared Preferences and NSUserDefaults) .文件.和Sqlite3 ...

  3. asp.net core 2.2 中的过滤器/筛选器(上)

    ASP.NET Core中的过滤器/筛选器 通过使用 ASP.NET Core MVC 中的筛选器,可在请求处理管道中的特定阶段之前或之后运行代码. 注意:本主题不适用于 Razor 页面. ASP. ...

  4. git常用命令二、:git stash

    Git stash 储藏工作现场(当你不得不新建分支,或者切换分支,但是当前工作区的修改并不想提交) git stash Saved working directory and index state ...

  5. 微信小程序音乐播放

    最近在写一个艾美食艾音乐的微信小程序,其中有用到音乐播放的功能,基本播放切换功能已经实现,但是在反复切换歌曲.重新进入歌曲以及单曲循环.列表循环的测试过程中还是发生了bug,特此写一篇文章,捋一下思路 ...

  6. 缓存,热点key

    热点Key问题的发现与解决 https://help.aliyun.com/document_detail/67252.html 缓存击穿.失效以及热点key问题 https://www.jiansh ...

  7. python并发编程之IO阻塞基础知识点

    IO模型 解决IO问题的方式方法 问题是:IO操作阻塞程序执行 解决的也仅仅是网络IO操作   一般数据传输经历的两个阶段,如图: IO阻塞模型分类: 阻塞IO 非阻塞IO 多路复用IO 异步IO(爬 ...

  8. Nginx+Keepalived搭建高可用负载均衡集群

    本文的重点是Keepalived的配置,Nginx的配置就简略带过.软件:CentOS 7.2 / Nginx 1.12.2 / Keepalived 1.3.9 ha-01:192.168.1.97 ...

  9. django中引入bootstrap4.3

    1.下载bootstrap4.3的包:https://getbootstrap.com/ 2.将下载后的文件放在project下新创建的static目录下.例如我的project是mysite,则放在 ...

  10. mysql全局权限账户%登录不上ERROR 1045 (28000): Access denied for user 'mhz'@'localhost' (using password: YES)

    mysql全局权限账户%登录不上ERROR 1045 (28000): Access denied for user 'mhz'@'localhost' (using password: YES) 解 ...