[CF1220C] Description 给定一个字符串 \(S\) , 同时维护一个区间 \([l,r]\) .轮流操作,每次可以扩展到一个新区间使得原区间是新区间的真子区间,并且字典序更小,不能操作的人输.初态区间为 \([k,k]\) ,你需要对 \(k=1,2,...,|S|\) 判断胜负性. Solution 很容易发现游戏最多玩一轮,所以只需要判断每个字母之前有没有更小的字母就可以了. #include <bits/stdc++.h> using namespace std; s…
链接: https://codeforces.com/contest/1220/problem/C 题意: Mike and Ann are sitting in the classroom. The lesson is boring, so they decided to play an interesting game. Fortunately, all they need to play this game is a string s and a number k (0≤k<|s|). A…
传送门 首先显然的,如果 $l$ 能移动,那么 $r$ 一定可以随便移动,如果 $l$ 不动,那么 $r$ 一定不能动 那么我们现在只要考虑 $l$ 的移动即可 考虑找到位置 $k$ 之前的最左边的最小的字符,如果存在,先手可以直接把 $l$ 移过去,那么后手就没得走了 如果不存在,那么先手显然没得移动 所以直接根据每个位置左边最小的字符是否小于当前位置的字符即可判断胜负 #include<iostream> #include<cstdio> #include<algorit…
传送门 A. Cards 记录一下出现的个数就行. Code #include <bits/stdc++.h> #define MP make_pair #define fi first #define se second #define sz(x) (int)(x).size() //#define Local using namespace std; typedef long long ll; typedef pair<int, int> pii; const int N =…
目录 Contest Info A. Cards B. Multiplication Table C. Substring Game in the Lesson D. Alex and Julian Contest Info Practice Link Solved A B C D E F G 4/7 O O O Ø - - - O 在比赛中通过 Ø 赛后通过 ! 尝试了但是失败了 - 没有尝试 A. Cards 签到. B. Multiplication Table 题意: 给出一个\(n \…
题目描述 Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For "bbbbb" the longest…
题目描述 Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. 即给定一个字符串,求它的最长回文子串的长度(或者最长回文子串). 解法一 对于一个问题,一定可以找到一个傻的可爱的暴力解法,本题的暴力解法即…
Maximum repetition substring Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9458   Accepted: 2915 Description The repetition number of a string is defined as the maximum number R such that the string can be partitioned into R same conse…
Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than k times. Example 1: Input: s = "aaabb", k = 3 Output: 3 The longest substring is "aaa"…
Text After I had had lunch at a village pub, I looked for my bag. I had left it on a chair beside the door and now it wasn't there! As I looking for it, the landlord came in. 'Did you have a good meal?' he asked. 'Yes, thank you,' I answered, 'but I…