摘要: 题目链接 考虑二分,每次 check 是否存在大于等于 \(m\) 条树上不交的链满足链长 \(\ge\) \(x\) 。 性质:对于以 \(x\) 为根的子树,至多存在一条一个端点在 \(x\) 的子树内,另一个端点在 \(x\) 子树外的路径。 那么意味着我们处理出以 \(x\) 为根的子树内的 阅读全文
posted @ 2021-09-15 19:01 Themaxmaxmax 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 题目链接 欧拉定理: \(a^{\varphi(m)} \equiv 1 \pmod m\) 推论 \(1\) :\(a^{\varphi(p-1)}\equiv 1 \pmod p\) ,其中 \(p\) 是质数(费马小定理)。 推论 \(2\) :若 \(a\perp m\) ,那么 \(a^{ 阅读全文
posted @ 2021-09-15 13:30 Themaxmaxmax 阅读(33) 评论(0) 推荐(0) 编辑
摘要: inline int read(){ int s=0,f=1;char ch=getchar(); while(!isdigit(ch)) {if(ch=='-') f=-1;ch=getchar();} while(isdigit(ch)) s=s*10+ch-'0',ch=getchar(); 阅读全文
posted @ 2021-09-15 12:52 Themaxmaxmax 阅读(20) 评论(0) 推荐(0) 编辑