# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
493219 |
2021-12-10T12:30:01 Z |
blue |
Toys (CEOI18_toy) |
C++17 |
|
724 ms |
262148 KB |
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
#define sz(x) (int(x.size()))
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
vector<int> res[1+n];
for(int i = 1; i <= n; i++)
{
res[i].push_back(i-1);
for(int j = 1; j < i && j*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].push_back(a+b);
// break;
}
}
sort(res[i].begin(), res[i].end());
res[i].erase(unique(res[i].begin(), res[i].end()), res[i].end());
// cerr << i << " : " << sz(res[i]) << '\n';
}
cout << sz(res[n]) << '\n';
for(int r: res[n]) cout << r << ' ';
cout << '\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
204 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
7 |
Correct |
0 ms |
204 KB |
Output is correct |
8 |
Correct |
0 ms |
204 KB |
Output is correct |
9 |
Correct |
0 ms |
204 KB |
Output is correct |
10 |
Correct |
0 ms |
204 KB |
Output is correct |
11 |
Correct |
1 ms |
280 KB |
Output is correct |
12 |
Correct |
0 ms |
204 KB |
Output is correct |
13 |
Correct |
0 ms |
204 KB |
Output is correct |
14 |
Correct |
0 ms |
204 KB |
Output is correct |
15 |
Correct |
0 ms |
204 KB |
Output is correct |
16 |
Correct |
0 ms |
204 KB |
Output is correct |
17 |
Correct |
0 ms |
204 KB |
Output is correct |
18 |
Correct |
0 ms |
204 KB |
Output is correct |
19 |
Correct |
0 ms |
204 KB |
Output is correct |
20 |
Correct |
0 ms |
204 KB |
Output is correct |
21 |
Correct |
0 ms |
204 KB |
Output is correct |
22 |
Correct |
0 ms |
204 KB |
Output is correct |
23 |
Correct |
0 ms |
204 KB |
Output is correct |
24 |
Correct |
1 ms |
308 KB |
Output is correct |
25 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
204 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
7 |
Correct |
0 ms |
204 KB |
Output is correct |
8 |
Correct |
0 ms |
204 KB |
Output is correct |
9 |
Correct |
0 ms |
204 KB |
Output is correct |
10 |
Correct |
0 ms |
204 KB |
Output is correct |
11 |
Correct |
1 ms |
280 KB |
Output is correct |
12 |
Correct |
0 ms |
204 KB |
Output is correct |
13 |
Correct |
0 ms |
204 KB |
Output is correct |
14 |
Correct |
0 ms |
204 KB |
Output is correct |
15 |
Correct |
0 ms |
204 KB |
Output is correct |
16 |
Correct |
0 ms |
204 KB |
Output is correct |
17 |
Correct |
0 ms |
204 KB |
Output is correct |
18 |
Correct |
0 ms |
204 KB |
Output is correct |
19 |
Correct |
0 ms |
204 KB |
Output is correct |
20 |
Correct |
0 ms |
204 KB |
Output is correct |
21 |
Correct |
0 ms |
204 KB |
Output is correct |
22 |
Correct |
0 ms |
204 KB |
Output is correct |
23 |
Correct |
0 ms |
204 KB |
Output is correct |
24 |
Correct |
1 ms |
308 KB |
Output is correct |
25 |
Correct |
1 ms |
204 KB |
Output is correct |
26 |
Correct |
20 ms |
2560 KB |
Output is correct |
27 |
Correct |
11 ms |
1548 KB |
Output is correct |
28 |
Correct |
6 ms |
716 KB |
Output is correct |
29 |
Correct |
2 ms |
588 KB |
Output is correct |
30 |
Correct |
2 ms |
460 KB |
Output is correct |
31 |
Correct |
23 ms |
3000 KB |
Output is correct |
32 |
Correct |
16 ms |
2380 KB |
Output is correct |
33 |
Correct |
16 ms |
2304 KB |
Output is correct |
34 |
Correct |
26 ms |
3540 KB |
Output is correct |
35 |
Correct |
30 ms |
3504 KB |
Output is correct |
36 |
Correct |
19 ms |
2764 KB |
Output is correct |
37 |
Correct |
18 ms |
2676 KB |
Output is correct |
38 |
Correct |
25 ms |
3632 KB |
Output is correct |
39 |
Correct |
26 ms |
3520 KB |
Output is correct |
40 |
Correct |
28 ms |
3080 KB |
Output is correct |
41 |
Correct |
29 ms |
3532 KB |
Output is correct |
42 |
Correct |
27 ms |
3528 KB |
Output is correct |
43 |
Correct |
26 ms |
3168 KB |
Output is correct |
44 |
Correct |
26 ms |
3640 KB |
Output is correct |
45 |
Correct |
28 ms |
3572 KB |
Output is correct |
46 |
Correct |
29 ms |
3524 KB |
Output is correct |
47 |
Correct |
26 ms |
3524 KB |
Output is correct |
48 |
Correct |
32 ms |
3568 KB |
Output is correct |
49 |
Correct |
27 ms |
3556 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
204 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
7 |
Correct |
0 ms |
204 KB |
Output is correct |
8 |
Correct |
0 ms |
204 KB |
Output is correct |
9 |
Correct |
0 ms |
204 KB |
Output is correct |
10 |
Correct |
0 ms |
204 KB |
Output is correct |
11 |
Correct |
1 ms |
280 KB |
Output is correct |
12 |
Correct |
0 ms |
204 KB |
Output is correct |
13 |
Correct |
0 ms |
204 KB |
Output is correct |
14 |
Correct |
0 ms |
204 KB |
Output is correct |
15 |
Correct |
0 ms |
204 KB |
Output is correct |
16 |
Correct |
0 ms |
204 KB |
Output is correct |
17 |
Correct |
0 ms |
204 KB |
Output is correct |
18 |
Correct |
0 ms |
204 KB |
Output is correct |
19 |
Correct |
0 ms |
204 KB |
Output is correct |
20 |
Correct |
0 ms |
204 KB |
Output is correct |
21 |
Correct |
0 ms |
204 KB |
Output is correct |
22 |
Correct |
0 ms |
204 KB |
Output is correct |
23 |
Correct |
0 ms |
204 KB |
Output is correct |
24 |
Correct |
1 ms |
308 KB |
Output is correct |
25 |
Correct |
1 ms |
204 KB |
Output is correct |
26 |
Correct |
20 ms |
2560 KB |
Output is correct |
27 |
Correct |
11 ms |
1548 KB |
Output is correct |
28 |
Correct |
6 ms |
716 KB |
Output is correct |
29 |
Correct |
2 ms |
588 KB |
Output is correct |
30 |
Correct |
2 ms |
460 KB |
Output is correct |
31 |
Correct |
23 ms |
3000 KB |
Output is correct |
32 |
Correct |
16 ms |
2380 KB |
Output is correct |
33 |
Correct |
16 ms |
2304 KB |
Output is correct |
34 |
Correct |
26 ms |
3540 KB |
Output is correct |
35 |
Correct |
30 ms |
3504 KB |
Output is correct |
36 |
Correct |
19 ms |
2764 KB |
Output is correct |
37 |
Correct |
18 ms |
2676 KB |
Output is correct |
38 |
Correct |
25 ms |
3632 KB |
Output is correct |
39 |
Correct |
26 ms |
3520 KB |
Output is correct |
40 |
Correct |
28 ms |
3080 KB |
Output is correct |
41 |
Correct |
29 ms |
3532 KB |
Output is correct |
42 |
Correct |
27 ms |
3528 KB |
Output is correct |
43 |
Correct |
26 ms |
3168 KB |
Output is correct |
44 |
Correct |
26 ms |
3640 KB |
Output is correct |
45 |
Correct |
28 ms |
3572 KB |
Output is correct |
46 |
Correct |
29 ms |
3524 KB |
Output is correct |
47 |
Correct |
26 ms |
3524 KB |
Output is correct |
48 |
Correct |
32 ms |
3568 KB |
Output is correct |
49 |
Correct |
27 ms |
3556 KB |
Output is correct |
50 |
Correct |
573 ms |
56484 KB |
Output is correct |
51 |
Correct |
314 ms |
33580 KB |
Output is correct |
52 |
Correct |
257 ms |
29524 KB |
Output is correct |
53 |
Correct |
235 ms |
25668 KB |
Output is correct |
54 |
Correct |
116 ms |
13484 KB |
Output is correct |
55 |
Correct |
594 ms |
63364 KB |
Output is correct |
56 |
Correct |
505 ms |
54400 KB |
Output is correct |
57 |
Correct |
474 ms |
49988 KB |
Output is correct |
58 |
Correct |
686 ms |
71732 KB |
Output is correct |
59 |
Correct |
683 ms |
69272 KB |
Output is correct |
60 |
Correct |
409 ms |
41540 KB |
Output is correct |
61 |
Correct |
635 ms |
65636 KB |
Output is correct |
62 |
Correct |
118 ms |
13012 KB |
Output is correct |
63 |
Correct |
683 ms |
71820 KB |
Output is correct |
64 |
Correct |
701 ms |
71768 KB |
Output is correct |
65 |
Correct |
599 ms |
62656 KB |
Output is correct |
66 |
Correct |
684 ms |
71972 KB |
Output is correct |
67 |
Correct |
724 ms |
71768 KB |
Output is correct |
68 |
Correct |
698 ms |
71808 KB |
Output is correct |
69 |
Correct |
695 ms |
71860 KB |
Output is correct |
70 |
Correct |
612 ms |
62576 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
204 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
7 |
Correct |
0 ms |
204 KB |
Output is correct |
8 |
Correct |
0 ms |
204 KB |
Output is correct |
9 |
Correct |
0 ms |
204 KB |
Output is correct |
10 |
Correct |
0 ms |
204 KB |
Output is correct |
11 |
Correct |
1 ms |
280 KB |
Output is correct |
12 |
Correct |
0 ms |
204 KB |
Output is correct |
13 |
Correct |
0 ms |
204 KB |
Output is correct |
14 |
Correct |
0 ms |
204 KB |
Output is correct |
15 |
Correct |
0 ms |
204 KB |
Output is correct |
16 |
Correct |
0 ms |
204 KB |
Output is correct |
17 |
Correct |
0 ms |
204 KB |
Output is correct |
18 |
Correct |
0 ms |
204 KB |
Output is correct |
19 |
Correct |
0 ms |
204 KB |
Output is correct |
20 |
Correct |
0 ms |
204 KB |
Output is correct |
21 |
Correct |
0 ms |
204 KB |
Output is correct |
22 |
Correct |
0 ms |
204 KB |
Output is correct |
23 |
Correct |
0 ms |
204 KB |
Output is correct |
24 |
Correct |
1 ms |
308 KB |
Output is correct |
25 |
Correct |
1 ms |
204 KB |
Output is correct |
26 |
Correct |
20 ms |
2560 KB |
Output is correct |
27 |
Correct |
11 ms |
1548 KB |
Output is correct |
28 |
Correct |
6 ms |
716 KB |
Output is correct |
29 |
Correct |
2 ms |
588 KB |
Output is correct |
30 |
Correct |
2 ms |
460 KB |
Output is correct |
31 |
Correct |
23 ms |
3000 KB |
Output is correct |
32 |
Correct |
16 ms |
2380 KB |
Output is correct |
33 |
Correct |
16 ms |
2304 KB |
Output is correct |
34 |
Correct |
26 ms |
3540 KB |
Output is correct |
35 |
Correct |
30 ms |
3504 KB |
Output is correct |
36 |
Correct |
19 ms |
2764 KB |
Output is correct |
37 |
Correct |
18 ms |
2676 KB |
Output is correct |
38 |
Correct |
25 ms |
3632 KB |
Output is correct |
39 |
Correct |
26 ms |
3520 KB |
Output is correct |
40 |
Correct |
28 ms |
3080 KB |
Output is correct |
41 |
Correct |
29 ms |
3532 KB |
Output is correct |
42 |
Correct |
27 ms |
3528 KB |
Output is correct |
43 |
Correct |
26 ms |
3168 KB |
Output is correct |
44 |
Correct |
26 ms |
3640 KB |
Output is correct |
45 |
Correct |
28 ms |
3572 KB |
Output is correct |
46 |
Correct |
29 ms |
3524 KB |
Output is correct |
47 |
Correct |
26 ms |
3524 KB |
Output is correct |
48 |
Correct |
32 ms |
3568 KB |
Output is correct |
49 |
Correct |
27 ms |
3556 KB |
Output is correct |
50 |
Correct |
573 ms |
56484 KB |
Output is correct |
51 |
Correct |
314 ms |
33580 KB |
Output is correct |
52 |
Correct |
257 ms |
29524 KB |
Output is correct |
53 |
Correct |
235 ms |
25668 KB |
Output is correct |
54 |
Correct |
116 ms |
13484 KB |
Output is correct |
55 |
Correct |
594 ms |
63364 KB |
Output is correct |
56 |
Correct |
505 ms |
54400 KB |
Output is correct |
57 |
Correct |
474 ms |
49988 KB |
Output is correct |
58 |
Correct |
686 ms |
71732 KB |
Output is correct |
59 |
Correct |
683 ms |
69272 KB |
Output is correct |
60 |
Correct |
409 ms |
41540 KB |
Output is correct |
61 |
Correct |
635 ms |
65636 KB |
Output is correct |
62 |
Correct |
118 ms |
13012 KB |
Output is correct |
63 |
Correct |
683 ms |
71820 KB |
Output is correct |
64 |
Correct |
701 ms |
71768 KB |
Output is correct |
65 |
Correct |
599 ms |
62656 KB |
Output is correct |
66 |
Correct |
684 ms |
71972 KB |
Output is correct |
67 |
Correct |
724 ms |
71768 KB |
Output is correct |
68 |
Correct |
698 ms |
71808 KB |
Output is correct |
69 |
Correct |
695 ms |
71860 KB |
Output is correct |
70 |
Correct |
612 ms |
62576 KB |
Output is correct |
71 |
Runtime error |
118 ms |
262148 KB |
Execution killed with signal 9 |
72 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
204 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
7 |
Correct |
0 ms |
204 KB |
Output is correct |
8 |
Correct |
0 ms |
204 KB |
Output is correct |
9 |
Correct |
0 ms |
204 KB |
Output is correct |
10 |
Correct |
0 ms |
204 KB |
Output is correct |
11 |
Correct |
1 ms |
280 KB |
Output is correct |
12 |
Correct |
0 ms |
204 KB |
Output is correct |
13 |
Correct |
0 ms |
204 KB |
Output is correct |
14 |
Correct |
0 ms |
204 KB |
Output is correct |
15 |
Correct |
0 ms |
204 KB |
Output is correct |
16 |
Correct |
0 ms |
204 KB |
Output is correct |
17 |
Correct |
0 ms |
204 KB |
Output is correct |
18 |
Correct |
0 ms |
204 KB |
Output is correct |
19 |
Correct |
0 ms |
204 KB |
Output is correct |
20 |
Correct |
0 ms |
204 KB |
Output is correct |
21 |
Correct |
0 ms |
204 KB |
Output is correct |
22 |
Correct |
0 ms |
204 KB |
Output is correct |
23 |
Correct |
0 ms |
204 KB |
Output is correct |
24 |
Correct |
1 ms |
308 KB |
Output is correct |
25 |
Correct |
1 ms |
204 KB |
Output is correct |
26 |
Correct |
20 ms |
2560 KB |
Output is correct |
27 |
Correct |
11 ms |
1548 KB |
Output is correct |
28 |
Correct |
6 ms |
716 KB |
Output is correct |
29 |
Correct |
2 ms |
588 KB |
Output is correct |
30 |
Correct |
2 ms |
460 KB |
Output is correct |
31 |
Correct |
23 ms |
3000 KB |
Output is correct |
32 |
Correct |
16 ms |
2380 KB |
Output is correct |
33 |
Correct |
16 ms |
2304 KB |
Output is correct |
34 |
Correct |
26 ms |
3540 KB |
Output is correct |
35 |
Correct |
30 ms |
3504 KB |
Output is correct |
36 |
Correct |
19 ms |
2764 KB |
Output is correct |
37 |
Correct |
18 ms |
2676 KB |
Output is correct |
38 |
Correct |
25 ms |
3632 KB |
Output is correct |
39 |
Correct |
26 ms |
3520 KB |
Output is correct |
40 |
Correct |
28 ms |
3080 KB |
Output is correct |
41 |
Correct |
29 ms |
3532 KB |
Output is correct |
42 |
Correct |
27 ms |
3528 KB |
Output is correct |
43 |
Correct |
26 ms |
3168 KB |
Output is correct |
44 |
Correct |
26 ms |
3640 KB |
Output is correct |
45 |
Correct |
28 ms |
3572 KB |
Output is correct |
46 |
Correct |
29 ms |
3524 KB |
Output is correct |
47 |
Correct |
26 ms |
3524 KB |
Output is correct |
48 |
Correct |
32 ms |
3568 KB |
Output is correct |
49 |
Correct |
27 ms |
3556 KB |
Output is correct |
50 |
Correct |
573 ms |
56484 KB |
Output is correct |
51 |
Correct |
314 ms |
33580 KB |
Output is correct |
52 |
Correct |
257 ms |
29524 KB |
Output is correct |
53 |
Correct |
235 ms |
25668 KB |
Output is correct |
54 |
Correct |
116 ms |
13484 KB |
Output is correct |
55 |
Correct |
594 ms |
63364 KB |
Output is correct |
56 |
Correct |
505 ms |
54400 KB |
Output is correct |
57 |
Correct |
474 ms |
49988 KB |
Output is correct |
58 |
Correct |
686 ms |
71732 KB |
Output is correct |
59 |
Correct |
683 ms |
69272 KB |
Output is correct |
60 |
Correct |
409 ms |
41540 KB |
Output is correct |
61 |
Correct |
635 ms |
65636 KB |
Output is correct |
62 |
Correct |
118 ms |
13012 KB |
Output is correct |
63 |
Correct |
683 ms |
71820 KB |
Output is correct |
64 |
Correct |
701 ms |
71768 KB |
Output is correct |
65 |
Correct |
599 ms |
62656 KB |
Output is correct |
66 |
Correct |
684 ms |
71972 KB |
Output is correct |
67 |
Correct |
724 ms |
71768 KB |
Output is correct |
68 |
Correct |
698 ms |
71808 KB |
Output is correct |
69 |
Correct |
695 ms |
71860 KB |
Output is correct |
70 |
Correct |
612 ms |
62576 KB |
Output is correct |
71 |
Runtime error |
118 ms |
262148 KB |
Execution killed with signal 9 |
72 |
Halted |
0 ms |
0 KB |
- |