上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 63 下一页
摘要: 开始读题读了半天,还是参考了大佬的博客 https://blog.csdn.net/codeswarrior/article/details/81479291 有一群屌丝,每个屌丝有个屌丝值,如果他第K个上场,屌丝值就为a[i] (k 1),因为前面有k 1个人在他前面上台,可以把几个人拉进小黑屋来 阅读全文
posted @ 2020-03-12 16:46 晴屿 阅读(86) 评论(0) 推荐(0) 编辑
摘要: ```//dp[i][j][0/1] 表示送完区间 [i, j] 后,且外卖员在 i/j 点 #include#include#include#includeusing namespace std;typedef long long ll;const int N=1100;const int inf=0x3f3f3f3f;struct node{ int x,b;}s[N];ll dp[N][N]... 阅读全文
posted @ 2020-03-12 15:22 晴屿 阅读(75) 评论(0) 推荐(0) 编辑
摘要: ```#include#includeusing namespace std;const int N=110;int dp[N][N];int w[N];int n;int main(){ cin>>n; for(int i=1;i>w[i]; memset(dp,0,sizeof dp); for(int i=1;i<n-1;i++) dp[i][i+2]=w[i]*w[i+1]*w[i+2]... 阅读全文
posted @ 2020-03-12 14:56 晴屿 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 设dp[l][r][x][y]表示区间[l,r]左端染的色是x,右端染的色是y的方案数 其中x,y取0,1,2,分别表示不染色,染红色,染蓝色 1.l+1==r,那么它们一定就是一对匹配的括号,因为我们枚举的都是合理的情况,此时,只可能有四种情况,方案数均为1,即:dp[l][r][0][1] = 阅读全文
posted @ 2020-03-12 14:41 晴屿 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 枚举起点和终点,当起点和终点匹配时,dp[start][end]=dp[start+1][end 1]+2 然后枚举中间点 阅读全文
posted @ 2020-03-12 14:13 晴屿 阅读(80) 评论(0) 推荐(0) 编辑
摘要: ```//dp[i][i]=1。也就是说每个舞会换件衣服//对于dp[i][j]://1.如果cos[i]=cos[j],dp[i][j]=dp[i][j-1],很明显i的衣服穿在最底,在j的时候就能拿出来再用//之后枚举中间点k,注意(i#include #includeusing namespace std;#define maxn 105#define inf 0x3f3f3f3fint a... 阅读全文
posted @ 2020-03-12 01:07 晴屿 阅读(64) 评论(0) 推荐(0) 编辑
摘要: 问题 A: sciorz画画 题目描述 众所周知,sciorz会画画。某天,sciorz画了一个凸多边形,这个多边形的每个顶点都有一个权值a[i]。sciorz觉得这个凸多边形不够美丽,于是他决定在n个点之间连线,最终用n-3条不相交的线将这个凸n边形分割成n-2个三角形。sciorz认为,一个三角 阅读全文
posted @ 2020-03-09 09:43 晴屿 阅读(829) 评论(0) 推荐(2) 编辑
摘要: ```#include #include #include #include #include using namespace std;const int MAXN = 250;int N; //点的个数,点的编号从1到Nbool Graph[MAXN][MAXN];int Match[MAXN];bool InQueue[MAXN],InPath[MAXN],InBlossom[MAXN];in... 阅读全文
posted @ 2020-03-07 11:51 晴屿 阅读(113) 评论(0) 推荐(0) 编辑
摘要: ```#pragma GCC optimize (3,"inline","Ofast")#include using namespace std;typedef long long ll;bool Finish_read;templateinline void read(T &x) { Finish_read=0; x=0; int f=1; char ch=getchar(); while(!i... 阅读全文
posted @ 2020-03-07 11:36 晴屿 阅读(108) 评论(0) 推荐(0) 编辑
摘要: ```#pragma GCC optimize (3,"inline","Ofast")#include using namespace std;typedef long long ll;bool Finish_read;templateinline void read(T &x) { Finish_read=0; x=0; int f=1; char ch=getchar(); while(!i... 阅读全文
posted @ 2020-03-07 11:21 晴屿 阅读(111) 评论(0) 推荐(0) 编辑
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 63 下一页