Submission #538550

#TimeUsernameProblemLanguageResultExecution timeMemory
538550rin_tohsakaToys (CEOI18_toy)C++14
59 / 100
5058 ms600 KiB
#include <bits/stdc++.h> using namespace std; set<int> ans; void call(int f, int curr){ //cout << "Called " << f << " " << curr << "\n"; if(f==1){ ans.insert(curr); return; } for (int i = 2; i<=f; i++){ if(f%i==0){ call(f/i,curr+i-1); } } } int main(){ int n;cin>>n; call(n,0); cout << ans.size(); auto it = ans.begin(); cout << "\n"; while(it!=ans.end()){ cout<<*it << " "; it++; } }
#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...