OpenJudge / Poj 1003 Hangover】的更多相关文章

链接地址: 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…
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…
    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…
一. 题目 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…
Hangover Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 103896   Accepted: 50542 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 a…
#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: 109231   Accepted: 53249 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 a…
点击打开链接 题目大意 就是有很多卡片可以沿着桌边向外放,每次可以伸出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…
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…
BUPT 2017 summer training (16) #2C 题意 n个卡片可以支撑住的长度是1/2+1/3+1/4+..+1/(n+1)个卡片长度.现在给出需要达到总长度,求最小的n. 题解 模拟加起来,直到长度不小于给定的总长度. 我也写了个java代码^_^ 代码 import java.util.*; import java.io.*; public class Main{ public static void main(String []args){ Scanner cin =…
1.问题描述: http://poj.org/problem?id=1003 2.解题思路: 最直观的的想法是看能不能够直接求出一个通项式,然后直接算就好了, 但是这样好水的样子,而且也不知道这个通项式能否求出且精度如何? 题目中提到输入介于0.01 和5.20之间,可以确定的是最后求出来的卡片数肯定介于1-300之间,因此可以预先求出1-300张卡片分别垒起来可以达到的overhang长度. 然后用二分搜索来做.具体的代码如下: /* author: obalama date: 2013.07…
1.链接地址: http://poj.org/problem?id=2141 http://bailian.openjudge.cn/practice/2141/ 2.题目: Message Decowding Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11784   Accepted: 6562 Description The cows are thrilled because they've just learn…
1.链接地址: http://poj.org/problem?id=2105 http://bailian.openjudge.cn/practice/2105 2.题目: IP Address Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 18146   Accepted: 10456 Description Suppose you are reading byte streams from any device, r…
1.链接地址: http://bailian.openjudge.cn/practice/2027 http://poj.org/problem?id=2027 2.题目: 总Time Limit: 1000ms Memory Limit: 65536kB Description Zombies love to eat brains. Yum. Input The first line contains a single integer n indicating the number of da…
1.链接地址: http://bailian.openjudge.cn/practice/2013 http://poj.org/problem?id=2013 2.题目: Symmetric Order Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 11793   Accepted: 7181 Description In your job at Albatross Circus Management (yes, it…
1.链接地址: bailian.openjudge.cn/practice/1088 http://poj.org/problem?id=1088 2.题目: 总Time Limit: 1000ms Memory Limit: 65536kB Description Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激.可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你.Michael想知道载一个 区域中最长的滑坡.区域由一个二维数组给出.数组的…
1.链接地址: http://bailian.openjudge.cn/practice/2001 http://poj.org/problem?id=2001 2.题目: Shortest Prefixes Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 12208   Accepted: 5210 Description A prefix of a string is a substring starting at t…
1.链接地址: http://bailian.openjudge.cn/practice/2000 http://poj.org/problem?id=2000 2.题目: 总Time Limit: 1000ms Memory Limit: 65536kB Description The king pays his loyal knight in gold coins. On the first day of his service, the knight receives one gold c…
1.链接地址: http://poj.org/problem?id=1936 http://bailian.openjudge.cn/practice/1936 2.题目: All in All Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 26651   Accepted: 10862 Description You have devised a new encryption technique which encod…
1.链接地址: bailian.openjudge.cn/practice/1661 http://poj.org/problem?id=1661 2.题目: 总Time Limit: 1000ms Memory Limit: 65536kB Description "Help Jimmy" 是在下图所示的场景上完成的游戏.场景中包括多个长度和高度各不相同的平台.地面是最低的平台,高度为零,长度无限. Jimmy 老鼠在时刻0从高于所有平台的某处开始下落,它的下落速度始终为1米/秒.当…
1.链接地址: http://bailian.openjudge.cn/practice/1915 http://poj.org/problem?id=1915 2.题目: 总Time Limit: 1000ms Memory Limit: 65536kB Description BackgroundMr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from o…
1.链接地址: http://bailian.openjudge.cn/practice/1163 http://poj.org/problem?id=1163 2.题目: 总时间限制: 1000ms 内存限制: 65536kB 描述 73 88 1 02 7 4 44 5 2 6 5 (Figure 1) Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers pa…
1.链接地址: http://bailian.openjudge.cn/practice/1844 http://poj.org/problem?id=1844 2.题目: Sum Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 10031   Accepted: 6564 Description Consider the natural numbers from 1 to N. By associating to eac…
1.链接地址: http://bailian.openjudge.cn/practice/1321 http://poj.org/problem?id=1321 2.题目: 棋盘问题 Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 20403   Accepted: 10138 Description 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别.要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同…
1.链接地址: http://bailian.openjudge.cn/practice/1753/ http://poj.org/problem?id=1753 2.题目: 总时间限制: 1000ms 内存限制: 65536kB 描述 Flip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is wh…
1.链接地址: http://bailian.openjudge.cn/practice/1191/ http://poj.org/problem?id=1191 2.题目: 总时间限制: 1000ms 内存限制: 65536kB 描述 将一个8*8的棋盘进行如下分割:将原棋盘割下一块矩形棋盘并使剩下部分也是矩形,再将剩下的部分继续如此分割,这样割了(n-1)次后,连同最后剩下的矩形棋盘共有n块矩形棋盘.(每次切割都只能沿着棋盘格子的边进行)原棋盘上每一格有一个分值,一块矩形棋盘的总分为其所含各…
1.链接地址: http://bailian.openjudge.cn/practice/1723/ http://poj.org/problem?id=1723 2.题目: 总时间限制: 1000ms 内存限制: 65536kB 描述 N soldiers of the land Gridland are randomly scattered around the country. A position in Gridland is given by a pair (x,y) of integ…
1.链接地址: http://bailian.openjudge.cn/practice/1658 http://poj.org/problem?id=1658 2.题目: 总时间限制: 1000ms 内存限制: 65536kB 描述 Eva的家庭作业里有很多数列填空练习.填空练习的要求是:已知数列的前四项,填出第五项.因为已经知道这些数列只可能是等差或等比数列,她决定写一个程序来完成这些练习. 输入 第一行是数列的数目t(0 <= t <= 20).以下每行均包含四个整数,表示数列的前四项.…
1.链接地址: http://bailian.openjudge.cn/practice/1979 http://poj.org/problem?id=1979 2.题目: 总时间限制: 1000ms 内存限制: 65536kB 描述 There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile.…