摘要:
Every (positive) rational number can be expressed as a ratio of two (positive) integers.However, in decimal form, rational numbers often have an infin 阅读全文
摘要:
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 ele 阅读全文
摘要:
Recall that MEX of an array is a minimum non-negative integer that does not belong to the array. Examples: for the array [0,0,1,0,2][0,0,1,0,2] MEX eq 阅读全文
摘要:
You are given string ss of length nn consisting of 0-s and 1-s. You build an infinite string tt as a concatenation of an infinite number of strings ss 阅读全文
摘要:
You are given two strings ss and tt consisting of lowercase Latin letters. Also you have a string zz which is initially empty. You want string zz to b 阅读全文
摘要:
考虑全为0的串数。我们有m个1,相当于有m+1的空隙可以用来放0。那么显然我们把这n-m个0匀着放到这m+1个空隙,可以使得每个0的部分尽可能短,进而使得全为0的子串尽可能少。 所以每个空隙放b=(n-m)/(m+1)。因为不能整除,所有有(n-m) % (m+1)个空隙实际上还要再多一个0。 如果 阅读全文
摘要:
To become the king of Codeforces, Kuroni has to solve the following problem. He is given nn numbers a1,a2,…,ana1,a2,…,an. Help Kuroni to calculate ∏1≤ 阅读全文
摘要:
VK news recommendation system daily selects interesting publications of one of nn disjoint categories for each user. Each publication belongs to exact 阅读全文
摘要:
Your task is to calculate the number of arrays such that: each array contains nn elements; each element is an integer from 11 to mm; for each array, t 阅读全文
摘要:
Nikolay has only recently started in competitive programming, but already qualified to the finals of one prestigious olympiad. There going to be nn pa 阅读全文