#include<iostream> #include<cstdio> usingnamespace std; intdividedCount(int x){ int ans = 1; for (int i = 2; i <= x / i; ++i) { if (x % i == 0) { int s = 0; while (x % i == 0) x /= i, ++s; ans *= (s + 1); } } if (x > 1) ans *= 2; return ans; } intmain() { int n; cin>>n; cout<<dividedCount(n); }
#include<iostream> usingnamespace std; using LL = longlong; constint MOD = 1e9 + 7; intdividedSum(int x){ LL ans = 1; for (int i = 2; i <= x / i; ++i) { LL t = 1; while (x % i == 0) x /= i, t = (t * i + 1) % MOD; ans = ans * t % MOD; } if (x > 1) ans = ans * (x + 1) % MOD; return ans; }
intmain() { int n; cin>>n; cout<<dividedSum(n); return0; }
intmain() { scanf("%d%d", &n, &m); for (int i = 0; i < n; i ++ ) scanf("%d", &q[i]);
for (int i = 0; i < m; i ++ ) { int x; scanf("%d", &x); // 二分x的左端点 int l = 0, r = n - 1; // 确定区间范围 while (l < r) { int mid = l + r >> 1; if (q[mid] >= x) r = mid; else l = mid + 1; }
if (q[r] == x) { cout << r << ' ';
// 二分x的右端点 r = n - 1; // 右端点一定在[左端点, n - 1] 之间 while (l < r) { int mid = l + r + 1 >> 1; // 因为写的是l = mid,所以需要补上1 if (q[mid] <= x) l = mid; else r = mid - 1; } cout << r << endl; } else cout << "-1 -1" << endl; }
intmain() { scanf("%d%d", &n, &m); for (int i = 0; i < n; i ++ ) scanf("%d", &q[i]);
for (int i = 0; i < m; i ++ ) { int x; scanf("%d", &x); // 二分x的左端点 int l = 0, r = n - 1; // 确定区间范围 while (l < r) { int mid = l + r >> 1; if (q[mid] >= x) r = mid; else l = mid + 1; }
if (q[r] == x) { cout << r << ' ';
// 二分x的右端点 r = n - 1; // 右端点一定在[左端点, n - 1] 之间 while (l < r) { int mid = l + r + 1 >> 1; // 因为写的是l = mid,所以需要补上1 if (q[mid] <= x) l = mid; else r = mid - 1; } cout << r << endl; } else cout << "-1 -1" << endl; }