【CodeForces】【博弈】1221E-Game With String CodeForces 1221E-Game With String 题目大意 ◇题目传送门◆ 给定一个仅包括X和.字符串,第一个人一次可以将连续的AAA个.改成X,第二个人则只能改BBB个,保证B<AB<AB<A,那么问第一个人能否胜利。 分析 由于连续的.是互相不影响的,所以我们一段一段地来考虑。
Codeforces 1221F Game With String 思维题 题意:有两个人玩游戏,游戏规则如下:有一个长度为n的字符串,这个字符串由 . 和 X 构成,Alice可以选择a个连续的 . 把它们变成X, Bob可以选择连续的b个 . 把它们变成X。题目中保证a > b, Alice先手,问双方都不放水的情况下谁会赢? 思路:注意到a > b这个关键...
Vasya and Kolya play a game with a string, using the following rules. Initially, Kolya creates a string s, consisting of small English letters, and uniformly at random chooses an integer k from a segment [0, len(s) - 1]. He tells Vasya this string s, and then shifts it k l...
Codeforces 482C Game with Strings(dp+概率) 题目链接:Codeforces 482C Game with Strings 题目大意:给定N个字符串,如今从中选定一个字符串为答案串,你不知道答案串是哪个。可是能够通过询问来确定, 每次询问一个位置上字符为多少。 如今你询问的每一个位置的概率是同样的,(问过的位置不会再问)。求询问次数的...
Codeforces 1221E. Game With String 传送门 首先每一段连续的 $...$ 都是互不影响的,所以可以一段段考虑 考虑最简单的情况,此时每一段都大于等于 $a$ 并且小于 $2b$ ,那么每一段都只能放一次,胜负直接根据段数即可得到答案 考虑如果存在段长小于 $a$ 却大于等于 $b$ 的情况,此时后手可以随时放在那个...
代码: #include<cstdio>#include<iostream>#include<cstring>#include<string>#include<algorithm>#include#include<set>#include<vector>#include<queue>#include<cstdlib>#include<ctime>#include<cmath>#include<bitset>usingnamespacestd;typedeflonglongLL;#defineN55#defineM25intn,len;charstr[N][M];LL f[(...
Here n <= 10^8 , k <=N Time : 3s k + logN 1) Set to 1 the first bit in numbers. If then set to 1 the second bit of the last 2 numbers. Subtract all considered bits fromn. 2) Now we do not need to care about the conditionni > 0anymore. Pick the biggest ...
Petya and Vasya are competing with each other in a new interesting game as they always do. At the beginning of the game Petya has to come up with an array ofNNpositive integers. Sum of all elements in his array should be equal toSS. Then Petya has to select an integerKKsuch that0≤...
Codeforces1327C - Game with Chips(思维/构造) 技术标签: CodeforcesDescription Petya has a rectangular Board of size n×m. Initially, k chips are placed on the board, i-th chip is located in the cell at the intersection of sxi-th row and syi-th column. In one action, Petya can move ...
NahC0el→Codeforces Round 1023 (Div 2) Editorial i_m_abbhay→Help My 14-Year-Old Brother Love Competitive Programming! SuperGrover→Contribution on CodeForces balllightning37→Every CSES problem can be solved in 44 characters with Python