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 namespace std;
set<int> ans;
void res(int n, int last, int sum){
ans.insert(sum - n + 1);
for(int i = last; i <= n / i; i++) if(n % i == 0) res(n / i, i, sum + i - 1);
}
int main(){
int n; cin >> n;
res(n, 2, 0);
cout << ans.size() << '\n';
for(int x : ans) cout << x << '\n';
cout << '\n';
}
# | 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... |