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;
set<int> ans;
void solve(int num,int sum){
ans.emplace(sum+num-1);
for(int i=2;i*i<=num;i++){
if(num%i)continue;
solve(num/i,sum+i-1);
}
}
int main(){
cin.tie(nullptr)->sync_with_stdio(false);
cin >> n;
solve(n,0);
cout << ans.size() << "\n";
for(auto x:ans)cout << x << " ";
}
# | 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... |