摘要: dp[i][j][k]代表到第i个位置,第i个位置是j,k为已经选了i个数分别是那些(2进制状压) 然后:其实真正有用的状态很少,可以写记忆化搜索,我写的BFS加速 #include <iostream> #include <cstdio> #include <cstdlib> #include < 阅读全文
posted @ 2016-05-23 22:46 shuguangzw 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 分析:暴力找循环节就好了 #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <string> #include <stack> #include 阅读全文
posted @ 2016-05-23 22:40 shuguangzw 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 分析:就是给一些拓补关系,然后求最大分数,所以贪心,大的越靠前越好,小的越靠后越好 剩下的就是toposort,当然由于贪心,所以使用优先队列 #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #i 阅读全文
posted @ 2016-05-23 22:34 shuguangzw 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 老题了,附上黄学长链接一发,直接改改就AC了,http://hzwer.com/1216.html #include <cstdio> #include <iostream> #include <cstring> using namespace std; const int N=1e4+5; int 阅读全文
posted @ 2016-05-23 22:29 shuguangzw 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 枚举左端点,然后在线段树内,更新所有左边界小于当前点的区间的右端点,然后查线段树二分查第k大就好 #include <cstdio> #include <cstring> #include <algorithm> using namespace std; typedef long long LL; 阅读全文
posted @ 2016-05-23 22:22 shuguangzw 阅读(182) 评论(0) 推荐(0) 编辑