随笔分类 -  容斥原理

摘要:说明:本文用 \(\phi\) 表示欧拉函数而不用 \(\varphi\),尽管后者更为常用。\(\DeclareMathOperator{\lcm}{lcm}\) 欧拉函数 \(\phi\colon\mathbb Z_{>0}\to \mathbb Z\) 定义为 \[ \phi(n) = |\{ 阅读全文
posted @ 2021-08-18 18:07 Pat 阅读(1198) 评论(0) 推荐(0)
摘要:2.1 Inclusion-Exclusion Roughly speaking, a "sieve method" in enumerative combinatorics is a method for determining the cardinality of a set \(S\) tha 阅读全文
posted @ 2018-11-17 21:55 Pat 阅读(382) 评论(0) 推荐(0)
摘要:在集合 $[n]$ 上使用容斥原理。 固定 $i$,考虑有多少个 $j \in [n]$ 满足 $\gcd(i, j) = \gcd(a_i, a_j) = 1$,将此数目记作 $f_i$。暂时不考虑条件 $ i \le j $ 。 考虑 $[n]$ 的某些子集。$S_{x,y} := \\{ i\ 阅读全文
posted @ 2018-11-14 13:30 Pat 阅读(288) 评论(0) 推荐(0)
摘要:这篇随笔不是原创内容。 抄录 Stasys Jukna 所著 *Extremal Combinatorics* §1.6 The inclusion-exclusion principle。 The *principle of inclusion and exclusion* (sieve of E 阅读全文
posted @ 2017-10-12 15:16 Pat 阅读(494) 评论(0) 推荐(0)
摘要:时间限制:1000ms单点时限:1000ms内存限制:256MB描述现在有一棵有N个带权顶点的树,顶点编号为1,2,...,N。我们定义一条路径的次小(最小)权为它经过的所有顶点(包括起点和终点)中权值次小(最小)顶点的权值。现在给定常数c,你需要求出:存在多少个使得u<v的顶点组(u,v),满足从 阅读全文
posted @ 2016-09-02 14:48 Pat 阅读(711) 评论(0) 推荐(0)