随笔分类 - 算法基础—前缀和/差分
摘要:Phoenix has decided to become a scientist! He is currently investigating the growth of bacteria. Initially, on day 11, there is one bacterium with mas
阅读全文
摘要:You are given an array aa consisting of nn integers (it is guaranteed that nn is even, i.e. divisible by 22 ). All aiai does not exceed some integer k
阅读全文
摘要:题目描述 The only difference between easy and hard versions is constraints. You are given a sequence a a a consisting of n n n positive integers. Let's de
阅读全文
摘要:Eugene likes working with arrays. And today he needs your help in solving one challenging task. An array cc is a subarray of an array bb if cc can be
阅读全文
摘要:题目描述 对一个给定的自然数MMM,求出所有的连续的自然数段,这些连续的自然数段中的全部数之和为MMM。 例子:1998+1999+2000+2001+2002=100001998+1999+2000+2001+2002 = 100001998+1999+2000+2001+2002=10000,所
阅读全文
摘要:Tanya wants to go on a journey across the cities of Berland. There are nn cities situated along the main railroad line of Berland, and these cities ar
阅读全文
摘要:You want to perform the combo on your opponent in one popular fighting game. The combo is the string ss consisting of nn lowercase Latin letters. To p
阅读全文