# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1000148 | 2024-06-16T17:52:12 Z | daffuwu | Toys (CEOI18_toy) | C++14 | 1 ms | 348 KB |
#include <bits/stdc++.h> using namespace std; #define fr first #define sc second mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); int n, tmp, curi, curj, cur; vector<pair<int, vector<int> > > vc; void process(int dv) { int i; vc.push_back({dv, {}}); for (cur=1, i=vc.size()-1; i>=1; i--) { cur *= vc[i].fr; if (i == vc.size()-1 || vc[i-1].fr != dv) { for (auto x:vc[i-1].sc) { vc.back().sc.push_back(x+cur-1); } } } cur *= vc[0].fr; vc.back().sc.push_back(cur-1); } int main() { int i, j; scanf("%d", &n); for (i=2, tmp=n, curi=1; i*i<=n; i++) { for (; tmp%i == 0; tmp/=i) process(i); } if (tmp>1) process(tmp); sort(vc.back().sc.begin(), vc.back().sc.end()); printf("%d\n", (int)vc.back().sc.size()); for (auto x:vc.back().sc) printf("%d ", x); printf("\n"); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |