codeforces题解
文章平均质量分 93
ABCZ168
这个作者很懒,什么都没留下…
展开
-
CF1513A Array and Peaks
A sequence of nnn integers is called a permutation if it contains all integers from 111 to nnn exactly once.Given two integers nnn and kkk , construct a permutation aaa of numbers from 111 to nnn which has exactly kkk peaks. An index iii of an array aaa of原创 2023-08-16 10:31:23 · 77 阅读 · 1 评论 -
CF1516B AGAGA XOOORRR
Baby Ehab is known for his love for a certain operation. He has an array aaa of length nnn , and he decided to keep doing the following operation on it:Now he asks you if he can make all elements of the array equal. Since babies like to make your life hard原创 2023-08-16 10:24:37 · 83 阅读 · 1 评论 -
CF1485B Replace and Keep Sorted
Given a positive integer kkk , two arrays are called kkk -similar if:You are given an integer kkk , a strictly increasing array aaa and qqq queries. For each query, you are given two integers li≤ril_i \leq r_ili≤ri . Your task is to find how many arrays原创 2023-08-16 10:13:55 · 86 阅读 · 1 评论 -
CF1743C Save the Magazines
现在正在下雨,有一些箱子上面盖着盖板(如果一个箱子上盖了盖板,那么这个箱子里的杂志就不会被雨淋),并且可以将盖在第。如果有盖子,那就考虑移动和不移动两种情况,不移动也是直接继承上一个的最大值。个箱子上(同一个盖板至多移动一次)。求不会被雨淋的杂志数量的最大值。如果没有盖子,那就直接继承上一个的最大值。个是否有盖子,没有不需要移动第。个,否则就需要移动才能加上第。个盒子的最大值,以及第。个箱子上的盖板移到第。个盒子的盖子是否移动。下面进行分类讨论即可。原创 2023-08-16 10:09:34 · 94 阅读 · 1 评论 -
CF1442A Extreme Subtraction
将此题目转化成一个差分问题。要使数组中的全部数都为。问是否可以把通过若干次操作整个序列变为全是。,所以只要差分数组的负数和的绝对值小于等于。由你自己定,并且每次操作可以不同。那么我们就可以凭借操作。,将差分数组中的负数变成。那么我们就可以凭借操作。,将差分数组中的正数变成。为多少和我们并没有关系。,那么差分数组也必须为。原创 2023-08-14 09:45:50 · 48 阅读 · 0 评论