首页 > 小 Q 与函数求和 1
头像 范艺杰
发表于 2021-04-23 23:34:58
其中是完全积性函数,可线性筛。其余部分可以处理。 #include <cstdio> #include <algorithm> #include <cstring> using namespace std; typedef long long ll; cons 展开全文
头像 lifehappy
发表于 2021-04-27 14:28:57
小 Q 与函数求和 1 所以预先处理次幂,及,即可同时算得,以及,整体复杂度,稍卡常,得写 add sub 函数才能过。 #include <bits/stdc++.h> using namespace std; const int N = 5e6 + 10, mod = 99824 展开全文