Submission #784546

#TimeUsernameProblemLanguageResultExecution timeMemory
784546Trisanu_DasToys (CEOI18_toy)C++17
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> using namespace std; set<int> ans; void res(int n, int last, int sum){ ans.insert(sum - n + 1); for(int i = last; i <= n / i; i++) if(n % i == 0) res(n / i, i, sum + i - 1); } int main(){ int n; cin >> n; res(n, 2, 0); cout << ans.size() << '\n'; for(int x : ans) cout << x << '\n'; cout << '\n'; }
#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...