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 ...
随机推荐
- Docker Daemon 参数最佳实践
1. Docker Daemon 配置参数 限制容器之间网络通信 在同一台主机上若不限制容器之间通信,容器之间就会暴露些隐私的信息,所以推荐关闭 docker daemon –icc=false 使用 ...
- Python 第八章笔记
第八章总结 8.5. heapq - 堆队列算法 有8个算法 方法 heappush heappop heappushpop heapreplace heapify merge nlargest ns ...
- 【解决】VS2013 + Qt 5.7(5.6适用)使用QSqlDatabase出现“无法解析的外部符号"错误
原始日期: 2016-08-03 22:09 错误如下: error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscal ...
- js中的函数
[函数的声明及调用] 基础知识 1.函数声明的格式: function 函数名(参数1,参数2,....){ //函数体 return 结果: } >>>函数调用的格式: 直接调用: ...
- excel转html 实现在线预览
首先说一下,本人发布的代码都是经过本人亲测,并且用在实际项目中.如果觉得可以,希望大家点个赞,谢谢大家. 有什么问题,大家评论出来,一起交流.好了,不废话了,下面来说一说这个东西怎么做. 网上也有许多 ...
- oracle创建数据库表空间 用户 授权 导入 导出数据库
windows下可以使用向导一步一步创建数据库,注意编码. windows连接到某一个数据库实例(不然会默认到一个实例下面):set ORACLE_SID=TEST --登录开始创建表空间及可以操作的 ...
- 拉勾网招聘数据分析(Echarts, SQL, java)
这次的数据分析与决策课程,我做的是通过爬取拉勾网上的招聘信息,并用爬取到的数据整体分析互联网行业数据,项目做得差不多了,先总结下吧,后边有时间了再完善. 主要工具: Echarts, SQL, ja ...
- linux发行版和内核的关系
转自:http://m.blog.csdn.net/article/details?id=50595230 Linux内核是计算机操作系统的核心.一个完整的 Linux发行版包括了内核与一些其他与文件 ...
- 9.如何解决出现AXIOS的Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.
问题描述: 由于restful接口需要在头部header传递两个字段: Content-Type: application/jsonAccess-Token: 84c6635800b14e0eba4f ...
- 13.什么是javabean,以及使用原则
javabean简介 javabeans就是符合某种特定的规范的java类,使用javabeans的好处是解决代码的重复编写,减少代码 冗余,功能区分明确,提高了代码的维护性. javabean的设计 ...