随笔分类 - 题库—Codeforces比赛
摘要:Ayush and Ashish play a game on an unrooted tree consisting of nn nodes numbered 11 to nn. Players make the following move in turns: Select any leaf n
阅读全文
摘要:Shubham has a binary string ss. A binary string is a string containing only characters "0" and "1". He can perform the following operation on the stri
阅读全文
摘要:A. Odd Selection time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Shubham has an array aa
阅读全文
摘要:During the quarantine, Sicromoft has more free time to create the new functions in "Celex-2021". The developers made a new function GAZ-GIZ, which inf
阅读全文
摘要:You've been in love with Coronavirus-chan for a long time, but you didn't know where she lived until now. And just now you found out that she lives in
阅读全文
摘要:Maria is the most active old lady in her house. She was tired of sitting at home. She decided to organize a ceremony against the coronavirus. She has
阅读全文
摘要:Due to the coronavirus pandemic, city authorities obligated citizens to keep a social distance. The mayor of the city Semyon wants to light up Gluharn
阅读全文
摘要:You are given an undirected graph without self-loops or multiple edges which consists of nn vertices and mm edges. Also you are given three integers n
阅读全文
摘要:The statement of this problem is the same as the statement of problem C1. The only difference is that, in problem C1, nn is always even, and in C2, nn
阅读全文
摘要:The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, nn is always even, and in C2, nn
阅读全文
摘要:You are given a string ss such that each its character is either 1, 2, or 3. You have to choose the shortest contiguous substring of ss such that it c
阅读全文
摘要:Polycarp has spent the entire day preparing problems for you. Now he has to sleep for at least aa minutes to feel refreshed. Polycarp can only wake up
阅读全文
摘要:Petya and Vasya are competing with each other in a new interesting game as they always do. At the beginning of the game Petya has to come up with an a
阅读全文
摘要:Young wilderness explorers set off to their first expedition led by senior explorer Russell. Explorers went into a forest, set up a camp and decided t
阅读全文
摘要:Let's define the following recurrence: an+1=an+minDigit(an)⋅maxDigit(an).an+1=an+minDigit(an)⋅maxDigit(an). Here minDigit(x)minDigit(x) and maxDigit(x
阅读全文
摘要:You are given an array aa of length nn consisting of zeros. You perform nn actions with this array: during the ii -th action, the following sequence o
阅读全文
摘要:You are given a board of size n×nn×n , where nn is odd (not divisible by 22 ). Initially, each cell of the board contains one figure. In one move, you
阅读全文
摘要:You are given two arrays aa and bb both consisting of nn positive (greater than zero) integers. You are also given an integer kk . In one move, you ca
阅读全文
摘要:You are given two integers nn and mm . You have to construct the array aa of length nn consisting of non-negative integers (i.e. integers greater than
阅读全文
摘要:There are nn models in the shop numbered from 11 to nn , with sizes s1,s2,…,sns1,s2,…,sn . Orac will buy some of the models and will arrange them in t
阅读全文