Submission #622417

#TimeUsernameProblemLanguageResultExecution timeMemory
622417HanksburgerToys (CEOI18_toy)C++17
100 / 100
436 ms16936 KiB
#include <bits/stdc++.h> using namespace std; vector<int> v; void f(int x, int y, int z) { v.push_back(z+x-1); for (int i=y; i*i<=x; i++) if (x%i==0) f(x/i, i, z+i-1); } int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; f(n, 2, 0); sort(v.begin(), v.end()); v.resize(unique(v.begin(), v.end())-v.begin()); cout << v.size() << '\n'; for (int x:v) 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...