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;
int n;
vector<int> V, D[200010];
void init(){
for(int i=1; i*i<=n; i++)
if(n%i==0){ V.push_back(i); if(i*i!=n) V.push_back(n/i); }
sort(V.begin(), V.end());
}
int main(){
ios::sync_with_stdio(0); cin.tie(0);
cin>>n;
init();
D[0].push_back(0);
for(int i=1; i<(int)V.size(); i++){
vector<int> &W=D[i];
for(int j=0; j<i; j++)
if(V[i]%V[j]==0)
for(int x:D[j]) W.push_back(x+V[i]/V[j]-1);
sort(W.begin(), W.end());
W.resize(unique(W.begin(), W.end())-W.begin());
}
cout<<D[V.size()-1].size()<<'\n';
for(int x:D[V.size()-1]) cout<<x<<' ';
cout<<'\n';
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... |