Submission #828452

#TimeUsernameProblemLanguageResultExecution timeMemory
828452shoryu386Toys (CEOI18_toy)C++17
0 / 100
1 ms300 KiB
#include <bits/stdc++.h> using namespace std; #define int long long set<int> recur(int n){ set<int> ret; for (int x = 2; x <= sqrt(n); x++){ if (n % x == 0) { for (auto y : recur(n/x)){ ret.insert(x-1 + y); } } } return ret; } main(){ int n; cin >> n; set<int> ans = recur(n); cout << ans.size() << '\n'; for (auto x : ans){ cout << x << ' '; } }

Compilation message (stderr)

toy.cpp:18:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   18 | main(){
      | ^~~~
#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...