HDUOJ--1058HangOver
HangOver
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 7884 Accepted Submission(s): 3233
The input consists of one or more test cases, followed by a line containing the number 0.00 that signals the end of the input. Each test case is a single line containing a positive floating-point number c whose value is at least 0.01 and at most 5.20; c will contain exactly three digits.
For each test case, output the minimum number of cards necessary to achieve an overhang of at least c card lengths. Use the exact output format shown in the examples.
#include<stdio.h>
int main()
{
double a,sum;
int i;
while(scanf("%lf",&a),a)
{
sum=0.0;
for(i=;i<=;i++)
{
sum+=1.0/i;
if(sum-a>=) break;
}
printf("%d card(s)\n",i-);
}
return ;
}
数学题...就是搞不清要精确到哪一点..这样的,虽然 及其简单。。。但是往往AC率不高!!
HDUOJ--1058HangOver的更多相关文章
- hduoj 1455 && uva 243 E - Sticks
http://acm.hdu.edu.cn/showproblem.php?pid=1455 http://uva.onlinejudge.org/index.php?option=com_onlin ...
- hduoj 4712 Hamming Distance 2013 ACM/ICPC Asia Regional Online —— Warmup
http://acm.hdu.edu.cn/showproblem.php?pid=4712 Hamming Distance Time Limit: 6000/3000 MS (Java/Other ...
- hduoj 4706 Herding 2013 ACM/ICPC Asia Regional Online —— Warmup
hduoj 4706 Children's Day 2013 ACM/ICPC Asia Regional Online —— Warmup Herding Time Limit: 2000/1000 ...
- hdu-oj 1874 畅通工程续
最短路基础 这个题目hdu-oj 1874可以用来练习最短路的一些算法. Dijkstra 无优化版本 #include<cstdio> #include<iostream> ...
- C#版 - HDUoj 5391 - Zball in Tina Town(素数) - 题解
版权声明: 本文为博主Bravo Yeung(知乎UserName同名)的原创文章,欲转载请先私信获博主允许,转载时请附上网址 http://blog.csdn.net/lzuacm. HDUoj 5 ...
- C++版 - HDUoj 2010 3阶的水仙花数 - 牛客网
版权声明: 本文为博主Bravo Yeung(知乎UserName同名)的原创文章,欲转载请先私信获博主允许,转载时请附上网址 http://blog.csdn.net/lzuacm. C++版 - ...
- HDUOJ题目HTML的爬取
HDUOJ题目HTML的爬取 封装好的exe/app的GitHub地址:https://github.com/Rhythmicc/HDUHTML 按照系统选择即可. 其实没什么难度,先爬下来一个题目的 ...
- hduoj 1251 统计难题
http://acm.hdu.edu.cn/showproblem.php?pid=1251 统计难题 Time Limit: 4000/2000 MS (Java/Others) Memory ...
- hduoj 1286 找新朋友
http://acm.hdu.edu.cn/showproblem.php?pid=1286 找新朋友 Time Limit: 2000/1000 MS (Java/Others) Memory Li ...
- hduoj 1285 确定比赛名次
http://acm.hdu.edu.cn/showproblem.php?pid=1285 确定比赛名次 Time Limit: 2000/1000 MS (Java/Others) Memory ...
随机推荐
- Tomcat启动就执行特定方法
import java.util.Timer; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContex ...
- [Git] An efficient GIT workflow for mid/long term projects
reference : http://fle.github.io/an-efficient-git-workflow-for-midlong-term-projects.html Our full-w ...
- Flume NG 配置详解(转)
原文链接:[转]Flume NG 配置详解 (说明,名词对应解释 源-Source,接收器-Sink,通道-Channel) 配置 设置代理 Flume代理配置存储在本地配置文件.这是一个文本文件格式 ...
- Objective-C:用命令行参数的格式对文件进行IO操作
// main.m // 03-copyFile // Created by ma c on 15/8/24. // Copyright (c) 2015年. All rights reserved. ...
- OpenCV特征检测教程
http://docs.opencv.org/2.4/doc/tutorials/features2d/table_of_content_features2d/table_of_content_fea ...
- hdu1226 超级密码 (BFS,里面用了大数取余原理)
Problem Description Ignatius花了一个星期的时间终于找到了传说中的宝藏,宝藏被放在一个房间里,房间的门用密码锁起来了,在门旁边的墙上有一些关于密码的提示信息: 密码是一个C进 ...
- Insert Interval leetcode java
题目: Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if nec ...
- 职场菜鸟初窥Ant
对于新入职的新人来说,学校的那一套东西于实际的工作根本不够.诸多的技术知识还得自己去慢慢掌握和理解.对于项目的发布笔者以前也就仅仅使用开发工具集成的发布功能,并未使用过Ant进行项目的发布.因此需要做 ...
- 在Linux上自动调整屏幕亮度保护眼睛
导读 Lightbot当你开始在计算机前花费大量时间的时候,问题自然开始显现.这健康吗?怎样才能舒缓我眼睛的压力呢?为什么光线灼烧着我?尽管解答这些问题的研究仍然在不断进行着,许多程序员已经采用了一些 ...
- 廖雪峰的python学习网址
http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/00140737570055886 ...