Submission #1103931

#TimeUsernameProblemLanguageResultExecution timeMemory
1103931ezzzayToys (CEOI18_toy)C++14
59 / 100
5054 ms688 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...