摘要: 题意: "传送门" 已知$0 include include include include include include include include include include include include using namespace std; typedef long long 阅读全文
posted @ 2019-08-16 19:20 KirinSB 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 题意: 求$x^2 \equiv a \mod p$ 的所有整数解 思路: 二次剩余定理求解。 参考: "二次剩余Cipolla's algorithm学习笔记" 板子: 代码: 阅读全文
posted @ 2019-08-16 16:22 KirinSB 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 题意: 石子合并,问最小代价 思路: GarsiaWachs,朴素做法$O(n^2)$复杂度,实际上比这个稍微小点。平衡树优化能到$O(nlogn)$。 代码: 阅读全文
posted @ 2019-08-16 15:25 KirinSB 阅读(155) 评论(0) 推荐(0) 编辑