DP
浙右华亭
这个作者很懒,什么都没留下…
展开
-
[HDU-1024]Max Sum Plus Plus
#include#include#includeusing namespace std;const int maxn = 1000000 + 10;const int INF = 0X7fffffff;int S[maxn];int dp[maxn][2];int main() { int m, n; while( scanf("%d%d", &m, &n)!=原创 2017-11-21 23:39:50 · 171 阅读 · 0 评论 -
[HDU-1069]Monkey and Banana
#include#include#include#includeusing namespace std;const int maxn = 30*6 + 20;struct Node { int x, y, z;};Node S[maxn];int dp[maxn];bool cmp( Node a, Node b ) { if( a.x<b.x ) {原创 2017-12-05 16:27:33 · 217 阅读 · 0 评论 -
[UVA-147] Dollars
类型转换:a = int (100*ta+0.5) 防止精度丢失.......因为这个WA了两次#include#include#include#includeusing namespace std;const int maxn = 30000 + 10;long long dp[maxn];int P[12] = {0,5,10,20,50,100,200,原创 2017-12-07 16:50:01 · 218 阅读 · 0 评论 -
[HDU-1114]Piggy-Bank
完全背包#include#include#include#includeusing namespace std;const int maxn = 10000 + 22;const int inf = 0x3f3f3f3f;int p[maxn], w[maxn];int dp[maxn];int main() { int T; cin >> T; whil原创 2017-12-18 16:37:52 · 213 阅读 · 0 评论