https://www.gravatar.com/avatar/8f3abece0f8608ce4b9c1e3212fd1b72?s=240&d=mp

SP8222-NSUBSTR - Substrings

SP8222-NSUBSTR - Substrings 题目: 题目描述: You are given a string S which consists of 250000 lowercase latin letters at most. We define F(x) as the maximal number of times that some string with length x appears in S. For example for string ‘ababa’ F(3) will be 2 because there is a string ‘aba’ that occurs twice. Your task is to output F(i) for every

CF1458E-Nim Shortcuts

CF1458E-Nim Shortcuts 题目: 题目描述: After your debut mobile game “Nim” blew up, you decided to make a sequel called “Nim 2”. This game will expand on the trusted Nim game formula, adding the much awaited second heap! In the game, there are two heaps, each containing a non-negative number of stones. Two players make moves in turn. On their turn, a player can take

CF1458D-Flip and Reverse

CF1458D-Flip and Reverse 题目: 题目描述: You are given a string $ s $ of 0’s and 1’s. You are allowed to perform the following operation: choose a non-empty contiguous substring of $ s $ that contains an equal number of 0’s and 1’s; flip all characters in the substring, that is, replace all 0’s with 1’s, and vice versa; reverse the substring. For example,