5 条题解
-
1
#include <iostream> #include <cmath> using namespace std; int n, x, ans; void f(int x, int last) { for(int i = last; i <= sqrt(x); i ++) if(x % i == 0) { ans ++; f(x / i, i); } } int main() { cin >> n; while(n --) { ans = 1; cin >> x; f(x, 2); cout << ans << endl; } return 0; } -
0
#include <bits/stdc++.h> using namespace std; #define LL long long const int N = 1e5 + 10; const int INF = 0x3f3f3f3f; int f(int a, int b) { if(a==1) return 1; int s=0; for(int i=b;i <= a;i++) if(a % i == 0) s+=f(a/i,i); return s; } int main() { int n; cin >> n; while(n--) { int x; cin >> x; cout<<f(x,2)<<"\n"; } return 0; } //菜鸟驿站 //老六专属
- 1
信息
- ID
- 1232
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 6
- 标签
- 递交数
- 344
- 已通过
- 115
- 上传者