随笔分类 - 题库—Codeforces比赛
摘要:Ayoub thinks that he is a very smart person, so he created a function f(s)f(s) , where ss is a binary string (a string which contains only symbols "0"
阅读全文
摘要:Dark is going to attend Motarack's birthday. Dark decided that the gift he is going to give to Motarack is an array aa of nn non-negative integers. Da
阅读全文
摘要:You are given three strings aa , bb and cc of the same length nn . The strings consist of lowercase English letters only. The ii -th letter of aa is a
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:You are given a string ss. Each character is either 0 or 1. You want all 1's in the string to form a contiguous subsegment. For example, if the string
阅读全文
摘要:Guy-Manuel and Thomas have an array aa of nn integers [a1,a2,…,an ]. In one step they can add 11 to any element of the array. Formally, in one step th
阅读全文
摘要:Anu has created her own function ff : f(x,y)=(x|y)−y where || denotes the bitwise OR operation. For example, f(11,6)=(11|6)−6=15−6=9. It can be proved
阅读全文
摘要:题目描述 This problem differs from one which was on the online contest. The sequence a1,a2,...,an a_{1},a_{2},...,a_{n} a1,a2,...,an is called increasi
阅读全文
摘要:There are nn monsters standing in a row numbered from 11 to nn . The ii -th monster has hihi health points (hp). You have your attack power equal to a
阅读全文
摘要:There is a robot on a coordinate plane. Initially, the robot is located at the point (0,0)(0,0) . Its path is described as a string ss of length nn co
阅读全文
摘要:Mishka wants to buy some food in the nearby shop. Initially, he has ss burles on his card. Mishka can perform the following operation any number of ti
阅读全文
摘要:You are given an array aa consisting of nn integers. In one move, you can choose two indices 1≤i,j≤n1≤i,j≤n such that i≠ji≠j and set ai:=ajai:=aj . Yo
阅读全文
摘要:You are given two integers nn and mm . Calculate the number of pairs of arrays (a,b)(a,b) such that: the length of both arrays is equal to mm ; each e
阅读全文
摘要:Oh, New Year. The time to gather all your friends and reflect on the heartwarming events of the past year... nn friends live in a city which can be re
阅读全文
摘要:There are nn friends who want to give gifts for the New Year to each other. Each friend should give exactly one gift and receive exactly one gift. The
阅读全文
摘要:There are nn Christmas trees on an infinite number line. The ii -th tree grows at the position xixi . All xixi are guaranteed to be distinct. Each int
阅读全文