地址:https://codeforces.com/contest/1385/problem/D 题意: 给定一个字符串s,长度为2的幂次规定一个字符串叫做c-good,如果它满足以下任意一个条件: 1:字符串长度为1,左半边都是c,右半边是c+1--good 2:字符串长度>1,左半边为c-
Consider the string s=“cdbbaaaa”. It is an ‘a’-good string, because:the second half of the string (“aaaa”) consists of only the character ‘a’; the first half of the string (“cdbb”) is ‘b’-good string, because: the second half of the string (“bb”) consists of ...
Hi everyone, This is my submission for the problem 1385D — a-Good String87129805. If I make the input string global and if I do not pass it inside the function every-time it gets accepted. I don't understand why it times out though?. Wouldn't the solution still be O(17.n)?. ...
Alice has a string ss. She really likes the letter "a". She calls a string good if strictly more than half of the characters in that string are "a"s. For example "aaabb", "axaa" are good strings, and "baca", "awwwa", "" (empty string) are not. Alice can erase some charact...
CodeForces - 1245A Good ol' Numbers Coloring (思维) if i=0, it is colored white; if i≥a and i−a is colored white, i is also colored white; if i≥b and i−b is colored white, i is also colored white; if i is still not colored white, it is colored black....
CodeForces - 1102A(思维题) https://vjudge.net/problem/2135388/originDescribe You are given an integer sequence 1,2,…,n. You have to divide it into two sets A and B in such a way that each element belongs to exactly one set and |sum(A)−sum(B)| is minimum possible....
C. Good String http://codeforces.com/contest/1389/problem/C 题面: Let’s call left cyclic shift of some string t1t2t3…tn−1tnt1t2t3…tn−1tn as string t2t3…tn−1tnt1t2t3…tn−1tnt1. Analogically, let’s call right cyclic shift of ...
CodeForces Algorithms. Contribute to m-aprameya/CodeForces development by creating an account on GitHub.
Codeforces Round 968 (Div. 2)(A~D1) https://space.bilibili.com/488779255 [题目地址]https://codeforces.com/contest/2003 A. Turtle and Good Strings 题意,给一个字符串,将其划分成若干个子字符串,要求每个子字符串的头部元素,不能出现在后续的子字符串的尾部。
CF1907EGood Triples 分析 显然加法不能有进位,所以可以按位考虑,每位三个数加起来必须等于n这一位的值,预处理一下方案数即可. 代码实现 #include<iostream>#include<cstring>#include<vector>usingnamespacestd;usingLL=longlong;intmain(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(0);intC[10]{};...