# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
267052 | pedroslrey | Toys (CEOI18_toy) | C++17 | 5055 ms | 964 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<int> ans;
void calc(int n, int sum) {
ans.insert(sum + n - 1);
for (int i = 2; i <= n/i; ++i)
if (n % i == 0)
calc(n/i, sum + i - 1);
}
int main() {
int n;
scanf("%d", &n);
calc(n, 0);
printf("%d\n", (int)ans.size());
for (int x: ans)
printf("%d ", x);
printf("\n");
}
Compilation message (stderr)
# | 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... |