0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:31:59 +00:00

#782. 0825简单数学题(math)

https://sjzezoj.com/submission/22225
This commit is contained in:
Baoshuo Ren 2021-08-25 16:10:57 +08:00 committed by Baoshuo Ren
parent 8dda40185b
commit cf2b686362
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

23
S2OJ/782/782.cpp Normal file
View File

@ -0,0 +1,23 @@
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
long long n, ans[10000005];
int main() {
std::ios::sync_with_stdio(false);
cin >> n;
for (long long i = 1; i * i <= n; i++) {
if (n % i) continue;
if ((i & 1ll) && i != 1) ans[++ans[0]] = n / i * (i - 1);
if (((n / i) & 1ll) && n / i != 1) ans[++ans[0]] = i * (n / i - 1);
}
sort(ans + 1, ans + 1 + ans[0]);
for (int i = 0; i <= ans[0]; i++) {
cout << ans[i] << ' ';
}
cout << endl;
return 0;
}