上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 45 下一页
摘要: 暴力 直接暴力枚举区间,并且逐个判断 #include <iostream> #include <stdio.h> #include <algorithm> #include <string.h> #include <string> #include <cmath> #define R(x) x = 阅读全文
posted @ 2024-04-08 10:51 Gold_stein 阅读(45) 评论(0) 推荐(0)
摘要: 问题转化 很容易就能把原问题转化成: 求满足 Max-Min = r-l的区间个数 暴力解法 根据上面得到的性质,我们可以暴力枚举区间,来判断当前区间是否满足性质 #include <iostream> #include <stdio.h> #include <algorithm> #include 阅读全文
posted @ 2024-04-07 17:32 Gold_stein 阅读(19) 评论(0) 推荐(0)
摘要: 这道题是 P8600 [蓝桥杯 2013 省 B] 连号区间数 的前置知识 #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <cmath> #define R(x) x = 阅读全文
posted @ 2024-04-07 16:54 Gold_stein 阅读(7) 评论(0) 推荐(0)
摘要: #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <cmath> #include <string.h> #define R(x) x = read() #define For 阅读全文
posted @ 2024-04-03 22:11 Gold_stein 阅读(30) 评论(0) 推荐(0)
摘要: #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <cmath> #include <string.h> #define R(x) x = read() #define For 阅读全文
posted @ 2024-04-03 22:03 Gold_stein 阅读(7) 评论(0) 推荐(0)
摘要: 思路 状压+优化 代码 #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <cmath> #include <string.h> #define R(x) x = read() 阅读全文
posted @ 2024-04-03 11:49 Gold_stein 阅读(20) 评论(0) 推荐(0)
摘要: 啊米诺斯1 啊米诺斯 啊米诺斯2 啊米诺斯 阅读全文
posted @ 2024-04-03 10:40 Gold_stein 阅读(136) 评论(0) 推荐(0)
摘要: 1.首先想到的做法 设up_len[i]为以a[i]为结尾的最长不下降子序列的长度,down_len[i]表示以a[i]为开始的最长不下降子序列的长度。 在求pre的过程中记录下额外信息:down_pre[i]表示在求down_len[i]的过程中,i是由哪个点转移过来的; 得到dp的转移方程: i 阅读全文
posted @ 2024-04-03 10:35 Gold_stein 阅读(186) 评论(0) 推荐(0)
摘要: 注意: 这道题不能像小国王那样,预处理出一个useful数组,存储所有可用的状态: for(int i = 2; i <= m + 1; i++) for(int j = 0; j < 1<<n; j++) { f[i&1][j] = 0; for(int k:Trans[j]) f[i][j] + 阅读全文
posted @ 2024-04-01 21:32 Gold_stein 阅读(26) 评论(0) 推荐(0)
摘要: 线性状压DP #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <cmath> #include <vector> #define R(x) x = read() #defin 阅读全文
posted @ 2024-04-01 19:11 Gold_stein 阅读(16) 评论(0) 推荐(0)
上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 45 下一页