倍增
文章平均质量分 86
倍增
_sky123_
这个作者很懒,什么都没留下…
展开
-
The 2021 ICPC Asia Regionals Online Contest (II) C.Range Subsequence
The following describes four notations related to this problem. Sequence s=[s1,…,sm]s=[s_1 ,…,s_m]s=[s1,…,sm] is a subsequence of sequence t=[t1,…,tn]t=[t_1,…,t_n ]t=[t1,…,tn] if there exists index sequence [a1,…,am][a_1,…,a_m][a1,…,am] such th原创 2021-09-28 14:35:33 · 165 阅读 · 0 评论 -
牛客练习赛80 D.分组
题目链接 题目描述 你有一张 nnn 个点的有向图,我们定义一个有向图的重量是该图内所有强连通分量大小(即其节点数量)的平方和。 有 mmm 条边,依次编号为 1,2,…,m1,2,…,m1,2,…,m 。现在需要将其分成若干组,满足: 每一组内边的编号连续; 对于每一组边,将其加入原图内得到 GGG,需要满足 GGG 的重量不能超过 kkk,其中 kkk 是给定的阈值。 请求出最小分组的数量。 输入描述: 一行三个整数 n,m,kn,m,kn,m,k,分别表示图中节点数,给出的边数和阈值的大小; 接下来原创 2021-04-13 19:28:31 · 195 阅读 · 1 评论 -
Educational Codeforces Round 87 (Rated for Div. 2) G. Find a Gift
题目链接 This is an interactive problem. Don’t forget to flush output after printing queries using cout.flush() or fflush(stdout) in C++ or similar functions in other programming languages. There are nnn gift boxes in a row, numbered from 111 to nnn from left原创 2021-02-23 19:30:16 · 195 阅读 · 0 评论 -
Codeforces Round #703 (Div. 2) F. Pairs of Paths
题目链接 You are given a tree consisting of nnn vertices, and mmm simple vertex paths. Your task is to find how many pairs of those paths intersect at exactly one vertex. More formally you have to find the number of pairs (i,j)(i, j)(i,j) (1≤i<j≤m)(1 \leq i原创 2021-02-19 20:43:53 · 274 阅读 · 0 评论 -
Ancient Distance
链接:https://ac.nowcoder.com/acm/contest/5669/A 来源:牛客网 题目描述 As a member of Coffee Chicken, ZYB is a boy with excellent data structure skills. Consider the following problem: Give a rooted tree with N{N}N vertices. Vertices are numbered from 1{1}1 to N{N}N, a原创 2020-08-01 07:55:32 · 290 阅读 · 0 评论 -
旅游
皮皮准备去旅游,共有nnn个景点可以选择,景点编号为111~nnn,每个景点都有一个“美观值”aia_iai。共有mmm次查询,对于第i次查询,皮皮将从xix_ixi号景点开始游览,之后他会选择沿着编号递增的顺序选择游览其他景点,但是如果这个景点的美观值不大于他刚刚游览过的景点,他就会跳过这个景点。也就是说,皮皮在游览一个美观值为uuu的景点vvv后,他将游览的下一个景点是编号大于vvv、美观值大于uuu的,编号最小的景点。皮皮将一共访问yiy_iyi 个景点,请你输出他最后一个访问的景点编号,如果他原创 2020-06-06 21:33:12 · 330 阅读 · 0 评论