SP705-SUBST1 - New Distinct Substrings 题目: 题目描述: Given a string, we need to find the total number of its distinct substrings. 输入格式: T- number of test cases. T<=20; Each test case consists of one string, whose length is <= 50000 输出格式: For each test case output one number saying the number of distinct substrings. 样例
SP694-DISUBSTR - Distinct Substrings 题目: 题目描述: Given a string, we need to find the total number of its distinct substrings. 输入格式: T- number of test cases. T<=20; Each test case consists of one string, whose length is <= 1000 输出格式: For each test case output one number saying the number of distinct substrings. 样例:
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 题目: 题目描述: 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,
CF1458C-Latin Square 题目: 题目描述: You are given a square matrix of size $ n $ . Every row and every column of this matrix is a permutation of $ 1 $ , $ 2 $ , $ \ldots $ , $ n $ . Let $ a_{i, j} $ be the element at the intersection of $ i $ -th row and $ j
CF1458B-Glass Half Spilled 题目: 题目描述: There are $ n $ glasses on the table numbered $ 1, \ldots, n $ . The glass $ i $ can hold up to $ a_i $ units of water, and currently contains $ b_i $ units of water. You would like to choose $ k $ glasses and collect as much water in them as possible. To