hdoj-1036-Average is not Fast Enough!(水题,坑)
题目链接:Average is not Fast Enough!
#include <iostream>
#include <cstring>
#include <string>
#include <cstdio>
using namespace std;
int main()
{
int n, id;
double d;
cin>>n>>d;
while (cin>>id) {
printf("%3d: ", id);
int mark = ;
int time = ;
for (int i=; i<n; i++) {
string str;
cin>>str;
if (str[] == '-') {
mark = ;
// printf("-\n");不能在这里输出,因为会碰到多个不及格的,WA了数次
}
if(mark==)continue;
time += (str[]-'') * + ((str[]-'')*+(str[]-'')) * + (str[]-'')*+(str[]-'');
}
if (mark == ) {
printf("-\n");
continue;
}
double a = time / d;
int t = (int)(a + 0.5);
printf("%d:%02d min/km\n", t/, t%);
}
return ;
}
hdoj-1036-Average is not Fast Enough!(水题,坑)的更多相关文章
- UESTC 486 Good Morning (水题+坑!)
题意:给你一行字符串,让你找其中蕴含的“good morning"的次数. 析:看起来很水么,多简单,只有统计一下其中字母的出现的次数,然后除以相应的个数. 但是很不幸的是WA,而且是在te ...
- Codeforces 1082B Vova and Trophies 模拟,水题,坑 B
Codeforces 1082B Vova and Trophies https://vjudge.net/problem/CodeForces-1082B 题目: Vova has won nn t ...
- 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 2317. Nasty Hacks 模拟水题
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
- 水题 HDOJ 4727 The Number Off of FFF
题目传送门 /* 水题:判断前后的差值是否为1,b[i]记录差值,若没有找到,则是第一个出错 */ #include <cstdio> #include <iostream> ...
- 水题 HDOJ 4716 A Computer Graphics Problem
题目传送门 /* 水题:看见x是十的倍数就简单了 */ #include <cstdio> #include <iostream> #include <algorithm ...
- 思维/构造 HDOJ 5353 Average
题目传送门 /* 思维/构造:赛后补的,当时觉得3题可以交差了,没想到这题也是可以做的.一看到这题就想到了UVA_11300(求最小交换数) 这题是简化版,只要判断行不行和行的方案就可以了,做法是枚举 ...
- HDOJ/HDU 1328 IBM Minus One(水题一个,试试手)
Problem Description You may have heard of the book '2001 - A Space Odyssey' by Arthur C. Clarke, or ...
- HDOJ/HDU 1256 画8(绞下思维~水题)
Problem Description 谁画8画的好,画的快,今后就发的快,学业发达,事业发达,祝大家发,发,发. Input 输入的第一行为一个整数N,表示后面有N组数据. 每组数据中有一个字符和一 ...
随机推荐
- python中的关键字global和nonlocal
知识点: global将一个变量变为全局变量 nonlocal改变最近的变量,又不是全局作用. 1.global 在python中,当引用一个变量的时候,对这个变量的搜索按找本地作用域(Local). ...
- classmethod和staticmethod区别
实例方法:在类中,定义的方法,这个方法的第一个参数默认是实例对象,一般习惯使用self 类方法:在类中,定义的方法,这个方法的第一个参数默认是类对象,一般习惯用cls表示,用@classmethod装 ...
- The Maximum Unreachable Node Set 【17南宁区域赛】 【二分匹配】
题目链接 https://nanti.jisuanke.com/t/19979 题意 给出n个点 m 条边 求选出最大的点数使得这个点集之间 任意两点不可达 题目中给的边是有向边 思路 这道题 实际上 ...
- 获取文件的MD5值,比较两个文件是否完全相同
代码: public class MD5Test { public static void main(String[] args) { String s1 = MD5Test.MD5Operation ...
- OpenGL学习进程(8)第六课:点、边和图形(三)绘制图形
本节是OpenGL学习的第六个课时,下面介绍OpenGL图形的相关知识: (1)多边形的概念: 多边形是由多条线段首尾相连而形成的闭合区域.OpenGL规定,一个多边形必须是一个“凸多边形”. ...
- centos6 没有eth0网络
编辑 /etc/sysconfig/network-scripts/ifcfg-eth0 ONREBOOT=no #改成yes service network restart 在用 ifconfig ...
- first application
<!DOCTYPE html> <html> <head> <title>Create a Map</title> <meta htt ...
- [转]AOP那些学术概念—通知、增强处理连接点(JoinPoint)切面(Aspect)
AOP那些学术概念—通知.增强处理连接点(JoinPoint)切面(Aspect) 1.我所知道的AOP 初看起来,上来就是一大堆的术语,而且还有个拉风的名字,面向切面编程,都说是OOP的一种有益补充 ...
- 【Flask】Sqlalchemy 子查询
### subquery:子查询可以让多个查询变成一个查询,只要查找一次数据库,性能相对来讲更加高效一点.不用写多个sql语句就可以实现一些复杂的查询.那么在sqlalchemy中,要实现一个子查询, ...
- Linux基础四---系统监控&硬盘分区
---恢复内容开始--- 一系统分区 1.top [参数] -b 批处理 -c 显示命令完全模式 -I 忽略失效过程 -s 保密模式 -S 累积模式 -i<时间> 设置间隔时间 -u< ...