2017 多校1 I Curse Myself】的更多相关文章

2017 多校2 I Curse Myself(第k小生成树) 题目: 给一张带权无向连通图,该图的任意一条边最多只会经过一个简单环,定义\(V(k)为第k小生成树的权值和\),求出\(\sum_{k=1}^{K}k \cdot V(k) mod 2^{32}\) 思路: 比赛的时候看了一眼,没有看清楚是仙人掌那句话,觉得好难啊 看完题解之后觉得就算看清了还是过不了嘛. 直接上题解 由于图是一个仙人掌,所以显然对于图上的每一个环都需要从环上取出一条边删掉.所以问题就变为有 M 个集合,每个集合里…
2017 多校5 Rikka with Number(数学 + 数位dp) 题意: 统计\([L,R]\)内 有多少数字 满足在某个\(d(d>=2)\)进制下是\(d\)的全排列的 \(1 <= L <= R <= 10^{5000}\) 题解: 首先转化成计算小于等于 \(N\)的好数有多少个.因为 \(n^n<(n+1)^n\) ​ ​​而对于 \(n\) 进制下的任何一个好数 \(K\),都有 \(n^{n-1}<K<n^n ​\) ​​ ​​ ,所以每一…
2017 多校5 Rikka with String(ac自动机+dp) 题意: Yuta has \(n\) \(01\) strings \(s_i\), and he wants to know the number of \(01\) antisymmetric strings of length \(2L\) which contain all given strings \(s_i\) as continuous substrings. A \(01\) string \(s\) i…
2017 多校4 Wavel Sequence 题意: Formally, he defines a sequence \(a_1,a_2,...,a_n\) as ''wavel'' if and only if \(a_1<a_2>a_3<a_4>a_5<a_6\)... Now given two sequences \(a_1,a_2,...,a_n\) and \(b_1,b_2,...,b_m\), Little Q wants to find two seque…
2017 多校4 Security Check 题意: 有\(A_i\)和\(B_i\)两个长度为\(n\)的队列过安检,当\(|A_i-B_j|>K\)的时候, \(A_i和B_j\)是可以同时过安检的,过安检必须按照队列的顺序,问你两个队列过完安检最少花费的时间 \(1<=n<=6e4\), \(1<=A_i,B_i<=n\) 题解: 设\(f_{i,j}\) 表示仅考虑\(a[1..i]\)与\(b[1..j]\)时,最少需要多少时间. 若\(|a_i-b_j|>…
2017 多校3 hdu 6061 RXD and functions(FFT) 题意: 给一个函数\(f(x)=\sum_{i=0}^{n}c_i \cdot x^{i}\) 求\(g(x) = f(x - \sum a_i)\)后每一项\(x^{i}\)的系数mod998244353 \(n <= 10^{5},m <= 10^{5}\) \(0 <= c_i < 998244353\) \(0 <= a_i < 998244353\) 思路: 令\(d = -\s…
2017 多校2 hdu 6053 TrickGCD 题目: You are given an array \(A\) , and Zhu wants to know there are how many different array \(B\) satisfy the following conditions? \(1≤B_i≤A_i\) For each pair(\(l , r) (1≤l≤r≤n) , gcd(bl,bl+1...br)≥2\) Input The first line…
有点麻烦.. /*hdu6136[模拟+优先队列] 2017多校8*/ #include <bits/stdc++.h> using namespace std; typedef long long LL; struct frac { LL p, q; frac(LL P, LL Q) { p = P / __gcd(P, Q); q = Q / __gcd(P, Q); } frac() {p = , q = ;} bool operator < (const frac& a)…
/*hdu6134[莫比乌斯反演] 2017多校8*/ #include <bits/stdc++.h> using namespace std; typedef long long LL; ; + ; LL f[maxn], g[maxn], d[maxn]; bool vis[maxn]; int prime[maxn], primes, mu[maxn]; void init_mu() { memset(vis, , sizeof(vis)); mu[] = ; primes = ; ;…
/*hdu6098[RMQ+筛法] 2017多校6*/ #include <bits/stdc++.h> using namespace std; ][], len[], a[]; void st_init() { len[] = -; ; i <= n; i++) { st[i][] = a[i]; len[i] = (i & (i - )) == ? len[i - ] + : len[i - ]; } ; j <= len[n]; j++) { ; i + ( <…