mollor
mollor
全部文章
分类
归档
标签
去牛客网
登录
/
注册
mollor的博客
全部文章
(共4篇)
题解 | 糟糕的打谱员
线段树是对的孩子们,因为普通dp的话只能想出来O(n2)的做法只好用线段树O(nlogn)的方法过去了。开两个线段树,一个是0下棋的时候,另一个是1下棋的时候,每次都在对方的范围里面查找不是以ai结尾的最大的合法长度就好了最后把两边最大的长度比一下就好了 #include<bits/stdc+...
2025-12-05
0
15
题解 | 质数统计
一开始想用线段树来做的,但是发现是杀鸡用牛刀了,用前缀和就可以轻松ac #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef ...
2025-12-04
0
9
题解 | 游游的字符重排
注意到,长度不大于十所以能够直接全排列草过去 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll...
2025-12-03
0
13
题解 | 穷哈哈~
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n; string a; cin>&g...
2025-11-13
0
27