摘要:
KMP 我似乎复杂度写的不对。。。 因为位置相同只算一次,后缀数组什么的都不管用了,我们就暴力kmp,但是我写的是暴力跳。。。竟然过了。。。我写bzoj3670才发现。。。 #include<cstdio> #include<cstring> #include<algorithm> using na 阅读全文
摘要:
A:略坑 枚举l-r,看是否能整除k且商的范围是不是在x,y里 #include<bits/stdc++.h> using namespace std; int l, r, x, y, k; int main() { cin >> l >> r >> x >> y >> k; for(int i = 阅读全文
摘要:
差分约束系统 按题目建边就行了,大于等于号是最长路,小于等于号是最短路,边由减号后面连向减号前面,边权是不等号后面的常数项 这里跑最长路,用dfs版spfa跑 #include<bits/stdc++.h> using namespace std; const int N = 10010; stru 阅读全文