# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
267089 | Kenzo_1114 | Toys (CEOI18_toy) | C++17 | 631 ms | 4732 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;
int n, sum;
set<int> ans;
set<int> :: iterator it;
void BKT(int num, int last)
{
ans.insert(num + sum - 1);
if(num == 1) return;
for(long long int i = last; i * i <= num; i++)
{
if(num % i == 0)
{
sum += i - 1;
BKT(num / i, i);
sum -= i - 1;
}
}
}
int main ()
{
scanf("%d", &n);
BKT(n, 2);
printf("%d\n", (int) ans.size());
for(it = ans.begin(); it != ans.end(); it++) printf("%d ", (*it));
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... |