Submission #131802

#TimeUsernameProblemLanguageResultExecution timeMemory
131802apostoldaniel854Toys (CEOI18_toy)C++14
100 / 100
457 ms17036 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back vector <int> ans; void bkt (int n, int sum, int d) { ans.pb (sum + n - 1); for (int i = d; i * i <= n; i++) if (n % i == 0) bkt (n / i, sum + i - 1, i); } int main() { int n; cin >> n; bkt (n, 0, 2); sort (ans.begin (), ans.end ()); ans.erase (unique (ans.begin (), ans.end ()), ans.end ()); cout << ans.size () << "\n"; for (auto x : ans) cout << x << " "; 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...