摘要: 参考博客: http://immortalco.blog.uoj.ac/blog/2102 https://www.cnblogs.com/Judge/p/10475728.html 板题: https://www.luogu.com.cn/problem/P3865 注意点: 猫树的语处理的数组的 阅读全文
posted @ 2020-06-08 21:43 Cold_Chair 阅读(202) 评论(0) 推荐(0) 编辑
摘要: https://loj.ac/problem/2023 题解: 考虑生成函数做: \(\sum_{y>0} (1+x)^a*(1+x^{-1})^b [x^y]\) \(=\sum_{y>b} (1+x)^{a+b} [x^y]\) 注意到$a-b$非常小,也就是说$b$靠近$(a+b)/2$ 由组 阅读全文
posted @ 2020-06-08 20:40 Cold_Chair 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 求:\(\binom{n}{m} ~mod~p^k\) \(n,m\le 10^{18}\),\(p^k\le 10^7\)。 我们可以求出这样一个形式,即$n!=p^*y(gcd(y,p)=1)$,然后: \(\binom{n}{m}={n! \over m!*(n-m)!}\) 这样$p$的幂次 阅读全文
posted @ 2020-06-08 20:31 Cold_Chair 阅读(270) 评论(0) 推荐(0) 编辑
摘要: https://loj.ac/problem/2018 题解: 先考虑只有加点怎么做?设要加的点是第$x$大,$x-1$的右儿子和$x+1$的左儿子一定恰好有一个是空的,加到那里即可。 再模拟一下把最小值$x$给splay到根的过程,发现$x$到根的链几乎没有变,变得是:把$x$的右儿子接到$x$的 阅读全文
posted @ 2020-06-08 11:50 Cold_Chair 阅读(351) 评论(0) 推荐(0) 编辑