UVA 11019 - Matrix Matcher #include <bits/stdc++.h> using namespace std; #define rint register int #define rll register long long typedef long long ll; const int maxn = 1e3 + 100; const int base1 = 233, base2 = 2333; char a[maxn][maxn], b[maxn][max
题目描述:设$A,B$为$n-1$次多项式,求$A*B^C$在系数模$n+1$,长度为$n$的循环卷积。 数据范围:$n\leq 5*10^5,C\leq 10^9$,且$n$的质因子不超过7,$n+1$为质数。 这就是一个循环卷积,在$n=2^k$的情况下可以直接使用FFT/NTT,但是这里不行。 由于$n$的质因子很小,设$n=2^{k_1}*3^{k_2}*5^{k_3}*7
这次是中国大佬出题,结果被虐惨了。 A. Nauuo and Votes 1 #include<bits/stdc++.h> 2 #define Rint register int 3 using namespace std; 4 typedef long long LL; 5 int x, y, z; 6 int main(){ 7 scanf("%d%d%d", &x, &y, &z); 8 if(x + z - y <
[题目链接] https://codeforces.com/contest/452/problem/E [算法] 构建后缀数组 用并查集合并答案即可 时间复杂度 : O(NlogN) [代码] #include<bits/stdc++.h>using namespace std;typedef long long ll
类似于zkw,但空间只用两倍,zkw要4倍。 链接 可以下传标记,打熟后很好码。 #include <set> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <assert.h> #include <algorithm> using namespace std; #define LL long lon