# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
536850 | | ecx | Toys (CEOI18_toy) | C++17 | | 5058 ms | 61316 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
set<pair<int, int>> vs;
set<int> s;
void dp(int n, int built) {
if (vs.find({n, built}) != vs.end()) return;
vs.insert({n, built});
s.insert(n+built-1);
for (int i = 2; i*i<=n; i++) {
if (n%i==0) {
dp(n/i, built+i-1);
}
}
}
int main() {
int n;
cin >> n;
dp(n, 0);
cout << s.size() << endl;
for (int k : s) cout << k << " ";
cout << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |