mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 03:31:59 +00:00
NC15325 等式
https://ac.nowcoder.com/acm/contest/view-submission?submissionId=53945742
This commit is contained in:
parent
b48eab7be4
commit
a6c8bb6aab
39
NowCoder/15325/15325.cpp
Normal file
39
NowCoder/15325/15325.cpp
Normal file
@ -0,0 +1,39 @@
|
||||
#include <iostream>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
int t;
|
||||
|
||||
cin >> t;
|
||||
|
||||
while (t--) {
|
||||
int n, ans = 1;
|
||||
|
||||
cin >> n;
|
||||
|
||||
for (int i = 2; i * i <= n; i++) {
|
||||
if (n % i == 0) {
|
||||
int cnt = 0;
|
||||
|
||||
while (n % i == 0) {
|
||||
n /= i;
|
||||
cnt++;
|
||||
}
|
||||
|
||||
ans *= cnt * 2 + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (n > 1) ans *= 3;
|
||||
|
||||
cout << ans / 2 + 1 << endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user