HDU1036 Average is not Fast Enough!
You have to process several teams. For each team you are given a list with the running times for every section of the race. You are to compute the average time per kilometer over the whole distance. That's easy, isn't it?
So if you like the fun and challenge competing at this contest, perhaps you like a relay race, too. Students from Ulm participated e.g. at the "SOLA" relay in Zurich, Switzerland. For more information visit http://www.sola.asvz.ethz.ch/ after the contest is over.
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <ctype.h> using namespace std; int main()
{
int n,num;
float d;
char tim[];
scanf("%d%f",&n,&d); while(scanf("%d",&num)!=EOF)
{
float seconds=;
int flag=;
for(int i=;i<n;i++)
{ scanf("%s",&tim);
if(tim[]=='-')
flag=;
else
seconds+=(tim[]-'')*+((tim[]-'')*+tim[]-'')*+(tim[]-'')*+tim[]-'';
}
int k=seconds/d+0.5;
if(flag)
printf("%3d: -\n",num);
else
printf("%3d:%2d:%02d min/km\n",num,k/,k%); }
return ;
}
HDU1036 Average is not Fast Enough!的更多相关文章
- HDU-1036 Average is not Fast Enough!
Average is not Fast Enough! http://acm.hdu.edu.cn/showproblem.php?pid=1036 Problem Description A rel ...
- hdoj-1036-Average is not Fast Enough!(水题,坑)
题目链接:Average is not Fast Enough! #include <iostream> #include <cstring> #include <st ...
- hdu_1036_Average is not Fast Enough_201311021335
Average is not Fast Enough! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (J ...
- 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 ...
- 杭电ACM分类
杭电ACM分类: 1001 整数求和 水题1002 C语言实验题——两个数比较 水题1003 1.2.3.4.5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze ...
- HOJ题目分类
各种杂题,水题,模拟,包括简单数论. 1001 A+B 1002 A+B+C 1009 Fat Cat 1010 The Angle 1011 Unix ls 1012 Decoding Task 1 ...
- 【C#】转一篇MSDN杂志文:ASP.NET Pipeline: Use Threads and Build Asynchronous Handlers in Your Server-Side Web Code
序:这是一篇发表在2003年6月刊的MSDN Magazine的文章,现在已经不能在线阅读,只提供chm下载.讲的是异步请求处理那些事,正是我上一篇博文涉及的东西(BTW,事实上这篇杂志阐述了那么搞然 ...
- 转载:hdu 题目分类 (侵删)
转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...
- training 2
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.136 Average Precision (AP) @[ IoU ...
随机推荐
- 格式化输出和printf命令
GNU版本的printf命令用来格式化输出,效果类似与C语言的printf函数.2.x以上版本的Bash内建的printf命令和e/usr/bin下的printf命令使用方法一样. 例子:$print ...
- Bash内置命令
Bash有很多内置命令,因为这些命令是内置的,因此bash不需要在磁盘上为它们定位,执行速度更快. 1)列出所有内置命令列表$enable 2)关闭内置命令test$enable -n test 3) ...
- Javascript实现Base64解码
工作中需要用到,在stackoverflow中找到的,实践证明可用. function decode_base64(s) { var e = {}, i, k, v = [], r = '', w = ...
- 微信小程序开发过程中一些经验总结
1.微信开发者工具报错,微信小程序最低需支持tls1.2版本的问题 原因是服务器不支持ssl的高版本,解决方法: 在/etc/nginx/conf.d文件下,把"ssl_protocols ...
- Python入门(2)
一. 基础语法 1.Print print 是 python 里很基本很常见的一个操作,它的操作对象是一个字符串. 直接在 print 后面加一段文字来输出的话,需要给文字加上双引号或者单引号. ...
- redis 对象
redis通过前面几篇的数据结构构键了一个对象系统,这个对象系统包含了字符串对象,列表对象,哈希对象,集合对象,有序集合对象 每一个对象都是一个redisobject typedef struct r ...
- 按enter 进行搜索 enter提交表单
//按enter 进行搜索 document.onkeydown = function(e){ var ev = document.all ? window.event : e; if(ev.keyC ...
- object覆盖的div解决办法
最近做个web项目,因为里面有个<object>的插件,弹出<div>对话框会被其遮盖,我做了个<iframe>标签,在弹框时,把<object>覆盖掉 ...
- IP命令
ip命令是Linux下较新的功能强大的网络配置工具. 1 功能 ip命令用来显示或操纵Linux主机的路由.网络设备.策略路由和隧道. 2用法 Usage: ip [ OPTIONS ] OBJECT ...
- [leetcode-606-Construct String from Binary Tree]
You need to construct a string consists of parenthesis and integers from a binary tree with the preo ...