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;
#define int long long
#define ff first
#define ss second
#define pb push_back
int m,n;
vector<int>v;
set<int>st;
void fun(int x, int p, int k){
if(x==1){
st.insert(k);
return;
}
for(int i=p;i<=n;i++){
if(x%i==0){
v.pb(i);
fun(x/i,i,k+i-1);
v.pop_back();
}
}
}
signed main(){
cin>>n;
m=sqrt(n);
fun(n,2,0);
cout<<st.size()<<endl;
for(auto a:st)cout<<a<<" ";
}
# | 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... |