Submission #943483

#TimeUsernameProblemLanguageResultExecution timeMemory
943483maxFedorchukToys (CEOI18_toy)C++17
0 / 100
1 ms452 KiB
#include <bits/stdc++.h> using namespace std; unordered_set < int > st; void cnt(int n,int sum,int mx) { st.insert(sum+n-1); for(int i=2;(i*i<=n && i<=mx);i++) { if((n%i)==0) { cnt(n/i,sum+i-1,i); } } } int main() { cin.tie(0); ios_base::sync_with_stdio(0); int n; cin>>n; cnt(n,0,n); cout<<st.size()<<"\n"; for(auto u:st) { cout<<u<<" "; } cout<<"\n"; return 0; }
#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...