随笔分类 - 算法-构造
摘要:洛谷 U141097 喂猫自动机 洛谷传送门 题目背景 众所周知,机房的大哥是只猫…… 题目描述 机房的猫猫自从常住在这里之后,引来了很多小猫来吃饭,为了方便地给小猫们投食,我们在树上模拟出了喂猫自动机。 小猫来吃饭的路径是一个树形结构。一共有 kk 只小猫,在小猫移动之前你可以任意安排他们的位置,
阅读全文
摘要:CF1311E Construct the Binary Tree 洛谷传送门 题目描述 You are given two integers nn and dd . You need to construct a rooted binary tree consisting of nn vertic
阅读全文
摘要:CF1141G Privatization of Roads in Treeland 洛谷传送门 题目描述 Treeland consists of nn cities and n-1n−1 roads. Each road is bidirectional and connects two dis
阅读全文
摘要:洛谷 P6863 [RC-03] 上下求索 洛谷传送门 题目描述 有一个关于 x_i(i∈{1,2,3,...,n},x_i∈\mathbb)x**i(i∈{1,2,3,...,n},x**i∈R) 的 nn 元二次方程:\(\sum_{i=1}^na_ix_i^2+\sum_{i=1}^{n-1}
阅读全文
摘要:洛谷 P6852 Mex 洛谷传送门 题目描述 小 G 曾经有一个 00 到 nn 的排列(下标从 00 开始),但他忘记了这个排列。 现在他想把这个排列找回来,他努力地回想,只能回想起关于这个排列的 mm 条信息,每条信息形如 (l,r,val)(l,r,val),表示区间 [l,r][l,r]
阅读全文