poj1607
2013-01-16 09:34
225 查看
题意:一叠卡片,用一种摆法,要求每张卡片短边与桌檐平行,并让他们超出桌檐尽量多,问能超出桌檐多少。
View Code
View Code
#include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> using namespace std; int n; int main() { //freopen("t.txt", "r", stdin); puts("Cards Overhang"); while (~scanf("%d", &n)) { double ans = 0; for (int i = 1; i <= n; i++) ans += 1.0 / (i * 2); printf("%5d%10.3f\n", n, ans); } return 0; }
相关文章推荐
- POJ 1607
- POJ&nbsp;1607
- poj 1607 Deck(坑爹的水题啊)
- poj/pku 1607
- POJ 1607
- POJ 1607 /ZOJ 1216 : Deck - 整齐输出
- Poj 1125 (Floyd算法求最短路径)
- poj 2533 Longest Ordered Subsequence
- poj 1751 prim
- poj 2109 Power of Cryptography
- poj 1961 Period (KMP)
- 北大poj Q2_Parencodings
- POJ 1724 ROADS(二维SPFA)
- poj 1228
- poj 2063 Investment ( zoj 2224 Investment ) 完全背包
- DP 之 poj 2229
- poj 3903 Stock Exchange(求最长上升子序列长度)
- poj 3180 统计连通分量元素大于一的个数
- [POJ 1523]题解
- poj 2635