随笔分类 - Codeforces
摘要:D. Yet Another Inversions Problem You are given a permutation of odd integers from to and a permutation $q_0, q
阅读全文
摘要:G2. Light Bulbs (Hard Version) The easy and hard versions of this problem differ only in the constraints on . In the hard version, the sum of value
阅读全文
摘要:E. Physical Education Lessons This year Alex has finished school, and now he is a first-year student of Berland State University. For him it was a tot
阅读全文
摘要:D. Array Collapse You are given an array , where all elements are distinct. You can perform several (possibly zero) operations
阅读全文
摘要:G. Lights In the end of the day, Anna needs to turn off the lights in the office. There are lights and light switches, but their operation sch
阅读全文
摘要:E. Good Triples Given a non-negative integer number (). Let's say a triple of non-negative integers is good if $a + b + c = n
阅读全文
摘要:D. Robot Queries There is an infinite -dimensional grid. Initially, a robot stands in the point . The robot can execute four commands: U —
阅读全文
摘要:E. Permutation Sorting You are given a permutation of size . We call an index good if 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 . 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 . You are given an
阅读全文
摘要:D. Small GCD Let , , and be integers. We define function as follows: Order the numbers , , in such a way that $a \le
阅读全文
摘要:D. Ones and Twos You are given a -indexed array of length where each element is or . Process queries of the following two types:
阅读全文
摘要:D. Letter Picking Alice and Bob are playing a game. Initially, they are given a non-empty string , consisting of lowercase Latin letters. The lengt
阅读全文
摘要:F. A Growing Tree You are given a rooted tree with the root at vertex , initially consisting of a single vertex. Each vertex has a numerical value,
阅读全文
摘要:D. Absolute Beauty Kirill has two integer arrays and of length . 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 distinct integers from to in
阅读全文
摘要:D. Score of a Tree You are given a tree of nodes, rooted at . Every node has a value of either or at time . At any integer time $t
阅读全文
摘要:D. Counting Factorizations The prime factorization of a positive integer is the unique way to write it as $\displaystyle m=p_1^{e_1}\cdot p_2^{e_2
阅读全文