Purpose
Computes the prime factorization of a given natural number.
Time Complexity
Usage
For example, primeFactorize(12) returns {(2,2),(3,1)}. This means .
Implementation
vector<pair<int, int>> primeFactorize(int n) { vector<pair<int, int>> res; for (int a = 2; a * a <= n; ++a) { if (n % a == 0) { res.push_back({a, 0}); while (n % a == 0) ++res.back().second, n /= a; } } if (n != 1) res.push_back({n, 1}); return res;}Verify
//TODO