摘要:
#include<iostream> #include<algorithm> #include<cstring> #include<cstdio> using namespace std; const int N=1010; struct edge{ int start; int end; int 阅读全文
posted @ 2020-01-28 20:05
晴屿
阅读(115)
评论(0)
推荐(0)
摘要:
#include<cstdio> #include<cstring> #include<algorithm> #include<iostream> using namespace std; const int N=1010; int n; char a[N][N]; //da[i][j]是a[i][ 阅读全文
posted @ 2020-01-28 19:51
晴屿
阅读(111)
评论(0)
推荐(0)
摘要:
#include<cstdio> #include<iostream> #include<cstring> using namespace std; int n,k; int dir[4][2]={{-1,0},{1,0},{0,-1},{0,1}}; int dp[101][101],mp[101 阅读全文
posted @ 2020-01-28 18:50
晴屿
阅读(127)
评论(0)
推荐(0)
摘要:
//dp[i][j]表示第i次从左边取,第j次从右边取的价值,所以我们可以得到状态方程 //dp[i][j]=max(dp[i-1][j]+(i+j)*a[i],dp[i][j-1]+(i+j)*a[n-j+1]) (i > 0 && j > 0 ) //dp[i][0]=dp[i-1][0]+i* 阅读全文
posted @ 2020-01-28 18:39
晴屿
阅读(110)
评论(0)
推荐(0)
摘要:
#include<iostream> using namespace std ; const int N=1010; int f[N]; int a[N]; int n; int main() { cin>>n; for(int i=1; i<=n; i++) cin>>a[i]; for(int 阅读全文
posted @ 2020-01-28 18:31
晴屿
阅读(102)
评论(0)
推荐(0)
摘要:
#include<iostream> #include<stdio.h> #include<algorithm> #include<cstring> using namespace std; const int N=1010; const int M=20010; const int INF=0x3 阅读全文
posted @ 2020-01-28 18:27
晴屿
阅读(233)
评论(0)
推荐(0)
摘要:
#include <iostream> #include <algorithm> #include <string> #include <cstring> #include <cstdio> #define MAX 1005 using namespace std; int ans[MAX][MAX 阅读全文
posted @ 2020-01-28 17:15
晴屿
阅读(112)
评论(0)
推荐(0)
摘要:
#include<cstdio> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; struct node { int w, s; int index; //储存标号 } mouse[1005]; 阅读全文
posted @ 2020-01-28 16:45
晴屿
阅读(172)
评论(0)
推荐(0)
摘要:
#include<iostream> using namespace std; const int N=1e5; int T,n; int a[N],b[N]; int dp[N]; int main() { cin>>T; while(T--) { cin>>n; for(int i=1;i<=n 阅读全文
posted @ 2020-01-28 16:29
晴屿
阅读(116)
评论(0)
推荐(0)
摘要:
/*题都是有一个状态转移方程式 , 只要推出方程式就问题不大了,首 先对于gameboy来说他下一秒只能 在0~10这十一个位置移动, 而对于1~9这九个位置来说他可以移动(假设他现在的位置为x)到x+1,或者x-1,或者x; 0和10这两个位置只有两个位置可以移动, 可以用dp[t][x],t秒的 阅读全文
posted @ 2020-01-28 16:17
晴屿
阅读(103)
评论(0)
推荐(0)
摘要:
#include<iostream> #include<cstring> using namespace std; const int INF=0x3f3f3f3f; int t,e,f,n,dp[10010]; struct node { int p, w; //价值 重量 } no[10000] 阅读全文
posted @ 2020-01-28 15:49
晴屿
阅读(140)
评论(0)
推荐(0)
摘要:
#include<iostream> #include<cstring> #include<cstdio> #include<string> #include<cmath> using namespace std; const int INF=0x3f3f3f3f; const int MAXN=( 阅读全文
posted @ 2020-01-28 15:24
晴屿
阅读(119)
评论(0)
推荐(0)
摘要:
/* dp[i][j]=max(dp[i][j-1]+a[j],max(dp[i-1][k])+a[j]) (0<k<j) dp[i][j-1]+a[j]表示的是前j-1分成i组,第j个必须放在前一组里面。 max( dp[i-1][k] ) + a[j] )表示的前(0<k<j)分成i-1组,第j 阅读全文
posted @ 2020-01-28 14:46
晴屿
阅读(180)
评论(0)
推荐(0)
摘要:
#include<iostream> #include<algorithm> #include<cstring> #include<vector> using namespace std; const int INF=0x3f3f3f3f; struct node{ int l,s,h; }; ve 阅读全文
posted @ 2020-01-28 14:44
晴屿
阅读(149)
评论(0)
推荐(0)
摘要:
#include<iostream> #include<cstring> #include<cmath> #include<cstdio> #include<algorithm> #include<stack> #include<queue> using namespace std; const i 阅读全文
posted @ 2020-01-28 14:02
晴屿
阅读(99)
评论(0)
推荐(0)