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;
typedef long long ll;
set <ll> ans;
ll n;
void solve(ll idx, ll cur, ll start){
ans.insert(cur + idx - 1);
for (int i = start; i <= sqrt(idx) ; i++){
if (idx % i == 0)
solve(idx / i, cur + i - 1, i);
}
}
int main(){
cin >> n;
solve(n, 0, 2);
cout << ans.size()<<endl;
for (auto u: ans){
cout << u <<" ";
}
}
# | 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... |