This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using ll = long long;
std::map<int, std::set<int>> s;
int main() {
std::ios_base::sync_with_stdio(0);
std::cin.tie(0);
int n;
std::cin >> n;
std::vector<int> divs;
for(int d = 1;d * d <= n; d++) {
if(n % d == 0) {
divs.push_back(d);
if(d * d != n)
divs.push_back(n / d);
}
}
std::sort(divs.begin(), divs.end());
s[1].insert(0);
for(auto x : divs) {
if(x > 1) {
for(int y : divs) {
if(x % y == 0) {
for(auto it : s[x / y])
s[x].insert(it + y - 1);
}
}
}
}
std::cout << s[n].size() << "\n";
for(auto it : s[n])
std::cout << it << " ";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |