# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
966139 | | Tob | Toys (CEOI18_toy) | C++14 | | 5015 ms | 1240 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>
#pragma GCC optimize("O3","unroll-loops")
#define ll long long
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define pb push_back
#define FIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
using namespace std;
typedef pair <ll, ll> pii;
set <int> res;
void rek(int n, int sum) {
if (n == 1) {
res.insert(sum);
return;
}
for (int i = 2; i*i <= n; i++) {
if (n % i) continue;
rek(n/i, sum+i-1);
if (i*i != n) rek(i, sum+n/i-1);
}
rek(1, sum+n-1);
}
int main () {
FIO;
int n; cin >> n;
rek(n, 0);
cout << res.size() << "\n";
for (auto it : res) cout << it << " ";
return 0;
}
# | 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... |