0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 20:28:48 +00:00
https://sjzezoj.com/submission/13662
This commit is contained in:
Baoshuo Ren 2021-07-10 15:53:35 +08:00 committed by Baoshuo Ren
parent 26ce4f0658
commit 15d6baf0e1
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

27
S2OJ/475/475.cpp Normal file
View File

@ -0,0 +1,27 @@
#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;
int n, k, a[10000005];
int main() {
scanf("%d", &n);
if (n == 1) {
printf("None\n");
exit(0);
}
printf("1\n");
a[k++] = n - 1;
for (int i = (int)floor(sqrt(n)); 2 * i < n; i++) {
if (1ull * i * i % n == 1) {
printf("%d\n", i);
a[k++] = n - i;
}
}
for (int i = k - 1; i >= 0; i--) {
printf("%d\n", a[i]);
}
return 0;
}