随笔分类 - Codeforces
摘要:D. Robot Queries There is an infinite $2$-dimensional grid. Initially, a robot stands in the point $(0, 0)$. The robot can execute four commands: U —
阅读全文
摘要:E. Permutation Sorting You are given a permutation$^\dagger$ $a$ of size $n$. We call an index $i$ good if $a_i=i$ is satisfied. After each second, we
阅读全文
摘要:D2. Xor-Subsequence (hard version) It is the hard version of the problem. The only difference is that in this version $a_i \le 10^9$. You are given an
阅读全文
摘要:D1. Xor-Subsequence (easy version) It is the easy version of the problem. The only difference is that in this version $a_i \le 200$. You are given an
阅读全文
摘要:D. Small GCD Let $a$, $b$, and $c$ be integers. We define function $f(a, b, c)$ as follows: Order the numbers $a$, $b$, $c$ in such a way that $a \le
阅读全文
摘要:D. Ones and Twos You are given a $1$-indexed array $a$ of length $n$ where each element is $1$ or $2$. Process $q$ queries of the following two types:
阅读全文
摘要:D. Letter Picking Alice and Bob are playing a game. Initially, they are given a non-empty string $s$, consisting of lowercase Latin letters. The lengt
阅读全文
摘要:F. A Growing Tree You are given a rooted tree with the root at vertex $1$, initially consisting of a single vertex. Each vertex has a numerical value,
阅读全文
摘要:D. Absolute Beauty Kirill has two integer arrays $a_1,a_2,\ldots,a_n$ and $b_1,b_2,\ldots,b_n$ of length $n$. He defines the absolute beauty of the ar
阅读全文
摘要:G. Unusual Entertainment A tree is a connected graph without cycles. A permutation is an array consisting of $n$ distinct integers from $1$ to $n$ in
阅读全文
摘要:D. Score of a Tree You are given a tree of $n$ nodes, rooted at $1$. Every node has a value of either $0$ or $1$ at time $t=0$. At any integer time $t
阅读全文
摘要:D. Counting Factorizations The prime factorization of a positive integer $m$ is the unique way to write it as $\displaystyle m=p_1^{e_1}\cdot p_2^{e_2
阅读全文
摘要:D. Neutral Tonality You are given an array $a$ consisting of $n$ integers, as well as an array $b$ consisting of $m$ integers. Let $\text{LIS}(c)$ den
阅读全文
摘要:G. wxhtzdy ORO Tree After (finally) qualifying for the IOI 2023, wxhtzdy was very happy, so he decided to do what most competitive programmers do: try
阅读全文
摘要:E1. Doremy's Drying Plan (Easy Version) The only differences between the two versions of this problem are the constraint on $k$, the time limit and th
阅读全文
摘要:D. XOR Construction You are given $n-1$ integers $a_1, a_2, \dots, a_{n-1}$. Your task is to construct an array $b_1, b_2, \dots, b_n$ such that: ever
阅读全文
摘要:D. Counting Rhyme You are given an array of integers $a_1, a_2, \ldots, a_n$. A pair of integers $(i, j)$, such that $1 \le i < j \le n$, is called go
阅读全文
摘要:D. Doremy's Connecting Plan Doremy lives in a country consisting of $n$ cities numbered from $1$ to $n$, with $a_i$ people living in the $i$-th city.
阅读全文
摘要:E. Segment Sum You are given two integers $l$ and $r$ ($l \le r$). Your task is to calculate the sum of numbers from $l$ to $r$ (including $l$ and $r$
阅读全文
摘要:E. Time Travel Berland is a country with ancient history, where roads were built and destroyed for centuries. It is known that there always were $n$ c
阅读全文

浙公网安备 33010602011771号