上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 31 下一页
该文被密码保护。 阅读全文
posted @ 2019-02-23 21:22 蒟蒻--lichenxi 阅读(2) 评论(0) 推荐(0) 编辑
摘要: "传送门" 这个题首先考虑什么时候是NIE 显然是存在一段$[l,r]$的人的总数 $k (r l+1+d)$ 此时显然并不好维护,毕竟不等式两边都与长度有关,长度这个因素不能忽略 拆括号之后移下项:$\sum_{i=l}^{r}v_i k k d$ 现在可以忽略长度了,左边显然就是最大连续子段和, 阅读全文
posted @ 2019-02-23 21:09 蒟蒻--lichenxi 阅读(138) 评论(0) 推荐(0) 编辑
摘要: "传送门" 权值线段树套区间线段树的裸题,加了离散化就好了 或者也可以整体二分 代码(树套树): c++ include include include include using namespace std; void read(int &x) { char ch; bool ok; for(ok 阅读全文
posted @ 2019-02-23 11:23 蒟蒻--lichenxi 阅读(113) 评论(0) 推荐(0) 编辑
摘要: "传送门" 典型的三维偏序,cdq分治 由于相同的花之间也会产生贡献,考虑将相同的花合并来做 代码: c++ include include include include using namespace std; void read(int &x) { char ch; bool ok; for( 阅读全文
posted @ 2019-02-22 17:14 蒟蒻--lichenxi 阅读(101) 评论(0) 推荐(0) 编辑
摘要: "传送门" 深入理解了一波后缀数组,这东西真的很妙诶,自己推感觉完全不现实,看来只能靠背代码了 这段时间就多敲敲,把板子记熟吧 代码: c++ include include include include using namespace std; void read(int &x) { char 阅读全文
posted @ 2019-02-22 14:20 蒟蒻--lichenxi 阅读(107) 评论(0) 推荐(0) 编辑
摘要: "传送门" 状压dp,最短路 spfa似乎特别慢 代码: 阅读全文
posted @ 2019-02-21 20:36 蒟蒻--lichenxi 阅读(130) 评论(0) 推荐(0) 编辑
摘要: "传送门" 极其简单的dp题 代码: c++ include include include using namespace std; void read(int &x) { char ch; bool ok; for(ok=0,ch=getchar(); !isdigit(ch); ch=getc 阅读全文
posted @ 2019-02-21 18:19 蒟蒻--lichenxi 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 传送门 自己的计算几何还是挺渣的呢。 其实只要考虑一下叉积的式子就可以想到前缀和了,但是显然需要按照极角序来做才能去掉绝对值 代码: #include<cstdio> #include<iostream> #include<algorithm> using namespace std; void r 阅读全文
posted @ 2019-02-21 13:46 蒟蒻--lichenxi 阅读(87) 评论(0) 推荐(0) 编辑
摘要: "传送门" 自己想的方向一直是对的,但是一直没有完全正确 我一直没发现可以缩掉一维 原本列出的dp方程是这样的 $f[i]=f[j]+1(j include include include using namespace std; void read(int &x) { char ch; bool 阅读全文
posted @ 2019-02-20 21:24 蒟蒻--lichenxi 阅读(93) 评论(0) 推荐(0) 编辑
摘要: "传送门" 考虑根节点的移动,移动到相邻节点对深度和的影响是很显然的 假设从$u$移动到$v$ 显然有$f[v]=f[u]+n 2 size[v]$ 先定下一个根节点$x$,求出$f[x]$,然后在dfs一遍进行换根转移就行了 dfs过程中更新答案 代码: c++ include include u 阅读全文
posted @ 2019-02-19 21:24 蒟蒻--lichenxi 阅读(251) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 31 下一页