摘要: #include <stdio.h> #include <algorithm> #include <cstring> #include <cmath> #define inf 100000000 using namespace std; const int maxn=100000+10; int n 阅读全文
posted @ 2017-10-27 22:40 新手-周 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 貌似是最大势 见cdq论文《弦图与区间图》 #include <stdio.h> #include <algorithm> #include <cstring> #include <cmath> #include <queue> #include <vector> using namespace s 阅读全文
posted @ 2017-10-27 22:24 新手-周 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 根据题意打好标记后跑spfa,然后dp #include <stdio.h> #include <algorithm> #include <cstring> #include <cmath> #include <queue> #include <vector> using namespace std 阅读全文
posted @ 2017-10-27 22:21 新手-周 阅读(171) 评论(1) 推荐(0) 编辑
摘要: 题意:给你一个长度为n的字符串,每次你可以消去一段连续的回文子串,剩下的两端重新拼接成一个新的串,问最少需要消去多少次。 思路:这题一开始想不出,不好dp,一个明显的思路是用dp[i][j]表示消去i到j段最少要的次数,但是不知道每次消去后剩下的串的回文串情况,所以我们要换一个思路。其实题目中的回文 阅读全文
posted @ 2017-10-27 22:17 新手-周 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 直接记忆化搜(不记忆化不知道行不行)注意判断单独一个点。 #include <stdio.h> #include <algorithm> #include <cstring> #include <cmath> #include <queue> #include <vector> using name 阅读全文
posted @ 2017-10-27 00:30 新手-周 阅读(227) 评论(0) 推荐(0) 编辑