正文
增加 19 行删除 0 行
204 行未改动全部展开205206207208204 行未改动全部展开[P5656 【模板】二元一次不定方程 (exgcd)](https://www.luogu.com.cn/problem/P5656)[P1495 【模板】中国剩余定理(CRT)/ 曹冲养猪](https://www.luogu.com.cn/problem/P1495)[P4777 【模板】扩展中国剩余定理(EXCRT)](https://www.luogu.com.cn/problem/P4777)[P3846 【模板】BSGS / [TJOI2007] 可爱的质数](https://www.luogu.com.cn/problem/P3846)204 行未改动全部展开205206207208209210211212213214215216217218219220221222223224225226227204 行未改动全部展开[P5656 【模板】二元一次不定方程 (exgcd)](https://www.luogu.com.cn/problem/P5656)[P1495 【模板】中国剩余定理(CRT)/ 曹冲养猪](https://www.luogu.com.cn/problem/P1495)[P4777 【模板】扩展中国剩余定理(EXCRT)](https://www.luogu.com.cn/problem/P4777)[P3846 【模板】BSGS / [TJOI2007] 可爱的质数](https://www.luogu.com.cn/problem/P3846)## D14[P1450 [HAOI2008] 硬币购物](https://www.luogu.com.cn/problem/P1450)先当完全背包跑一遍dp,然后直接容斥就行了。[P6076 [JSOI2015] 染色问题](https://www.luogu.com.cn/problem/P6076)## D15[CF343D Water Tree](https://www.luogu.com.cn/problem/CF343D)操作1只会对v的子树有影响,操作2只会对子树中含v的有影响。开两棵线段树,一棵维护差分,一棵是正常值,带一个时间戳,取时间戳最新的状态即可。[P2824 [HEOI2016/TJOI2016] 排序](https://www.luogu.com.cn/problem/P2824)考虑二分第q位的值,将>=x的值都设为1,其他的设为0,然后线段树跑一遍操作,若第q位为一,尝试更打,否则尝试更小,单次check复杂度 $O(n \log n)$,总复杂度 $O(n \log^2 n)$[P3567 [POI 2014] KUR-Couriers](https://www.luogu.com.cn/problem/P3567)开一棵主席树,二分即可。[P1712 [NOI2016] 区间](https://www.luogu.com.cn/problem/P1712)考虑双指针维护长度在[l,r]之间的线段的最大覆盖次数,开一棵线段树维护区间加和全局max即可,时间复杂度 $O(n \log n)$