Submission #153177

#TimeUsernameProblemLanguageResultExecution timeMemory
153177nicolaalexandraToys (CEOI18_toy)C++14
59 / 100
5079 ms1092 KiB
#include <iostream> #include <set> #include <vector> #include <algorithm> using namespace std; //ifstream cin ("date.in"); //ofstream cout ("date.out"); set <int> sol; int x,nr,d; void back (int x, int val){ sol.insert (x+val-1); /// vreau sa maresc nr de factori cu 1 for (int d=2;d<=x/d;d++) if (x % d == 0) back (x/d,val+d-1); } int main (){ cin>>x; back (x,0); //sol.insert (x-1); cout<<sol.size()<<"\n"; for (auto x:sol) cout<<x<<" "; 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...