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组数据. 每组数据中有一个字符和一 ...
随机推荐
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related(转)
转至:http://www.cnblogs.com/taoys/archive/2010/12/30/1922186.html application/x-www-form-urlencoded: 窗 ...
- spring cloud 使用feign 遇到问题
spring cloud 使用feign 项目的搭建 在这里就不写了,本文主要讲解在使用过程中遇到的问题以及解决办法 1:示例 @RequestMapping(value = "/gener ...
- 每天一个Linux命令(51)ss命令
ss命令用来显示处于活动状态的套接字信息. (1)用法: 用法: ss [参数] ss [参数] [过滤] (2)功能: 功能: ss是类似nets ...
- matlab fread
Matlab中fread函数用法 “fread”以二进制形式,从文件读出数据. 语法1:[a,count]=fread(fid,size,precision) 语法2:[a,count]=fre ...
- 数独C语言算法
备好:http://blog.chinaunix.net/uid-26456800-id-3380612.html
- Linux VPS实用简单安全配置
今天,和大家一起来分享VPS最基本的安全配置. 第一.修改SSH端口 VPS默认的SSH端口是22,那些扫描穷举密码的,也势必从22开始,所以,修改22为一个其他的数字,是非常有必要的. 好了,SSH ...
- RHEL 7 安装 ngnix
安装ngnix yum install -y make apr* autoconf automake curl curl-devel gcc gcc-c++ gtk+-devel zlib-devel ...
- ubuntu 忘记root密码
Ubuntu14.04系统中,因为误操作导致管理员密码丢失或无效,并且忘记root密码,此时无法进行任何root/sudo权限操作.可以通过GRUB重新设置root密码,并恢复管理员账户到正常状态. ...
- iptable防火墙面试题
第1章 (一)基础口试题 1.1 详述 iptales 工作流程以及规则过滤顺序? 1.防火墙是一层层过滤的.实际是按照配置规则的顺序从上到下,从前到后进行过滤的. 2.如果匹配上了规则,即明确表明是 ...
- How to choose from Viewstate, SessionState, Cookies and Cache
https://devshop.wordpress.com/2008/04/10/how-to-choose-from-viewstate-sessionstate-cookies-and-cache ...