题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6138 题意:给了初始区间[-1,1],然后有一些操作,可以r加上一个数,l减掉一个数,或者同时操作,问最后能不能凑出k. 解法:由于开始是-1,所以l,r能延伸到的任何区间都可以凑出来,直接判断即可. #include <bits/stdc++.h> using namespace std; int a[1010]; int main() { int T,n,k; scanf("%d&q…
题目链接 Problem Description The Eternal Fleet was built many centuries ago before the time of Valkorion by an unknown race on the planet of Iokath. The fate of the Fleet's builders is unknown but their legacy would live on. Its first known action was in…
题意 题目链接 Sol 真是狗血,被疯狂卡常的原因竟是 我们考虑暴力枚举每个串的前缀,看他能在\(x, y\)的后缀自动机中走多少步,对两者取个min即可 复杂度\(O(T 10^5 M)\)(好假啊) #include<bits/stdc++.h> using namespace std; const int MAXN = 2e5 + 10; int N, M; string s[MAXN]; struct SAM { int ch[MAXN][26], fa[MAXN], len[MAXN…
Fleet of the Eternal Throne Problem Description > The Eternal Fleet was built many centuries ago before the time of Valkorion by an unknown race on the planet of Iokath. The fate of the Fleet's builders is unknown but their legacy would live on. Its…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6169 题意:给了区间L,R,求[L,R]区间所有满足其最小质数因子为k的数的和. 解法: 我看了这篇blog.http://blog.csdn.net/wubaizhe/article/details/77484454#cpp 先放在这里,明天来补推导过程. #include <bits/stdc++.h> using namespace std; typedef long long LL; co…