摘要: 链接 [https://vjudge.net/contest/281140 problem/P] 题意 给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 include using namespace std; i 阅读全文
posted @ 2019-01-26 20:48 ChunhaoMo 阅读(823) 评论(0) 推荐(0) 编辑
摘要: 链接 [https://vjudge.net/contest/281140 problem/D] 题意 windy定义了一种windy数。不含前导零且相邻两个数字之差至少为2的正整数被称为windy数。 windy想知道, 在A和B之间,包括A和B,总共有多少个windy数? Input 包含两个整 阅读全文
posted @ 2019-01-26 20:45 ChunhaoMo 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 大佬讲的清楚 [https://blog.csdn.net/wust_zzwh/article/details/52100392] 例子 不要62或4 l到r有多少个数不含62或者4 代码 include include include include using namespace std; in 阅读全文
posted @ 2019-01-26 20:42 ChunhaoMo 阅读(174) 评论(0) 推荐(0) 编辑
摘要: ``` include include include include using namespace std; //LCS const int MAXN = 1005; int DP[MAXN][MAXN]; int main() { string a; string b; while(cin a 阅读全文
posted @ 2019-01-26 20:36 ChunhaoMo 阅读(74) 评论(0) 推荐(0) 编辑
摘要: 优化链接 [https://blog.csdn.net/George__Yu/article/details/75896330] include include include using namespace std; int a[10010]; int dp[10010]; //LIS int m 阅读全文
posted @ 2019-01-26 20:34 ChunhaoMo 阅读(137) 评论(0) 推荐(0) 编辑
摘要: ``` #include #include using namespace std; int v[6002], w[6002], s[6002]; int f[6002]; int n, m; //多重背包 int main() { scanf("%d%d",&n,&m); for (int i = 1; i = 0; j--) for (int k =... 阅读全文
posted @ 2019-01-26 20:32 ChunhaoMo 阅读(273) 评论(0) 推荐(0) 编辑
摘要: ``` include include using namespace std; //完全背包 const int maxm=2001,maxn=101; int n,m,v,i; int c[maxn],w[maxn]; int f[maxm]; int main() { scanf("%d%d" 阅读全文
posted @ 2019-01-26 20:31 ChunhaoMo 阅读(100) 评论(0) 推荐(0) 编辑
摘要: ``` #include #include #include using namespace std; const int maxn = 2001;//, maxn = 101; int m, n; //01背包 int w[maxn], c[maxn]; int f[maxn]; int main() { int t; freopen("mdd.txt","r",stdin); sca... 阅读全文
posted @ 2019-01-26 20:27 ChunhaoMo 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 链接 [https://vjudge.net/contest/281085 problem/G] 题意 Input 测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是节点数N ( 1 include include using namespace std; const int ma 阅读全文
posted @ 2019-01-26 20:22 ChunhaoMo 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 链接 [https://vjudge.net/contest/281085 problem/D] 题意 有n个任务,有M个对先后顺序 然你输出最后的完成任务的顺序,有多种可能输出一种即可 分析 裸的拓扑排序,需要队列和vector 代码 include include include include 阅读全文
posted @ 2019-01-26 20:18 ChunhaoMo 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 链接 [https://vjudge.net/contest/281085 problem/A] 题意 n个人参加宴席,有m个信息表示a与b认识,认识有传递性, 问最后该安排多少卓使得只有相互认识的在一起吃饭。 分析 裸的带路径压缩的并查集 代码 include include using name 阅读全文
posted @ 2019-01-26 20:13 ChunhaoMo 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 链接 [https://vjudge.net/contest/281085 problem/C] 题意 一个n个点,m条边的图,开始的点是s 每次必须移动到相邻的位置,问你是否存在某个时刻所有点都可能到达 分析 图的话用邻接表vectorc存,这个非常实用 首先,如果一个图不是联通的话就不可能存在 阅读全文
posted @ 2019-01-26 20:06 ChunhaoMo 阅读(218) 评论(0) 推荐(0) 编辑