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 ( 水 )的更多相关文章

  1. poj 1003:Hangover(水题,数学模拟)

    Hangover Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 99450   Accepted: 48213 Descri ...

  2. OpenJudge / Poj 1003 Hangover

    链接地址: Poj:http://poj.org/problem?id=1003 OpenJudge:http://bailian.openjudge.cn/practice/1003 题目: Han ...

  3. [POJ 1003] Hangover C++解题

        Hangover Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 95164   Accepted: 46128 De ...

  4. [POJ] #1003# Hangover : 浮点数运算

    一. 题目 Hangover Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 116593   Accepted: 56886 ...

  5. 快速切题 poj 1003 hangover 数学观察 难度:0

    Hangover Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 103896   Accepted: 50542 Descr ...

  6. poj 1003 Hangover

    #include <iostream> using namespace std; int main() { double len; while(cin >> len & ...

  7. 【转】POJ百道水题列表

    以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...

  8. POJ.1552 Doubles(水)

    POJ.1552 Doubles(水) 题意分析 暴力 代码总览 #include <cstdio> #include <stdio.h> #define nmax 100 u ...

  9. POJ 1003:Hangover

    Hangover Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 109231   Accepted: 53249 Descr ...

随机推荐

  1. hdu5305 Friends(dfs,多校题)

    Friends Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Sub ...

  2. Maxscript-获取选中文件

    Maxscript - 获取选中文件 使用 .Net 的方法弹出窗口选择文件,并范围所有选中文件的路径“” Fn Fun_GetFilePaths strTitle strFilter = ( dia ...

  3. lintcode50 数组剔除元素后的乘积

    数组剔除元素后的乘积 给定一个整数数组A. 定义B[i] = A[0] * ... * A[i-1] * A[i+1] * ... * A[n-1], 计算B的时候请不要使用除法. 您在真实的面试中是 ...

  4. 【shell 练习1】编写Shell条件句练习

    实例一.比较两个整数大小 #!/bin/bash while true do read -p "Please input two int nums:" a b >/dev/& ...

  5. 简析@Resource 和 @Autowired的区别

    @Autowird @Autowird 属于spring框架,默认使用类型(byType)进行注入,例如下面代码: @Autowired public IUserService userService ...

  6. 【转载】2015Android 面试题 01

    1.如何避免ANR? 答:ANR:Application Not Responding,五秒在Android中,活动管理器和窗口管理器这两个系统服务负责监视应用程序的响应. 当出现下列情况时,Andr ...

  7. SpringCloud IDEA 教学 (五) 断路器控制台(HystrixDashboard)

    写在开头 断路器控制台是为了查看断路器运行情况而研发的.本章介绍了断路器控制台的搭建,代码基于之前Client的搭建.HystrixDashboard基于之前配置好的,使用了HystrixComman ...

  8. HDU 4617 Weapon(三维几何)

    Problem Description Doctor D. are researching for a horrific weapon. The muzzle of the weapon is a c ...

  9. POJ 3384 Feng Shui(计算几何の半平面交+最远点对)

    Description Feng shui is the ancient Chinese practice of placement and arrangement of space to achie ...

  10. Python中如何Getting Help

    在Python中Gettting Help有如下两种方法: 1 使用dir函数,dir的参数可以是一个真正的对象实例,也可以是一个数据类型,无论哪种情形,dir函数都返回与这个对象或者数据类型相关联的 ...