Round

Codeforces Round #851 (Div. 2) A-E

比赛链接 A 题意 给一串只包含 $1,2$ 的数,找到最小的 $k$ 使得 $\prod_{i=1}^k a_i = \prod_{i=k+1}^n a_i$ 。 题解 知识点:枚举。 因为只有 $1,2$ ,所以考虑左右两边 $2$ 的个数即可。 时间复杂度 $O(n)$ 空间复杂度 $O(n) ......
Codeforces Round 851 A-E Div

Codeforces Round #844 (Div.1 + Div.2) CF 1782 A~F 题解

点我看题 A. Parallel Projection 我们其实是要在这个矩形的边界上找一个点(x,y),使得(a,b)到(x,y)的曼哈顿距离和(f,g)到(x,y)的曼哈顿距离之和最小,求出最小值之后加h就是答案了,因为我们不可能在竖着的墙面上来回走,只可能走一次。进一步发现我们在上底面和下底面 ......
题解 Codeforces Div Round 1782

Codeforces Round #844 (Div. 1 + Div. 2, based on VK Cup 2022 - Elimination Round) A-D

比赛链接 A 题意 设计一条线路要贴着6个墙面走,从 $(a,b)$ 到 $(f,g)$ ,线路长度最短。 题解 知识点:模拟。 分类取最短即可。 时间复杂度 $O(1)$ 空间复杂度 $O(1)$ 代码 #include <bits/stdc++.h> #define ll long long u ......
Round Elimination Codeforces Div based

Codeforces Round #846 (Div. 2) A-E

比赛链接 A 题意 给 $n$ 个正整数,找到三个数,使得他们的和为奇数,输出他们的下标。 题解 知识点:贪心。 找到三个奇数或者一个奇数两个偶数即可,其他情况无解。 时间复杂度 $O(n)$ 空间复杂度 $O(n)$ 代码 #include <bits/stdc++.h> using namesp ......
Codeforces Round 846 A-E Div
共1294篇  :44/44页 首页上一页44下一页尾页