# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
267049 | 2020-08-15T18:21:52 Z | Kenzo_1114 | Toys (CEOI18_toy) | C++17 | 1 ms | 384 KB |
#include<bits/stdc++.h> using namespace std; int n, s[40]; vector<int> v; vector<int> ans[40]; set<int> ANS; set<int> :: iterator it; int main () { scanf("%d", &n); int sq = sqrt(n) + 1; for(int i = 2; i <= sq; i++) while(n % i == 0) n /= i, v.push_back(i); if(n > 1) v.push_back(n); v.push_back(0); sort(v.begin(), v.end()); int sz = v.size(); s[0] = 1; for(int i = 1; i < sz; i++) s[i] = s[i - 1] * v[i]; ans[0].push_back(0); for(int i = 1; i < sz; i++) for(int j = 1; j <= i; j++) for(int k = 0; k < ans[j - 1].size(); k++) ans[i].push_back(ans[j - 1][k] + s[i] / s[j - 1] - 1); /* for(int i = 0; i < sz; i++) { printf("\nans[%d] : \n", i); for(int j = 0; j < ans[i].size(); j++) printf("%d ", ans[i][j]); printf("\n"); } */ for(int i = 0; i < ans[sz - 1].size(); i++) ANS.insert(ans[sz - 1][i]); printf("%d\n", (int) ANS.size()); for(it = ANS.begin(); it != ANS.end(); it++) printf("%d ", (*it)); printf("\n"); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 256 KB | Output is correct |
3 | Correct | 0 ms | 256 KB | Output is correct |
4 | Correct | 1 ms | 256 KB | Output is correct |
5 | Correct | 1 ms | 256 KB | Output is correct |
6 | Correct | 0 ms | 256 KB | Output is correct |
7 | Correct | 1 ms | 256 KB | Output is correct |
8 | Correct | 0 ms | 256 KB | Output is correct |
9 | Correct | 0 ms | 256 KB | Output is correct |
10 | Correct | 1 ms | 256 KB | Output is correct |
11 | Correct | 1 ms | 256 KB | Output is correct |
12 | Correct | 0 ms | 256 KB | Output is correct |
13 | Correct | 1 ms | 384 KB | Output is correct |
14 | Correct | 0 ms | 256 KB | Output is correct |
15 | Correct | 0 ms | 256 KB | Output is correct |
16 | Correct | 1 ms | 256 KB | Output is correct |
17 | Correct | 0 ms | 256 KB | Output is correct |
18 | Correct | 1 ms | 256 KB | Output is correct |
19 | Correct | 0 ms | 256 KB | Output is correct |
20 | Correct | 0 ms | 256 KB | Output is correct |
21 | Correct | 1 ms | 256 KB | Output is correct |
22 | Correct | 1 ms | 256 KB | Output is correct |
23 | Correct | 1 ms | 256 KB | Output is correct |
24 | Correct | 0 ms | 256 KB | Output is correct |
25 | Correct | 0 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 256 KB | Output is correct |
3 | Correct | 0 ms | 256 KB | Output is correct |
4 | Correct | 1 ms | 256 KB | Output is correct |
5 | Correct | 1 ms | 256 KB | Output is correct |
6 | Correct | 0 ms | 256 KB | Output is correct |
7 | Correct | 1 ms | 256 KB | Output is correct |
8 | Correct | 0 ms | 256 KB | Output is correct |
9 | Correct | 0 ms | 256 KB | Output is correct |
10 | Correct | 1 ms | 256 KB | Output is correct |
11 | Correct | 1 ms | 256 KB | Output is correct |
12 | Correct | 0 ms | 256 KB | Output is correct |
13 | Correct | 1 ms | 384 KB | Output is correct |
14 | Correct | 0 ms | 256 KB | Output is correct |
15 | Correct | 0 ms | 256 KB | Output is correct |
16 | Correct | 1 ms | 256 KB | Output is correct |
17 | Correct | 0 ms | 256 KB | Output is correct |
18 | Correct | 1 ms | 256 KB | Output is correct |
19 | Correct | 0 ms | 256 KB | Output is correct |
20 | Correct | 0 ms | 256 KB | Output is correct |
21 | Correct | 1 ms | 256 KB | Output is correct |
22 | Correct | 1 ms | 256 KB | Output is correct |
23 | Correct | 1 ms | 256 KB | Output is correct |
24 | Correct | 0 ms | 256 KB | Output is correct |
25 | Correct | 0 ms | 256 KB | Output is correct |
26 | Incorrect | 0 ms | 256 KB | Output isn't correct |
27 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 256 KB | Output is correct |
3 | Correct | 0 ms | 256 KB | Output is correct |
4 | Correct | 1 ms | 256 KB | Output is correct |
5 | Correct | 1 ms | 256 KB | Output is correct |
6 | Correct | 0 ms | 256 KB | Output is correct |
7 | Correct | 1 ms | 256 KB | Output is correct |
8 | Correct | 0 ms | 256 KB | Output is correct |
9 | Correct | 0 ms | 256 KB | Output is correct |
10 | Correct | 1 ms | 256 KB | Output is correct |
11 | Correct | 1 ms | 256 KB | Output is correct |
12 | Correct | 0 ms | 256 KB | Output is correct |
13 | Correct | 1 ms | 384 KB | Output is correct |
14 | Correct | 0 ms | 256 KB | Output is correct |
15 | Correct | 0 ms | 256 KB | Output is correct |
16 | Correct | 1 ms | 256 KB | Output is correct |
17 | Correct | 0 ms | 256 KB | Output is correct |
18 | Correct | 1 ms | 256 KB | Output is correct |
19 | Correct | 0 ms | 256 KB | Output is correct |
20 | Correct | 0 ms | 256 KB | Output is correct |
21 | Correct | 1 ms | 256 KB | Output is correct |
22 | Correct | 1 ms | 256 KB | Output is correct |
23 | Correct | 1 ms | 256 KB | Output is correct |
24 | Correct | 0 ms | 256 KB | Output is correct |
25 | Correct | 0 ms | 256 KB | Output is correct |
26 | Incorrect | 0 ms | 256 KB | Output isn't correct |
27 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 256 KB | Output is correct |
3 | Correct | 0 ms | 256 KB | Output is correct |
4 | Correct | 1 ms | 256 KB | Output is correct |
5 | Correct | 1 ms | 256 KB | Output is correct |
6 | Correct | 0 ms | 256 KB | Output is correct |
7 | Correct | 1 ms | 256 KB | Output is correct |
8 | Correct | 0 ms | 256 KB | Output is correct |
9 | Correct | 0 ms | 256 KB | Output is correct |
10 | Correct | 1 ms | 256 KB | Output is correct |
11 | Correct | 1 ms | 256 KB | Output is correct |
12 | Correct | 0 ms | 256 KB | Output is correct |
13 | Correct | 1 ms | 384 KB | Output is correct |
14 | Correct | 0 ms | 256 KB | Output is correct |
15 | Correct | 0 ms | 256 KB | Output is correct |
16 | Correct | 1 ms | 256 KB | Output is correct |
17 | Correct | 0 ms | 256 KB | Output is correct |
18 | Correct | 1 ms | 256 KB | Output is correct |
19 | Correct | 0 ms | 256 KB | Output is correct |
20 | Correct | 0 ms | 256 KB | Output is correct |
21 | Correct | 1 ms | 256 KB | Output is correct |
22 | Correct | 1 ms | 256 KB | Output is correct |
23 | Correct | 1 ms | 256 KB | Output is correct |
24 | Correct | 0 ms | 256 KB | Output is correct |
25 | Correct | 0 ms | 256 KB | Output is correct |
26 | Incorrect | 0 ms | 256 KB | Output isn't correct |
27 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 256 KB | Output is correct |
3 | Correct | 0 ms | 256 KB | Output is correct |
4 | Correct | 1 ms | 256 KB | Output is correct |
5 | Correct | 1 ms | 256 KB | Output is correct |
6 | Correct | 0 ms | 256 KB | Output is correct |
7 | Correct | 1 ms | 256 KB | Output is correct |
8 | Correct | 0 ms | 256 KB | Output is correct |
9 | Correct | 0 ms | 256 KB | Output is correct |
10 | Correct | 1 ms | 256 KB | Output is correct |
11 | Correct | 1 ms | 256 KB | Output is correct |
12 | Correct | 0 ms | 256 KB | Output is correct |
13 | Correct | 1 ms | 384 KB | Output is correct |
14 | Correct | 0 ms | 256 KB | Output is correct |
15 | Correct | 0 ms | 256 KB | Output is correct |
16 | Correct | 1 ms | 256 KB | Output is correct |
17 | Correct | 0 ms | 256 KB | Output is correct |
18 | Correct | 1 ms | 256 KB | Output is correct |
19 | Correct | 0 ms | 256 KB | Output is correct |
20 | Correct | 0 ms | 256 KB | Output is correct |
21 | Correct | 1 ms | 256 KB | Output is correct |
22 | Correct | 1 ms | 256 KB | Output is correct |
23 | Correct | 1 ms | 256 KB | Output is correct |
24 | Correct | 0 ms | 256 KB | Output is correct |
25 | Correct | 0 ms | 256 KB | Output is correct |
26 | Incorrect | 0 ms | 256 KB | Output isn't correct |
27 | Halted | 0 ms | 0 KB | - |