随笔分类 - Codeforces
摘要:D. Range = √Sum You are given an integer $n$. Find a sequence of $n$ distinct integers $a_1, a_2, \dots, a_n$ such that $1 \leq a_i \leq 10^9$ for all
阅读全文
摘要:C. Almost All Multiples Given two integers $n$ and $x$, a permutation$^{\dagger}$ $p$ of length $n$ is called funny if $p_i$ is a multiple of $i$ for
阅读全文
摘要:E. Binary Inversions You are given a binary array$^{\dagger}$ of length $n$. You are allowed to perform one operation on it at most once. In an operat
阅读全文
摘要:B. Elimination of a Ring Define a cyclic sequence of size $n$ as an array $s$ of length $n$, in which $s_n$ is adjacent to $s_1$. Muxii has a ring rep
阅读全文
摘要:G. Restore the Permutation A sequence of $n$ numbers is called permutation if it contains all numbers from $1$ to $n$ exactly once. For example, the s
阅读全文
摘要:E. Hanging Hearts Pak Chanek has $n$ blank heart-shaped cards. Card $1$ is attached directly to the wall while each of the other cards is hanging onto
阅读全文
摘要:D. Count GCD You are given two integers $n$ and $m$ and an array $a$ of $n$ integers. For each $1 \le i \le n$ it holds that $1 \le a_i \le m$. Your t
阅读全文
摘要:D. Knowledge Cards Pak Chanek, a renowned scholar, invented a card puzzle using his knowledge. In the puzzle, you are given a board with $n$ rows and
阅读全文
摘要:E. Cactus Wall Monocarp is playing Minecraft and wants to build a wall of cacti. He wants to build it on a field of sand of the size of $n \times m$ c
阅读全文
摘要:D. ConstructOR You are given three integers $a$, $b$, and $d$. Your task is to find any integer $x$ which satisfies all of the following conditions, o
阅读全文
摘要:B. Diverse Substrings A non-empty digit string is diverse if the number of occurrences of each character in it doesn't exceed the number of distinct c
阅读全文
摘要:D. Yet Another Problem You are given an array $a$ of $n$ integers $a_1,a_2,a_3, \ldots, a_n$. You have to answer $q$ independent queries, each consist
阅读全文
摘要:C. Swap Game Alice and Bob are playing a game on an array $a$ of $n$ positive integers. Alice and Bob make alternating moves with Alice going first. I
阅读全文
摘要:C1. Sheikh (Easy version) This is the easy version of the problem. The only difference is that in this version $q=1$. You are given an array of intege
阅读全文
摘要:D. Factorial Divisibility You are given an integer $x$ and an array of integers $a_1,a_2, \dots ,a_n$. You have to determine if the number $a_1!+a_2!+
阅读全文
摘要:F. MEX vs MED You are given a permutation $p_1,p_2, \dots ,p_n$ of length $n$ of numbers $0, \dots ,n−1$. Count the number of subsegments $1 \leq l \l
阅读全文
摘要:E. FTL Monocarp is playing a video game. In the game, he controls a spaceship and has to destroy an enemy spaceship. Monocarp has two lasers installed
阅读全文
摘要:C1. Make Nonzero Sum (easy version) This is the easy version of the problem. The difference is that in this version the array can not contain zeros. Y
阅读全文
摘要:D1. Balance (Easy version) This is the easy version of the problem. The only difference is that in this version there are no "remove" queries. Initial
阅读全文
摘要:B. Ugu A binary string is a string consisting only of the characters $0$ and $1$. You are given a binary string $s_1 s_2 \dots s_n$. It is necessary t
阅读全文

浙公网安备 33010602011771号