poj: 1003】的更多相关文章

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…
1.问题描述: http://poj.org/problem?id=1003 2.解题思路: 最直观的的想法是看能不能够直接求出一个通项式,然后直接算就好了, 但是这样好水的样子,而且也不知道这个通项式能否求出且精度如何? 题目中提到输入介于0.01 和5.20之间,可以确定的是最后求出来的卡片数肯定介于1-300之间,因此可以预先求出1-300张卡片分别垒起来可以达到的overhang长度. 然后用二分搜索来做.具体的代码如下: /* author: obalama date: 2013.07…
链接地址: Poj:http://poj.org/problem?id=1003 OpenJudge:http://bailian.openjudge.cn/practice/1003 题目: Hangover Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 94993   Accepted: 46025 Description How far can you make a stack of cards overhang…
    Hangover Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 95164   Accepted: 46128 Description How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We'r…
Hangover Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 99450   Accepted: 48213 Description How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're as…
点击打开链接 题目大意 就是有很多卡片可以沿着桌边向外放,每次可以伸出1/2,1/3,1/4问最少多少卡片才能让一张完成的卡片悬空,题目输入卡片的宽度,输出卡片个数 #include<stdio.h> int array[550]; int main() { int i, j; double sum = 0; array[0] = 0; for(i = 1, j = 1; j < 521; i++) { sum += 1.0/(i + 1); int n = sum * 100; for…
简单题 #include <iostream> #include <stdio.h> #include <string.h> #include <stack> using namespace std; int main() { double c; while (cin >> c && c != 0.00) { double L = 0.5; ; //cout << c << endl; while (L &…
#include <iostream> using namespace std; int main() { double len; while(cin >> len && len) { double sum = 0.0; double i = 1.0; ; while(sum < len) { sum += i/n; ++n; } cout << n- << " card(s)" <<endl; } ;…
一. 题目 Hangover Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 116593   Accepted: 56886 Description How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (W…
How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're assuming that the cards must be perpendicular to the table.) With two cards you can make the top card overha…