摘要: 比赛链接:https://atcoder.jp/contests/abc170 A - Five Variables 题意 $5$ 个数中有 $1$ 个 $0$,判断是第几个。 代码 #include <bits/stdc++.h> using namespace std; int main() { 阅读全文
posted @ 2020-06-14 22:35 Kanoon 阅读(412) 评论(0) 推荐(1) 编辑
摘要: 题目链接:https://codeforces.com/contest/1364/problem/C 题意 给出大小为 $n$ 的非递减数组 $a$,构造同样大小的数组 $b$,使得对于每个 $i$,$b_1, b_2, \ldots, b_i$ 中未出现的最小正整数均为 $a_i$ 。($1 \l 阅读全文
posted @ 2020-06-14 19:05 Kanoon 阅读(278) 评论(0) 推荐(1) 编辑
摘要: 题目链接:https://codeforces.com/contest/1364/problem/B 题意 给出大小为 $n$ 的一个排列 $p$,找出子序列 $s$,使得 $|s_1-s_2|+|s_2-s_3|+\ldots+|s_{k-1}-s_k|$ 最大的同时 $k$ 尽可能地小。 题解 阅读全文
posted @ 2020-06-14 17:20 Kanoon 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://codeforces.com/contest/1364/problem/A 题意 找出大小为 $n$ 的数组 $a$ 的最长连续子数组,其元素和不被 $x$ 整除。 题解 如果数组的每个元素都被 $x$ 整除,则不存在不被 $x$ 整除的子数组 如果整个数组之和不被 $x$ 阅读全文
posted @ 2020-06-14 17:10 Kanoon 阅读(398) 评论(0) 推荐(1) 编辑