![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
DP(动态规划)
1662小鱼干
这个作者很懒,什么都没留下…
展开
-
Charm Bracelet - (POJ 3624)
#include <iostream> #include <stdio.h> #include <cstring> #include <algorithm> #define MAXN 3410 #define MAXM 12885 using namespace std; int dp[MAXM]; int main() { int N,M; int W[MAXN],D[MAXN]; while(cin>>N>>M){ //..原创 2020-05-18 22:19:45 · 101 阅读 · 0 评论 -
Bone collector
#include <iostream> #include <stdio.h> #include <cstring> #include <algorithm> #define MAX 1005 using namespace std; int dp[MAX][MAX]; struct bone{ int volume; int value; }s[MAX]; int main() { int t; cin>>t; while(t--...原创 2020-05-18 21:54:18 · 147 阅读 · 0 评论 -
The triangle
代码: #include <iostream> #include <stdio.h> #include <algorithm> using namespace std; int dp[105][105]; int main() { int n; while(cin>>n){ for(int i=1;i<=n;i++){ for(int j=1;j<=i;j++){ cin>>dp[i][j]; } }..原创 2020-05-18 21:47:34 · 89 阅读 · 0 评论 -
Common Subsequence
Problem Description A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = <x1, x2, …, xm> another sequence Z = <z1, z2, …, ...原创 2020-04-13 15:42:57 · 60 阅读 · 0 评论 -
Super Jumping! Jumping! Jumping!(非连续递增序列和)
Sample Input 3 1 3 2 4 1 2 3 4 4 3 3 2 1 0 Sample Output 4 10 3 #include<stdio.h> #include<string.h> #include<iostream> #include<algorithm> using namespace std; #define MAX 10...原创 2020-04-17 17:21:20 · 96 阅读 · 0 评论 -
搬寝室
#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #define MAX 2005 using namespace std; int a[MAX]; int dp[MAX][MAX]; int main() { int n,k; while(...原创 2020-04-21 21:39:42 · 180 阅读 · 0 评论