摘要:
复杂度 \(O(n^\frac 23)\),计算 \(1\sim n\) 的素数个数 #define div(a, b) (1.0 * (a) / (b)) #define half(x) (((x) - 1) / 2) i64 Meissel_Lehmer(i64 n) { if (n <= 3) 阅读全文
posted @ 2024-08-09 20:01
Ke_scholar
阅读(80)
评论(0)
推荐(0)
摘要:
using i128 = __int128; istream &operator>>(istream &is, i128 &x) { string s; is >> s; bool neg = false; x = 0; for (char c : s) { if (c == '-') neg = 阅读全文
posted @ 2024-08-09 18:51
Ke_scholar
阅读(114)
评论(0)
推荐(0)
摘要:
template<class Node> struct PersidentSegmentTree { #define lc(u) tr[u].l #define rc(u) tr[u].r const int n; int tot = 0; vector<Node> tr; vector<int> 阅读全文
posted @ 2024-08-09 11:04
Ke_scholar
阅读(62)
评论(0)
推荐(0)
摘要:
【线段树合并/树上差分】P4556 [Vani有约会] 雨天的尾巴 /【模板】线段树合并 思路 对 \(x,y,lca(u,v),fa_{lca(u,v)}\) 四个点进行树上差分,然后用线段树合并动态权值线段树。 #include <bits/stdc++.h> using namespace s 阅读全文
posted @ 2024-08-09 11:03
Ke_scholar
阅读(50)
评论(0)
推荐(0)

浙公网安备 33010602011771号