随笔分类 - Codeforces
摘要:B. GCD Partition While at Kira's house, Josuke saw a piece of paper on the table with a task written on it. The task sounded as follows. There is an a
阅读全文
摘要:D. Fixed Prefix Permutations You are given permutations , each of length . Recall that a permutation of length is a s
阅读全文
摘要:B. Emordnilap A permutation of length is an array consisting of distinct integers from to in arbitrary order. For example, $[2,3,1,5,4
阅读全文
摘要:C. Quiz Master A school has to decide on its team for an international quiz. There are students in the school. We can describe the students using
阅读全文
摘要:D. Many Perfect Squares You are given a set of distinct positive integers. We define the squareness of an integer as the n
阅读全文
摘要:C. Equal Frequencies Let's call a string balanced if all characters that are present in it appear the same number of times. For example, "coder", "app
阅读全文
摘要:D. Friendly Spiders Mars is home to an unusual species of spiders — Binary spiders. Right now, Martian scientists are observing a colony of spider
阅读全文
摘要:C. Interesting Sequence Petya and his friend, robot Petya++, like to solve exciting math problems. One day Petya++ came up with the numbers and $x
阅读全文
摘要:B. Gardener and the Array The gardener Kazimir Kazimirovich has an array of integers . He wants to check if there are two di
阅读全文
摘要:D. Range = √Sum You are given an integer . Find a sequence of distinct integers such that for all
阅读全文
摘要:C. Almost All Multiples Given two integers and , a permutation of length is called funny if is a multiple of for
阅读全文
摘要:E. Binary Inversions You are given a binary array of length . 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 as an array of length , in which is adjacent to . Muxii has a ring rep
阅读全文
摘要:G. Restore the Permutation A sequence of numbers is called permutation if it contains all numbers from to exactly once. For example, the s
阅读全文
摘要:E. Hanging Hearts Pak Chanek has blank heart-shaped cards. Card is attached directly to the wall while each of the other cards is hanging onto
阅读全文
摘要:D. Count GCD You are given two integers and and an array of integers. For each it holds that . 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 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 c
阅读全文
摘要:D. ConstructOR You are given three integers , , and . Your task is to find any integer 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
阅读全文