Submission #791880

#TimeUsernameProblemLanguageResultExecution timeMemory
791880ttamxToys (CEOI18_toy)C++14
59 / 100
5050 ms852 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...