随笔分类 - CF
摘要:Your company was appointed to lay new asphalt on the highway of length nn. You know that every day you can either repair one unit of the highway (lay
阅读全文
摘要:Bessie the cow has just intercepted a text that Farmer John sent to Burger Queen! However, Bessie is sure that there is a secret message hidden inside
阅读全文
摘要:Suppose you are performing the following algorithm. There is an array v1,v2,…,vnv1,v2,…,vn filled with zeroes at start. The following operation is app
阅读全文
摘要: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 the
阅读全文
摘要:Skier rides on a snowy field. Its movements can be described by a string of characters 'S', 'N', 'W', 'E' (which correspond to 11 meter movement in th
阅读全文
摘要: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
阅读全文
摘要:You are given an array aa of length nn and array bb of length mm both consisting of only integers 00 and 11. Consider a matrix cc of size n×mn×m forme
阅读全文
摘要:Polycarp wants to assemble his own keyboard. Layouts with multiple rows are too complicated for him — his keyboard will consist of only one row, where
阅读全文
摘要:output standard output You are given a tree consisting of nn nodes. You want to write some labels on the tree's edges such that the following conditio
阅读全文
摘要:This is the easy version of the problem. The difference is the constraint on the sum of lengths of strings and the number of test cases. You can make
阅读全文
摘要:You have an array aa of length nn. For every positive integer xx you are going to perform the following operation during the xx-th second: Select some
阅读全文
摘要:For the multiset of positive integers s={s1,s2,…,sk}s={s1,s2,…,sk}, define the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of ss as
阅读全文
摘要:Denis was very sad after Nastya rejected him. So he decided to walk through the gateways to have some fun. And luck smiled at him! When he entered the
阅读全文
摘要:Pay attention to the non-standard memory limit in this problem. In order to cut off efficient solutions from inefficient ones in this problem, the tim
阅读全文
摘要:For some binary string ss (i.e. each character sisi is either '0' or '1'), all pairs of consecutive (adjacent) characters were written. In other words
阅读全文
摘要: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 of
阅读全文
摘要:The map of Bertown can be represented as a set of nn intersections, numbered from 11 to nn and connected by mm one-way roads. It is possible to move a
阅读全文
摘要:Dreamoon likes sequences very much. So he created a problem about the sequence that you can't find in OEIS: You are given two integers d,md,m, find th
阅读全文
摘要:Writing light novels is the most important thing in Linova's life. Last night, Linova dreamed about a fantastic kingdom. She began to write a light no
阅读全文
摘要:A permutation of length nn is an array p=[p1,p2,…,pn]p=[p1,p2,…,pn], which contains every integer from 11 to nn (inclusive) and, moreover, each number
阅读全文

浙公网安备 33010602011771号