Submission #266661

#TimeUsernameProblemLanguageResultExecution timeMemory
266661islingrToys (CEOI18_toy)C++17
100 / 100
648 ms4524 KiB
#include <bits/stdc++.h> using namespace std; set<int> s; void recur(int z, int n, int sum) { for (int d = z; d * d <= n; ++d) if (n % d == 0) recur(d, n / d, sum + d - 1); s.insert(sum + n - 1); } signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; recur(2, n, 0); cout << s.size() << '\n'; for (int v : s) cout << v << ' '; }
#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...