摘要:
AC自动机上搞矩阵快速幂。 #include<cstdio> #include<cstring> #include<queue> #include<algorithm> #include<map> using namespace std; const int Nmax=207; const int 阅读全文
posted @ 2018-09-16 09:41
LMissher
阅读(195)
评论(0)
推荐(0)
摘要:
一个背包dp。 //#define test #include<bits/stdc++.h> using namespace std; const int Nmax=1e4+7; const int Vmax=1e4; typedef long long ll; const ll mod=1e9+7 阅读全文
posted @ 2018-09-16 09:40
LMissher
阅读(191)
评论(0)
推荐(0)
摘要:
不知道题意,队友用java大数+二分过了? import java.util.Arrays; import java.util.Scanner; import java.io.*; import java.math.*; public class Main { static boolean chec 阅读全文
posted @ 2018-09-16 09:39
LMissher
阅读(198)
评论(0)
推荐(0)
摘要:
求一个串中出现次数在[L,R]区间里的子串一共有多少个,后缀数组用出现次数>=L的个数减去出现次数>R的个数就是答案。 //#define test #include<bits/stdc++.h> using namespace std; const int Nmax=250007; const i 阅读全文
posted @ 2018-09-16 09:37
LMissher
阅读(245)
评论(0)
推荐(0)
摘要:
water #include <bits/stdc++.h> using namespace std; int n,a,b,c; int main(){ while(~scanf("%d%d%d",&a,&b,&c)){ int ans=a*b*c; if(ans%2==0) printf("Yes 阅读全文
posted @ 2018-09-16 09:37
LMissher
阅读(132)
评论(0)
推荐(0)
摘要:
欧拉降幂求(A^B)%C,其中B超大。 //#define test #include<bits/stdc++.h> using namespace std; const int Nmax=1e6+7; typedef long long ll; const ll mod = 1e9+7; char 阅读全文
posted @ 2018-09-16 09:34
LMissher
阅读(155)
评论(0)
推荐(0)
摘要:
区间k覆盖费用流模板题。 离散化后让每个数字最多可用k次即可,源点向起点连边,终点向汇点连边,第i个点向第i+1个点连边,容量都为k,费用为0。 对于给的左闭右开区间,区间左端点向右端点连边,容量为1,费用为-val。 #include <bits/stdc++.h> using namespace 阅读全文
posted @ 2018-09-16 09:32
LMissher
阅读(170)
评论(0)
推荐(0)
摘要:
区间更新加法与乘法,x取反是2^64-x-1,由于取模所以取反变成-x-1,就区间*-1再-1就可以了,最后区间询问求和。 #include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fi first #def 阅读全文
posted @ 2018-09-16 09:29
LMissher
阅读(227)
评论(0)
推荐(0)
摘要:
dp维护一下最大值与最小值,注意边界情况的判定。 #include <iostream> #include <cstring> using namespace std; const long long inf = (long long)1e18+(long long)9; long long dp[ 阅读全文
posted @ 2018-09-16 09:28
LMissher
阅读(307)
评论(0)
推荐(0)
摘要:
water #include <bits/stdc++.h> #include <unordered_set> #include <unordered_map> #define pb push_back #define mp make_pair #define x first #define y s 阅读全文
posted @ 2018-09-16 09:27
LMissher
阅读(193)
评论(0)
推荐(0)

浙公网安备 33010602011771号