![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
——————组合优化(动态规划)——————
等我学会后缀自动机
侠影之谜
展开
-
Codeforces Round #646 (Div. 2) E. Tree Shuffling
#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll long long#define lrt int l,int r,int rt#define lson l,mid,rt<<1#define rson mid+1,r,rt<<1|1#defin.原创 2020-06-12 11:19:27 · 220 阅读 · 0 评论 -
CodeForces 454D Little Pony and Harmony Chest (状压DP+估界)
#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll long long#define lrt int l,int r,int rt#define lson l,m...原创 2020-04-26 07:46:46 · 148 阅读 · 0 评论 -
CodeForces 315D Sereja and Periods (思维DP)
#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll long long#define lrt int l,int r,int rt#define lson l,m...原创 2020-04-25 07:59:31 · 179 阅读 · 0 评论 -
CodeForces 270D Greenhouse Effect (DP+LIS)
#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll long long#define lrt int l,int r,int rt#define lson l,m...原创 2020-04-23 16:39:55 · 189 阅读 · 0 评论 -
CodeForces 214E Relay Race (DP+思维)
#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll long long#define lrt int l,int r,int rt#define lson l,m...原创 2020-04-19 19:35:26 · 277 阅读 · 1 评论 -
CodeForces 155C Hometask (DP+复杂做法)
#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll long long#define lrt int l,int r,int rt#define lson l,m...原创 2020-04-12 16:31:36 · 186 阅读 · 0 评论 -
CodeForces 239E World Eater Brothers (DP)
#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll long long#define lrt int l,int r,int rt#define lson l,m...原创 2020-04-09 23:26:09 · 142 阅读 · 0 评论 -
CodeForces 373E Watching Fireworks is Fun (DP+单调队列优化)
#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll long long#define lrt int l,int r,int rt#define lson l,m...原创 2020-04-05 21:26:05 · 171 阅读 · 0 评论 -
CodeForces 373D Counting Rectangles is Fun (四维DP)
#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll long long#define lrt int l,int r,int rt#define lson l,m...原创 2020-03-27 16:29:07 · 164 阅读 · 0 评论 -
HDU 6446 Tree and Permutation (树形DP经典)
Tree and Permutation Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 541 Accepted Submission(s): 182 Problem Description...原创 2018-08-26 11:13:08 · 766 阅读 · 0 评论 -
HDU 4705 Y (树形DP+计数)*
YTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2865 Accepted Submission(s): 835 Problem Description Sample Input 4 1...原创 2018-08-23 14:39:26 · 148 阅读 · 0 评论 -
HDU 6447 YJJ's Salesman (线段树优化DP)
#pragma comment(linker, "/STACK:102400000,102400000")#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define lrt ...原创 2018-08-28 08:57:58 · 212 阅读 · 0 评论 -
HDU 5532 Almost Sorted Array (LIS水题)
Almost Sorted ArrayTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 7902 Accepted Submission(s): 1835 Problem DescriptionWe are all ...原创 2018-08-28 15:27:26 · 203 阅读 · 0 评论 -
Codeforces 597D Subsequences (二维树状数组入门+DP优化) 高清重制版
For the given sequence with n different elements find the number of increasing subsequences with k + 1 elements. It is guaranteed that the answer is not greater than 8·1018.InputFirst line contain...原创 2018-08-31 14:50:09 · 386 阅读 · 0 评论 -
HDU 4681 String (LCS+暴力枚举)
StringTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 1883 Accepted Submission(s): 694 Problem DescriptionGiven 3 strings A, B, C, fi...原创 2018-08-28 21:04:43 · 186 阅读 · 0 评论 -
HDU 4616 Game (树形DP+枚举思维方法)*
GameTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 2520 Accepted Submission(s): 857 Problem Description Nowadays, there are more an...原创 2018-08-31 20:02:21 · 231 阅读 · 0 评论 -
HDU 5593 ZYB's Tree (树形DP)
ZYB's Tree Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 787 Accepted Submission(s): 265 Problem Description ZYB h...原创 2018-08-24 20:59:19 · 230 阅读 · 0 评论 -
HDU 6415 Rikka with Nash Equilibrium(计数多维DP+思维)好题。。
Rikka with Nash Equilibrium Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 1754 Accepted Submission(s): 717 Problem De...原创 2018-08-25 00:53:10 · 223 阅读 · 0 评论 -
HDU 4455 Substrings (树状数组+DP)思维好题
SubstringsTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3599 Accepted Submission(s): 1105 Problem DescriptionXXX has an array of l...原创 2018-09-01 08:44:18 · 171 阅读 · 0 评论 -
HDU 4661 Message Passing (树形DP+组合数学知识+拓扑排序计数思维)*
Message PassingTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1461 Accepted Submission(s): 541 Problem DescriptionThere are n peo...原创 2018-08-29 17:58:31 · 348 阅读 · 0 评论 -
ACM-ICPC 2018 南京赛区网络预赛 J.Sum (欧拉筛的应用+DP思维)
题目链接:https://nanti.jisuanke.com/t/30999#pragma comment(linker, "/STACK:102400000,102400000")#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(in...原创 2018-09-01 21:25:27 · 934 阅读 · 0 评论 -
ACM-ICPC 2018 南京赛区网络预赛 AC Challenge (状态压缩+暴力)
Dlsj is competing in a contest with n(0<n≤20)n (0 < n \le 20)n(0<n≤20) problems. And he knows the answer of all of these problems.However, he can submit iii-th problem if and only if he has...原创 2018-09-01 23:04:22 · 345 阅读 · 0 评论 -
HDU 5400 Arithmetic Sequence (枚举思维+计数)水题
Arithmetic Sequence Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1865 Accepted Submission(s): 817 Problem Description...原创 2018-09-02 08:55:06 · 149 阅读 · 0 评论 -
HDU 5379 Mahjong tree (树形DP+组合数学)*
Mahjong treeTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1935 Accepted Submission(s): 651 Problem DescriptionLittle sun is an arti...原创 2018-09-05 00:02:20 · 129 阅读 · 0 评论 -
ACM-ICPC 2018 南京赛区网络预赛 The writing on the wall (数学思想+DP维护)*
Feeling hungry, a cute hamster decides to order some take-away food (like fried chicken for only 303030 Yuan).However, his owner CXY thinks that take-away food is unhealthy and expensive. So she dem...原创 2018-09-02 13:37:41 · 240 阅读 · 0 评论 -
Codeforces 834D The Bakery (线段树+DP+单调性质)*
题目链接:https://cn.vjudge.net/problem/CodeForces-834D#include<bits/stdc++.h>#pragma comment(linker,"/STACK:1024000000,1024000000")using namespace std;#define debug puts("YES");#define rep(x...原创 2018-09-08 09:21:27 · 164 阅读 · 0 评论 -
HDU 5534 Partial Tree(膜大佬的。。。完全背包问题+思维)好题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5534#pragma comment(linker, "/STACK:102400000,102400000")#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,...原创 2018-09-06 06:07:30 · 130 阅读 · 0 评论 -
ACM-ICPC 2018 焦作赛区网络预赛 Mathematical Curse (简单DP+维护极值)
题目链接:https://nanti.jisuanke.com/t/31711#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x,y) scanf("%...原创 2018-09-16 08:56:38 · 421 阅读 · 0 评论 -
ACM-ICPC 2018 焦作赛区网络预赛 Transport Ship (多重背包计数+DP水题)
题目链接:https://nanti.jisuanke.com/t/31720#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x,y) scanf("%...原创 2018-09-16 10:49:02 · 204 阅读 · 0 评论 -
UVA 10465 Homer Simpson (完全背包)
题目链接:https://cn.vjudge.net/contest/255927#problem/G#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x...原创 2018-09-23 21:52:31 · 267 阅读 · 0 评论 -
UVA 10404 Bachet's Game (简单博弈DP+背包)
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1345#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#...原创 2018-09-23 23:35:34 · 220 阅读 · 0 评论 -
HDU 5406 CRB and Apple (DP+树状数组)思维好题*
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5406#include<bits/stdc++.h>#pragma comment(linker,"/STACK:1024000000,1024000000")using namespace std;#define debug puts("YES");#define rep(...原创 2018-09-14 06:11:26 · 190 阅读 · 0 评论 -
HDU 4539 郑厂长系列故事——排兵布阵 (状压思维题)*
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4539#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x,...原创 2018-09-24 10:07:16 · 288 阅读 · 0 评论 -
HDU 4529 郑厂长系列故事——N骑士问题 (状态压缩DP)*
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4529#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x,...原创 2018-09-24 21:41:03 · 351 阅读 · 0 评论 -
UVA 11137 Ingenuous Cubrency (背包水题)
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2078#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#...原创 2018-09-25 00:11:24 · 152 阅读 · 0 评论 -
51Nod - 1376 最长递增子序列的数量(树状数组+DP)*
题目链接:https://cn.vjudge.net/problem/51Nod-1376#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x,y) sca...原创 2018-09-19 17:47:32 · 357 阅读 · 0 评论 -
HDU 3001 Traveling (状压DP)*
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3001#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x...原创 2018-09-25 20:20:09 · 138 阅读 · 0 评论 -
HDU 5691 Sitting in Line(状压DP+思维建图)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5691#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x...原创 2018-09-25 22:25:19 · 338 阅读 · 0 评论 -
UVA 10313 Pay the Price (完全背包问题+读入技巧+细节)*
题目链接:https://cn.vjudge.net/problem/UVA-10313#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x,y) sca...原创 2018-09-26 00:02:23 · 218 阅读 · 0 评论 -
NewCoder 多校1 E Removal (计数DP+思维)*
题目链接:https://www.nowcoder.com/acm/contest/139/E#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x,y) ...原创 2018-10-01 21:48:18 · 131 阅读 · 0 评论