上一页 1 2 3 4 5 6 7 8 ··· 13 下一页
摘要: http://uoj.ac/problem/185 首先考虑一个很假的树形 DP. 设 dp[u][p] 表示考虑了以 u 为根的这个子树, 并且根映射到原图的 p 点. 这个显然可以 O(n3) 转移, 但是会有不同的点可能映射到同一个点. 于是考虑容斥.求出 dp(S) 表示映射的点集至多为 S 阅读全文
posted @ 2018-01-07 15:06 Stump 阅读(164) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std; typedef long long ll; const int mod=998244353; int a[2002][2002]; int b[2002][2002]; int n,m; inline int fp(int a,int b){ int ... 阅读全文
posted @ 2018-01-05 22:30 Stump 阅读(145) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=3569 先dfs出一棵搜索树,对于非树边给它rand一个边权,然后对于树边的边权等于它被覆盖的非树边的异或和 对于删去的k边,若存在非空子集的异或和为0,说明图不连通,这个可以线性基搞搞 阅读全文
posted @ 2018-01-05 19:45 Stump 阅读(185) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=3224 由于平衡树不太会写,就写棵线段树凑合着就开棵值域线段树,添加/删除,就是在包含改数的区间节点+1/-1询问某数的排名时,就是经过右节点时,把左边子树的值加上询问某排名的数时,就是类似求kth时的 阅读全文
posted @ 2017-12-28 19:47 Stump 阅读(187) 评论(0) 推荐(0) 编辑
摘要: https://loj.ac/problem/2291 在Tire树套vector上乱搞一波 如何二分查找时间 阅读全文
posted @ 2017-12-27 15:15 Stump 阅读(341) 评论(0) 推荐(0) 编辑
摘要: BZOJ1588 http://www.lydsy.com/JudgeOnline/problem.php?id=1588 splay维护一下前驱后继 或者写棵值域线段树冷静一下 阅读全文
posted @ 2017-12-26 23:01 Stump 阅读(228) 评论(0) 推荐(0) 编辑
摘要: luogu3389 https://www.luogu.org/problemnew/show/3389 板子题 BZOJ1013 http://www.lydsy.com/JudgeOnline/problem.php?id=1013 然后用1~n式减去(n+1)式,得到n个式子,x2和r2均被消 阅读全文
posted @ 2017-12-25 21:11 Stump 阅读(133) 评论(0) 推荐(0) 编辑
摘要: #define DEFAULT_CAPACITY 3 typedef int Rank; class Fib { private: int f, g; public: Fib( int n ) { f = 1; g = 0; while( g class Vector { protected: Rank _size; int _capacity; T* _elem; ... 阅读全文
posted @ 2017-12-25 16:20 Stump 阅读(144) 评论(0) 推荐(0) 编辑
摘要: BZOJ3231 http://www.lydsy.com/JudgeOnline/problem.php?id=3231 luogu2461 https://www.luogu.org/problemnew/show/2461 这题代码在本地过编译,但在BZOJ过不了编译,只好在luogu上交 大 阅读全文
posted @ 2017-12-24 21:25 Stump 阅读(369) 评论(0) 推荐(0) 编辑
摘要: BZOJ3027 http://www.lydsy.com/JudgeOnline/problem.php?id=3027 显而易见 母函数是这坨玩意 所以总数不超过b的方案,对于这一坨 我们暴力枚举一个kxy 那么它对ans的贡献为 复杂度O(2n*n) BZOJ3028 http://www.l 阅读全文
posted @ 2017-12-22 11:30 Stump 阅读(258) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 13 下一页