ACM: DP训练好题 动态规划题 poj 1…
来源:互联网 发布:淘宝网左轮吉他直播 编辑:程序博客网 时间:2024/05/21 17:59
Description
Like everyone else, cows race bicycles in packs because that's themost efficient way to beat the wind. While travelling at xlaps/minute (x is always an integer), the head of the pack expendsx*x energy/minute while the rest of pack drafts behind him usingonly x energy/minute. Switching leaders requires no time though canonly happen after an integer number of minutes. Of course, cows candrop out of the race at any time.
The cows have entered a race D (1 <= D<= 100) laps long. Each cow has the same initialenergy, E (1 <= E <= 100).
What is the fastest possible finishing time? Only one cow has tocross the line. The finish time is an integer. Overshooting theline during some minute is no different than barely reaching it atthe beginning of the next minute (though the cow must have theenergy left to cycle the entire minute). N, D, and E areintegers.
Input
Output
Sample Input
3 30 20
Sample Output
7
Hint
[as shown in this chart:
time
* = leader switch
题意: 现在又N头奶牛, 每头奶牛的能量是E, 现在要奶牛们只要有一头完成跑D圈就完成任务.
解题思路:
代码:
#include<cstdio>
#include <iostream>
#include <cstring>
using namespace std;
const int INF = (1<<29);
int n, e, d;
int dp[25][105][105];
inline int min(int a,int b)
{
}
int main()
{
//
}
- ACM: DP训练好题 动态规划题 poj 1…
- ACM: dp动态规划题(难) poj 3267 …
- ACM: dp题(动态规划) poj 2151 (d…
- ACM: 树状DP 动态规划题 poj 1463 …
- ACM: 动态规划题 poj 2033 (博客好…
- ACM: DP+floyd 动态规划题 poj 117…
- ACM: 动态规划题 poj 2057 树状DP
- ACM: 概率DP 动态规划题 poj 1322
- ACM: 动态规划题 poj 1192 树形DP
- ACM: dp题 poj 1276 go on 动态规…
- ACM: 简单动态规划题 poj 2955
- ACM: 动态规划题 poj 2241
- ACM: 动态规划题 poj 1054
- ACM: 动态规划题 poj 2948
- ACM: 动态规划题 poj 1925
- ACM: 动态规划题 poj 3034
- ACM: 动态规划题 poj 2411
- ACM: 动态规划题 poj 1947
- ACM: 浙江省赛题目 22:00 ~ 3:00 (…
- 2012年广东ACM省赛赛后总结
- ACM: 动态规划题 toj 1511
- ACM: 动态规划题 toj 1545
- ACM: 简单DP 动态规划题 toj 1547
- ACM: DP训练好题 动态规划题 poj 1…
- ACM: 0-1背包变形 动态规划题 toj …
- ACM: 任意进制的小数转化 高精度题…
- ACM: n!末尾0的个数 数论题 poj 14…
- ACM: 扩展欧几里德+欧拉函数 数论…
- ACM: 三分法 poj 1018 (学习到三…
- cug1702&&CCNU校赛J题 分块
- ACM: 贪心题 poj 1083
- 2