北上广深/拔山盖世算法。 yaT+b = z mod p p为质数,Hash表存b,枚举a,复杂度p0.5 记得特判y = 0的情况。 1 inline void solve3() { 2 Hash::clear(); 3 //mp.clear(); 4 scanf("%lld%lld%lld", ...
分类:
其他好文 时间:
2019-03-04 09:36:11
阅读次数:
240
思路 题目要求求出有多少个不同的子串出现 因为后缀自动机每个状态存储的是连续的后缀,所以一个状态对应的子串个数就是maxlen[x] minlen[x]+1 代码 cpp include include include include using namespace std; const int M ...
分类:
其他好文 时间:
2019-03-04 09:26:47
阅读次数:
174
为啥最近都没有arc啊... A Favorite Sound B K th Common Divisor 显然,就是求gcd的第k小的因子。 cpp include include include include include include include include include in ...
分类:
其他好文 时间:
2019-03-03 22:29:22
阅读次数:
145
A .DZY Loves Sequences pro:给定长度为N的序列,你最多可以改变一个数的值,问最长严格上升子序列长度。 N<1e5. sol:分几种情况,一种的不改变; 一种是改变,然后接上一个; 一个是改变中间一个,接上两段,而且满足a[mid-1]<a[mid]<a[mid+1] B . ...
分类:
其他好文 时间:
2019-03-01 00:19:13
阅读次数:
284
第八集 你明明自己也生病了,却还是要陪着我 TimeLimit:3000ms MemoryLimit:256000KB TimeLimit:3000ms MemoryLimit:256000KB 64-bit integer IO format:%lld 64-bit integer IO form ...
分类:
其他好文 时间:
2019-02-26 01:09:27
阅读次数:
192
1058 A+B in Hogwarts (20 分) If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it ...
分类:
其他好文 时间:
2019-02-24 10:53:03
阅读次数:
193
题解 A 回收卫星 #pragma GCC optimize(2) #pragma GCC optimize(3) #pragma GCC optimize(4) #include<bits/stdc++.h> using namespace std; #define y1 y11 #define ...
分类:
其他好文 时间:
2019-02-23 15:56:07
阅读次数:
125
暴力三维DP容易想到 也容易想到贪心每一位,尽量不选 但是怎么check呢?又是拼起来 f[i][j]表示枚举到第i位,分成j组,且可以满足当前假设是否有可行解 转移不难自己看代码吧 但是这样是O(logm*n^3)的,subtest5过不去 但是它又有一个A==1,就可以维护枚举到第i位分成组数最 ...
1 #include 2 int main(){ 3 int n, countCase = 1; 4 long long a, b, c, sum; 5 scanf("%d", &n); 6 while(n--){ 7 bool flag; 8 scanf("%lld%lld%lld", &a, &... ...
分类:
其他好文 时间:
2019-02-21 23:19:37
阅读次数:
262
添加 firewall-cmd --zone=public --add-port=80/tcp --permanent (--permanent永久生效,没有此参数重启后失效) 重新载入 firewall-cmd --reload 重启一个服务: systemctl restart firewall ...
分类:
其他好文 时间:
2019-02-21 23:17:41
阅读次数:
280