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;
vector<int> v;
void f(int x, int y, int z)
{
v.push_back(z+x-1);
for (int i=y; i*i<=x; i++)
if (x%i==0)
f(x/i, i, z+i-1);
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
f(n, 2, 0);
sort(v.begin(), v.end());
v.resize(unique(v.begin(), v.end())-v.begin());
cout << v.size() << '\n';
for (int x:v)
cout << x << ' ';
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... |