2022年4月27日
摘要:
acwing:https://www.acwing.com/problem/content/878/ 求逆元 #include <bits/stdc++.h> using namespace std; #define LL long long LL n, a, p; LL qp(LL a, LL k
阅读全文
posted @ 2022-04-27 15:17
Hamine
阅读(178)
推荐(0)
摘要:
裴蜀定理内容:\(ax+by=c\), \(x \in Z^∗\), \(y \in Z^∗\) 成立的充要条件是 \(gcd(a, b) ∣ c\)。\(Z^*\) 表示正整数集。 luogu:https://www.luogu.com.cn/problem/P4549 给定一个序列 \(a\)
阅读全文
posted @ 2022-04-27 10:59
Hamine
阅读(163)
推荐(0)
摘要:
luogu:https://www.luogu.com.cn/problem/P3382 给出一个 \(n\) 次函数,保证在范围 \([l, r]\) 内存在一点 \(x\),使得 \([l, x]\) 上单调增,\([x, r]\) 上单调减。求出 \(x\) 的值。 #include <bit
阅读全文
posted @ 2022-04-27 00:09
Hamine
阅读(293)
推荐(0)
2022年4月25日
摘要:
欧拉函数的值:1 到 $n$ 中与 $n$ 互质的数的个数。 性质: 1.$\sum_{d | n} \phi(d) = n$ 证明:https://blog.csdn.net/Morning_Glory_JR/article/details/94155283 欧拉反演: $\sum_{i = 1}
阅读全文
posted @ 2022-04-25 21:38
Hamine
阅读(34)
推荐(0)
摘要:
luogu 模板:https://www.luogu.com.cn/problem/P3379 树剖求 $LCA$ 时间复杂度 $O(2n + qlogn)$ #include<bits/stdc++.h> using namespace std; using LL = long long; str
阅读全文
posted @ 2022-04-25 19:23
Hamine
阅读(79)
推荐(0)
摘要:
https://www.acwing.com/problem/content/848/ 输出将重心删除后,剩余各个连通块中点数的最大值。 时间复杂度:$O(n)$,极限 $O(n^2)$ #include <bits/stdc++.h> using namespace std; const int
阅读全文
posted @ 2022-04-25 16:04
Hamine
阅读(22)
推荐(0)
摘要:
acwing: https://www.acwing.com/problem/content/837/ 在集合中插入字符串,询问字符串在集合中出现了多少次。 #include <bits/stdc++.h> using namespace std; #define LL long long cons
阅读全文
posted @ 2022-04-25 15:30
Hamine
阅读(198)
推荐(0)
摘要:
luogu: https://www.luogu.com.cn/problem/P1886 #include <bits/stdc++.h> using namespace std; const int N = 1e6 + 10; int n, k, a[N]; void getMin(){ vec
阅读全文
posted @ 2022-04-25 12:53
Hamine
阅读(31)
推荐(0)
摘要:
acwing: https://www.acwing.com/problem/content/843/ 包含大小写英文字母和数字的字符串中,问某两段区间的字符串是不是相同的 #include <bits/stdc++.h> using namespace std; #define ULL unsig
阅读全文
posted @ 2022-04-25 12:25
Hamine
阅读(174)
推荐(0)
摘要:
luogu 模板: https://www.luogu.com.cn/problem/P3390 矩阵快速幂 #include <bits/stdc++.h> using namespace std; #define LL long long const int N = 110, mod = 1e9
阅读全文
posted @ 2022-04-25 11:37
Hamine
阅读(34)
推荐(0)