684

Codeforces Round 684 (Div. 2) B. Sum of Medians

定义 \(median\) 是一个非降序数组中第 \(\lceil \frac{n}{2} \rceil\) 的数。数组从 \(1\) 开始标号。 给两个数 \(n\) 和 \(k\) ,并给出一个长为 \(nk\) 的数组 \(a\) 。 需要分出为 \(k\) 个大小为 \(n\) 的数组,每个 ......
Codeforces Medians Round 684 Div

CF1440 Codeforces Round 684 (Div. 2)

CF1440A Buy the String 每个点有两种决策,要么选当前的字符,要么选跟当前字符不同的字符,取个较小值相加。 #include<iostream> #include<cstdio> using namespace std; const int N=1005; int T; int ......
Codeforces Round 1440 684 Div

684. 冗余连接(并查集 )

树可以看成是一个连通且 无环 的 无向 图。 给定往一棵 n 个节点 (节点值 1~n) 的树中添加一条边后的图。添加的边的两个顶点包含在 1 到 n 中间,且这条附加的边不属于树中已存在的边。图的信息记录于长度为 n 的二维数组 edges ,edges[i] = [ai, bi] 表示图中在 a ......
冗余 684
共3篇  :1/1页 首页上一页1下一页尾页