求一个数因数个数,因数和
ll cal(int x) { ll ans = 1, res = 0, temp = 0, t = x; Loop(i, 2, x) { res = 1; while (x % i == 0) { res = i; x /= i; } temp = (res i - 1) / (i - 1); ans *= temp; } return ans;}
// 求所有因数的个数 int x = t; int ans = 1; Loop(j, 2, x) { int res = 0; while ((x % j) == 0) { res++; x /= j; } ans *= (res + 1); } return ans;
