摘要:
AcWing 875. 快速幂 \(O(n\log_2b)\) #include <iostream> #include <cstring> #include <algorithm> using namespace std; typedef long long ll; int n, a, b, p; 阅读全文
posted @ 2023-12-09 15:47
coldair7
阅读(26)
评论(0)
推荐(0)
摘要:
AcWing 873. 欧拉函数 欧拉函数的定义 \(1\) ~ \(N\) 中与 \(N\) 互质的数的个数被称为欧拉函数,记为 \(\phi(N)\)。 若在算数基本定理中,\(N=p_1^{a_1}p_2^{a_2}...p_{m}^{a_m}\),则: \(\phi(N)=N\times\f 阅读全文
posted @ 2023-12-09 14:34
coldair7
阅读(89)
评论(0)
推荐(0)
摘要:
AcWing 869. 试除法求约数 时间复杂度 \(O(n\sqrt a)\) #include <iostream> #include <cstring> #include <algorithm> #include <vector> using namespace std; vector<int 阅读全文
posted @ 2023-12-09 14:00
coldair7
阅读(94)
评论(0)
推荐(0)
摘要:
AcWing 866. 试除法判定质数 时间复杂度 \(O(T \sqrt a)\) #include <iostream> #include <cstring> #include <algorithm> using namespace std; bool isprime(int x) { if ( 阅读全文
posted @ 2023-12-09 13:20
coldair7
阅读(33)
评论(0)
推荐(0)

浙公网安备 33010602011771号