摘要:
$\mathcal Link. \(n\) 个公司,每个公司可能独立或者附属于另一个公司。初始时,每个公司附属于 \(a_i\)(\(a_i=-1\) 表示该公司独立)。不存在两级及以上的附属关系。每次事件随机选取两个独立的公司,使其中一个公司所拥有的附属公司全部独立,并且该公司成为另一个公司的附属 阅读全文
posted @ 2020-08-05 19:47
Rainybunny
阅读(118)
评论(0)
推荐(0)
摘要:
$\mathcal Link. 给定 \(n,k\),求 \(0\le b\le a\le n\) 的 \(\binom{a}{b}\) 的前 \(k\) 大。 \(n\le10^6\),\(k\le10^5\)。 $\mathcal 注意到 \(\binom{a}{b}<\binom{a+1}{b 阅读全文
posted @ 2020-08-05 17:33
Rainybunny
阅读(132)
评论(0)
推荐(0)
摘要:
$\mathcal Link. 给你 \(n\) 种颜色的球,每个球有 \(k\) 个,把这 \(n\times k\) 个球排成一排,把每一种颜色的最左边出现的球涂成白色(初始球不包含白色),求有多少种不同的颜色序列。对 $10^9+7$ 取模。 \(n,k\le2000\)。 $\mathcal 阅读全文
posted @ 2020-08-05 17:21
Rainybunny
阅读(168)
评论(0)
推荐(0)
摘要:
$\mathcal Link. 给定一棵 \(n\) 个点的树,其中 $2|n$,你需要把这些点两两配对,并把每对点间的路径染色。求使得所有边被染色的方案数,对 $10^9+7$ 取模。 \(n\le5000\)。 $\mathcal 容斥,令 \(f(S)\) 表示钦定边集 \(S\) 全部为被覆 阅读全文
posted @ 2020-08-05 17:04
Rainybunny
阅读(88)
评论(0)
推荐(0)
摘要:
$\mathcal Link. 给定一棵 \(n\) 个点的树和 \(q\) 次加边操作。求出每次操作后,满足 \(u,v,w\) 互不相等,路径 \((u,w)\) 与 \((v,w)\) 无重复边的有序三元组 \((u,v,w)\) 的个数。 \(n,q\le10^5\)。 $\mathcal 阅读全文
posted @ 2020-08-05 16:31
Rainybunny
阅读(158)
评论(0)
推荐(0)
摘要:
$\mathcal Link. 给定一棵 \(n\) 个结点的树,边有边权,对于每个整数 \(x\in[0,n)\),求出最少的删边代价使得任意结点度数不超过 \(x\)。 \(n\le2.5\times10^5\)。 $\mathcal 从单个询问入手,设此时 \(x\) 为常数,就有一个简单的树 阅读全文
posted @ 2020-08-05 16:14
Rainybunny
阅读(152)
评论(0)
推荐(0)
摘要:
$\mathcal Link. 给一棵 \(n\) 个点的树,从某个点出发,遍历时必须走到已经走过的连通块所邻接的编号最小的结点。求从每个点出发,走到 $1$ 号结点所需额外走的结点(即走到块的大小 \(-1\))。 \(n\le2\times10^5\)。 $\mathcal 把 $1$ 提为根, 阅读全文
posted @ 2020-08-05 08:19
Rainybunny
阅读(138)
评论(0)
推荐(0)
摘要:
$\mathcal Link. 给定数列 \(\{a_n\}\),求排列 \(\{p_n\}\) 的个数,使得 \((\forall i\in[1,n))(a_{p_i}a_{p_{i+1}}\not=k^2)\),其中 \(k\in\mathbb N\)。 $\mathcal 首先消掉每个数的平方 阅读全文
posted @ 2020-08-05 08:12
Rainybunny
阅读(98)
评论(0)
推荐(0)