POJ.1003 Hangover ( 水 )
POJ.1003 Hangover ( 水 )
代码总览
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>
#define nmax
using namespace std;
vector <double> v;
void init()
{
int temp = 2;
double total = 0;
v.push_back(0);
while(total<=5.20){
total+=1.0/(1.0*temp);
v.push_back(total);
temp++;
}
}
int main()
{
init();
double num;
while(scanf("%lf",&num) && num != 0.0){
int pos = lower_bound(v.begin(),v.end(),num) - v.begin();
printf("%d card(s)\n",pos);
}
return 0;
}
POJ.1003 Hangover ( 水 )的更多相关文章
- poj 1003:Hangover(水题,数学模拟)
Hangover Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 99450 Accepted: 48213 Descri ...
- OpenJudge / Poj 1003 Hangover
链接地址: Poj:http://poj.org/problem?id=1003 OpenJudge:http://bailian.openjudge.cn/practice/1003 题目: Han ...
- [POJ 1003] Hangover C++解题
Hangover Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 95164 Accepted: 46128 De ...
- [POJ] #1003# Hangover : 浮点数运算
一. 题目 Hangover Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 116593 Accepted: 56886 ...
- 快速切题 poj 1003 hangover 数学观察 难度:0
Hangover Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 103896 Accepted: 50542 Descr ...
- poj 1003 Hangover
#include <iostream> using namespace std; int main() { double len; while(cin >> len & ...
- 【转】POJ百道水题列表
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...
- POJ.1552 Doubles(水)
POJ.1552 Doubles(水) 题意分析 暴力 代码总览 #include <cstdio> #include <stdio.h> #define nmax 100 u ...
- POJ 1003:Hangover
Hangover Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 109231 Accepted: 53249 Descr ...
随机推荐
- java Arrays.asList
List<String> list = Arrays.asList("A B C D E F G H I J K L ".split(" ")); ...
- uvaoj1585Score(暴力)
1585 ScoreThere is an objective test result such as “OOXXOXXOOO”. An ‘O’ means a correct answer of a ...
- lintcode413 反转整数
反转整数 将一个整数中的数字进行颠倒,当颠倒后的整数溢出时,返回 0 (标记为 32 位整数). 您在真实的面试中是否遇到过这个题? Yes 样例 给定 x = 123,返回 321 给定 x = ...
- python内建模块Collections
# -*- coding:utf-8 -*- # OrderedDict可以实现一个FIFO(先进先出)的dict, # 当容量超出限制时,先删除最早添加的Key: from collections ...
- hadoop3.0新特性及新功能
Hadoop-3.0.0-alpha2版本发布,相比之前的hadoop-2.x有一系列的功能增强.但目前还是个alpha版本,有很多bug,且不能保证API的稳定和质量. 主要变化 Java最低版本要 ...
- Java进阶知识点:服务端高并发的基石 - NIO与Reactor AIO与Proactor
一.背景 要提升服务器的并发处理能力,通常有两大方向的思路. 1.系统架构层面.比如负载均衡.多级缓存.单元化部署等等. 2.单节点优化层面.比如修复代码级别的性能Bug.JVM参数调优.IO优化等等 ...
- error:no module named StringIO or cStringIO
一般遇到没有某个模块问题的时候,通常的解决方法是pip相应的模块: 不过,鉴于Python2和python3的不同(让人头疼) 解决方法:在python3中,该模块被新的模块取代,即io. 重新imp ...
- MongoDB3.2 集群搭建
一.集群的理论知识 1.1 集群成员 MongoDB的集群类似于GreenPlum集群,由一个入口节点负责任务分发与结果统计,分片结节负责执行任务.不同GP,多了一个config servers. 集 ...
- net::ERR_ABORTED ,引入js文件出现报错的解决方法
在head头里面添加 <mvc:annotation-driven enable-matrix-variables="true"></mvc:annotation ...
- Lake Counting(DFS连通图)
Description Due to recent rains, water has pooled in various places in Farmer John's field, which is ...