0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 20:48:48 +00:00

P2508 [HAOI2008]圆上的整点

https://www.luogu.com.cn/record/88070866
This commit is contained in:
Baoshuo Ren 2022-10-01 13:38:18 +08:00
parent 06b28530e1
commit bcb6761f4d
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

35
Luogu/P2508/P2508.cpp Normal file
View File

@ -0,0 +1,35 @@
#include <iostream>
using std::cin;
using std::cout;
const char endl = '\n';
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
long long r, ans = 1;
cin >> r;
for (int i = 2; i * i <= r; i++) {
if (r % i == 0) {
int cnt = 0;
while (r % i == 0) {
r /= i;
cnt++;
}
if (i % 4 == 1) ans *= cnt * 2 + 1;
}
}
if (r != 1 && r % 4 == 1) {
ans *= 3;
}
cout << ans * 4 << endl;
return 0;
}