# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
266948 |
2020-08-15T14:30:20 Z |
islingr |
Toys (CEOI18_toy) |
C++17 |
|
1 ms |
384 KB |
#include <bits/stdc++.h>
using namespace std;
vector<int> v;
void recur(int z, int n, int s) {
if (z > n) return;
v.push_back(s + n - 1);
for (int d = z; d * d <= n; ++d)
if (n % d == 0)
recur(d, n / d, s + d - 1);
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n; cin >> n; recur(2, n, 0);
sort(begin(v), end(v)); v.erase(unique(begin(v), end(v)), end(v));
cout << v.size() << '\n';
for (int x : v) cout << x << ' ';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |