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 阅读(16) 评论(0) 推荐(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 阅读(62) 评论(0) 推荐(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 阅读(11) 评论(0) 推荐(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 阅读(66) 评论(0) 推荐(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 阅读(20) 评论(0) 推荐(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 阅读(118) 评论(0) 推荐(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 阅读(26) 评论(0) 推荐(0) 编辑