Submission #493215

#TimeUsernameProblemLanguageResultExecution timeMemory
493215blueToys (CEOI18_toy)C++17
0 / 100
0 ms204 KiB
#include <iostream> #include <vector> #include <set> using namespace std; #define sz(x) (int(x.size())) int main() { int n; cin >> n; set<int> res[1+n]; for(int i = 2; i <= n; i++) { for(int j = 2; j < i; j++) { if(i % j == 0) { int u = j; int v = i/j; for(int a: res[u]) for(int b: res[v]) res[i].insert(a+b); // break; } } // cerr << i << " : " << flag << '\n'; res[i].insert(i-1); // cerr << i << ' ' << sz(res[i]) << '\n'; // if(i == n) cerr << "!!! " << sz(res[n]) << '\n'; // cerr << "i = " << i << ": "; // for(int r: res[i]) cerr << r << ' '; // cerr << '\n'; } cout << sz(res[n]) << '\n'; for(int r: res[n]) cout << r << ' '; 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...