mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-27 15:56:26 +00:00
parent
26ce4f0658
commit
15d6baf0e1
27
S2OJ/475/475.cpp
Normal file
27
S2OJ/475/475.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user