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 <iostream>
#include <set>
#include <vector>
#include <algorithm>
using namespace std;
//ifstream cin ("date.in");
//ofstream cout ("date.out");
set <int> sol;
int x,nr,d;
void back (int x, int val){
sol.insert (x+val-1);
/// vreau sa maresc nr de factori cu 1
for (int d=2;d<=x/d;d++)
if (x % d == 0)
back (x/d,val+d-1);
}
int main (){
cin>>x;
back (x,0);
//sol.insert (x-1);
cout<<sol.size()<<"\n";
for (auto x:sol)
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... |