Submission #248796

# Submission time Handle Problem Language Result Execution time Memory
248796 2020-07-13T12:26:31 Z Sorting Toys (CEOI18_toy) C++14
0 / 100
0 ms 384 KB
#include <bits/stdc++.h>

using namespace std;

vector<int> ans;

void solve(int sum, int n, int last){
    ans.push_back(sum + n - 1);
    for(int i = last; i * i <= n; ++i)
        if(n % i == 0)
            solve(sum + i - 1, n / i, i);
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin >> n;

    solve(0, 2, 2);
    ans.resize(unique(ans.begin(), ans.end()) - ans.begin());

    cout << ans.size() << "\n";
    for(int x: ans)
        cout << x << " ";
    cout << "\n";
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -