上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 36 下一页
摘要: "orz" cpp include include using namespace std; typedef long long ll; int n, m, k, C[105][105], u[105], r[105], g[105]; const int mod=1e9+7; int ksm(in 阅读全文
posted @ 2018-04-19 13:58 poorpool 阅读(294) 评论(0) 推荐(0) 编辑
摘要: "too hard" cpp include include using namespace std; int n, d, m, uu, vv, hea[500005], cnt, w[500005], f[500005][22], g[500005][22]; bool vis[500005]; 阅读全文
posted @ 2018-04-19 07:59 poorpool 阅读(260) 评论(0) 推荐(0) 编辑
摘要: trie 树思想运用到主席树上 "orz" cpp include include using namespace std; int n, m, a[200005], cnt, rot[200005], bb, xx, uu, vv; struct Node{ int l, r, sum; }nd[ 阅读全文
posted @ 2018-04-18 18:46 poorpool 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 神tm st表+并查集 cpp include include include using namespace std; typedef long long ll; int n, m, a, b, c, d, fa[19][100005]; const int mod=1000000007; int 阅读全文
posted @ 2018-04-17 20:54 poorpool 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 点分治+线性基 (为了这六个字窝调了一下午一晚上QAQ cpp include include include include include using namespace std; typedef long long ll; int n, uu, vv, m, hea[20005], cnt, 阅读全文
posted @ 2018-04-17 19:54 poorpool 阅读(188) 评论(0) 推荐(0) 编辑
摘要: "……" cpp include include include include include using namespace std; typedef pair par; typedef long long ll; int s[510005][26], n, len, cnt, idx[5100 阅读全文
posted @ 2018-04-17 10:12 poorpool 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 真的是裸背包啊…… cpp include include using namespace std; typedef long long ll; int n, k[125], c[125], sum[125]; ll m, dp[125][240795]; int main(){ cin n m; 阅读全文
posted @ 2018-04-17 08:34 poorpool 阅读(157) 评论(0) 推荐(0) 编辑
摘要: "ref" cpp include include include include using namespace std; typedef long long ll; int ua, ub, uc, ud, n, m, a[50005], chu[50005], blc, bel[50005], 阅读全文
posted @ 2018-04-17 07:59 poorpool 阅读(95) 评论(0) 推荐(0) 编辑
摘要: "problem" 很妙啊……发现状态转移矩阵每一行都可以由上一行平移得到,每次只算第一行然后平移,$O(n^3)$ 就变成了 $O(n^2)$。 cpp include include using namespace std; int n, k; struct Matrix{ int num[20 阅读全文
posted @ 2018-04-16 16:48 poorpool 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 枚举右端点,然后看左端点合法情况。 先预处理每个颜色 $i$ 的最大出现位置 $max_i$ 和最小出现位置 $min_i$。对于枚举右端点在一个位置 $i$,凡是 $max_k i$ 的颜色 $k$ 都是不能要的。那么要满足右端点往右都合法,就要找出一个 $j i$ 这样的最大的 $j$。那么左端 阅读全文
posted @ 2018-04-16 14:48 poorpool 阅读(383) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 36 下一页