b题:b其实不难题意就是不让k个连续字符成为一个周期。这提给我的教训就是中文翻译应该结合英文题目一起看, #include<bits/stdc++.h>#include<algorithm>#define ll long longusing namespace std;const ll nl=1e5 ...
分类:
其他好文 时间:
2020-11-02 10:12:11
阅读次数:
22
#include <bits/stdc++.h> using namespace std; const int mn=1e6+7; const int mod=1e9+7; int v[mn],p[mn],s[mn]; int main() { int n,tot=0; cin>>n; for(in ...
分类:
其他好文 时间:
2020-11-02 10:09:59
阅读次数:
47
#include <bits/stdc++.h> #include "opencv2/core.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/video.hpp" #include "opencv2/objdetect.hpp" #inc ...
分类:
其他好文 时间:
2020-11-02 10:01:48
阅读次数:
21
好题: #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 5e6 + 5; const LL Mod = 1e9 + 7; #define INF 1e9 #define dbg(x) c ...
分类:
其他好文 时间:
2020-11-01 22:04:43
阅读次数:
23
# include <bits/stdc++.h> using namespace std; const int N = 2050; int n,m; int lowbit(int x) {return x & -x;} struct _2wBIT { int a[N][N]; void clear ...
分类:
其他好文 时间:
2020-11-01 09:41:49
阅读次数:
19
1.树的同构 思路:因为他是只交换左右子节点,就可以发现同构的树的父亲节点是相同的,所以你只要记住一个结点的父亲节点是什么,判断两棵树上相同点的父亲节点是否相同,就可以判断是否同构。 最后判断下为只有一个结节点的特殊情况。 /* n==1的情况是不符合的 */ #include<bits/stdc+ ...
分类:
其他好文 时间:
2020-11-01 09:39:49
阅读次数:
16
魔改一下nlogn求最长不下降子序列的模板就行 对于不能修改的位置 他们肯定是存在答案里面的 那么维护答案序列最后的不可修改位置 设为las 如果新加入的数的位置小于等于las 则跳过 否则 维护las 并且把las以后的序列清空 #include<bits/stdc++.h> using name ...
分类:
其他好文 时间:
2020-10-30 12:51:14
阅读次数:
20
1. 标准的卢卡斯定理加数位dp,主要是算C(n,i)*C(n,2*i)。 但由于这题的模数是质数,就不需要考虑很多东西,如:是否超过上限了、是否有连续的进位。 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ...
分类:
其他好文 时间:
2020-10-30 12:28:57
阅读次数:
17
去年比赛的时候虽然对了,但写的好麻烦,以至于后面不敢再写这道题,今天又写了一遍,贴出来做纪念。 #include<stdio.h> #include<bits/stdc++.h> using namespace std; #define ll long long #define io_opt ios ...
分类:
其他好文 时间:
2020-10-27 11:46:36
阅读次数:
32
C. 前缀和。 #include <bits/stdc++.h> using namespace std; #define maxn 300000 #define INF 10000000 char c[maxn]; int n, ans = INF, sumB[maxn], sumW[maxn]; ...
分类:
其他好文 时间:
2020-10-26 11:41:45
阅读次数:
22