链接:https://www.nowcoder.com/acm/contest/147/E 来源:牛客网 题目描述 Niuniu likes to play OSU! We simplify the game OSU to the following problem. Given n and m, there are n clicks. Each click may success or fail. For a continuous success sequence with length X,…
链接:https://www.nowcoder.com/acm/contest/142/A 来源:牛客网 题目描述 A ternary , , or . Chiaki has a ternary in the string, and finally the first character will disappear. For example, ``'' after another second. Chiaki would like to know the number of seconds n…
#include<bits/stdc++.h>using namespace std;vector<int>tree[1000010];int sum=0;int dfs(int x, int y){ int first = 0, second = 0; for (int i = 0; i < tree[y].size(); ++i) { if (tree[y][i] == x) continue; int…