# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
746496 |
2023-05-22T14:22:50 Z |
vjudge1 |
Toys (CEOI18_toy) |
C++17 |
|
652 ms |
262144 KB |
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin>>n;
vector<set<int>>st(n+1);
vector<vector<int>>allv(n+1);
for(int i=2;i<=n;i++){
for(int j=i;j<=n;j+=i){
allv[j].push_back(i);
}
}
st[1].insert(0);
for(int i=1;i<=n;i++){
for(auto x:allv[i]){
for(auto y:st[i/x]){
//cout<<i<<" "<<x<<" "<<i<<'\n';
st[i].insert(x-1+y);
}
}
}
int sz=st[n].size();
cout<<sz<<"\n";
for(auto x:st[n]){
cout<<x<<" ";
}
cout<<'\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
0 ms |
212 KB |
Output is correct |
17 |
Correct |
0 ms |
212 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
0 ms |
212 KB |
Output is correct |
20 |
Correct |
0 ms |
212 KB |
Output is correct |
21 |
Correct |
1 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
0 ms |
212 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
0 ms |
212 KB |
Output is correct |
17 |
Correct |
0 ms |
212 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
0 ms |
212 KB |
Output is correct |
20 |
Correct |
0 ms |
212 KB |
Output is correct |
21 |
Correct |
1 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
0 ms |
212 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
1 ms |
212 KB |
Output is correct |
26 |
Correct |
24 ms |
5324 KB |
Output is correct |
27 |
Correct |
12 ms |
3412 KB |
Output is correct |
28 |
Correct |
5 ms |
1620 KB |
Output is correct |
29 |
Correct |
3 ms |
1108 KB |
Output is correct |
30 |
Correct |
2 ms |
852 KB |
Output is correct |
31 |
Correct |
22 ms |
6228 KB |
Output is correct |
32 |
Correct |
19 ms |
5076 KB |
Output is correct |
33 |
Correct |
15 ms |
4692 KB |
Output is correct |
34 |
Correct |
28 ms |
7252 KB |
Output is correct |
35 |
Correct |
26 ms |
7120 KB |
Output is correct |
36 |
Correct |
21 ms |
5840 KB |
Output is correct |
37 |
Correct |
19 ms |
5508 KB |
Output is correct |
38 |
Correct |
30 ms |
7328 KB |
Output is correct |
39 |
Correct |
28 ms |
7324 KB |
Output is correct |
40 |
Correct |
26 ms |
6420 KB |
Output is correct |
41 |
Correct |
27 ms |
7228 KB |
Output is correct |
42 |
Correct |
27 ms |
7244 KB |
Output is correct |
43 |
Correct |
25 ms |
6484 KB |
Output is correct |
44 |
Correct |
27 ms |
7272 KB |
Output is correct |
45 |
Correct |
27 ms |
7268 KB |
Output is correct |
46 |
Correct |
29 ms |
7252 KB |
Output is correct |
47 |
Correct |
36 ms |
7252 KB |
Output is correct |
48 |
Correct |
33 ms |
7300 KB |
Output is correct |
49 |
Correct |
28 ms |
7244 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
0 ms |
212 KB |
Output is correct |
17 |
Correct |
0 ms |
212 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
0 ms |
212 KB |
Output is correct |
20 |
Correct |
0 ms |
212 KB |
Output is correct |
21 |
Correct |
1 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
0 ms |
212 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
1 ms |
212 KB |
Output is correct |
26 |
Correct |
24 ms |
5324 KB |
Output is correct |
27 |
Correct |
12 ms |
3412 KB |
Output is correct |
28 |
Correct |
5 ms |
1620 KB |
Output is correct |
29 |
Correct |
3 ms |
1108 KB |
Output is correct |
30 |
Correct |
2 ms |
852 KB |
Output is correct |
31 |
Correct |
22 ms |
6228 KB |
Output is correct |
32 |
Correct |
19 ms |
5076 KB |
Output is correct |
33 |
Correct |
15 ms |
4692 KB |
Output is correct |
34 |
Correct |
28 ms |
7252 KB |
Output is correct |
35 |
Correct |
26 ms |
7120 KB |
Output is correct |
36 |
Correct |
21 ms |
5840 KB |
Output is correct |
37 |
Correct |
19 ms |
5508 KB |
Output is correct |
38 |
Correct |
30 ms |
7328 KB |
Output is correct |
39 |
Correct |
28 ms |
7324 KB |
Output is correct |
40 |
Correct |
26 ms |
6420 KB |
Output is correct |
41 |
Correct |
27 ms |
7228 KB |
Output is correct |
42 |
Correct |
27 ms |
7244 KB |
Output is correct |
43 |
Correct |
25 ms |
6484 KB |
Output is correct |
44 |
Correct |
27 ms |
7272 KB |
Output is correct |
45 |
Correct |
27 ms |
7268 KB |
Output is correct |
46 |
Correct |
29 ms |
7252 KB |
Output is correct |
47 |
Correct |
36 ms |
7252 KB |
Output is correct |
48 |
Correct |
33 ms |
7300 KB |
Output is correct |
49 |
Correct |
28 ms |
7244 KB |
Output is correct |
50 |
Correct |
453 ms |
88772 KB |
Output is correct |
51 |
Correct |
276 ms |
54896 KB |
Output is correct |
52 |
Correct |
233 ms |
48956 KB |
Output is correct |
53 |
Correct |
202 ms |
43268 KB |
Output is correct |
54 |
Correct |
104 ms |
24140 KB |
Output is correct |
55 |
Correct |
490 ms |
98512 KB |
Output is correct |
56 |
Correct |
431 ms |
85696 KB |
Output is correct |
57 |
Correct |
434 ms |
79352 KB |
Output is correct |
58 |
Correct |
564 ms |
110540 KB |
Output is correct |
59 |
Correct |
558 ms |
107136 KB |
Output is correct |
60 |
Correct |
367 ms |
66864 KB |
Output is correct |
61 |
Correct |
528 ms |
101948 KB |
Output is correct |
62 |
Correct |
108 ms |
23388 KB |
Output is correct |
63 |
Correct |
652 ms |
110524 KB |
Output is correct |
64 |
Correct |
623 ms |
110596 KB |
Output is correct |
65 |
Correct |
526 ms |
97568 KB |
Output is correct |
66 |
Correct |
585 ms |
110540 KB |
Output is correct |
67 |
Correct |
608 ms |
110480 KB |
Output is correct |
68 |
Correct |
573 ms |
110488 KB |
Output is correct |
69 |
Correct |
620 ms |
110584 KB |
Output is correct |
70 |
Correct |
504 ms |
97684 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
0 ms |
212 KB |
Output is correct |
17 |
Correct |
0 ms |
212 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
0 ms |
212 KB |
Output is correct |
20 |
Correct |
0 ms |
212 KB |
Output is correct |
21 |
Correct |
1 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
0 ms |
212 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
1 ms |
212 KB |
Output is correct |
26 |
Correct |
24 ms |
5324 KB |
Output is correct |
27 |
Correct |
12 ms |
3412 KB |
Output is correct |
28 |
Correct |
5 ms |
1620 KB |
Output is correct |
29 |
Correct |
3 ms |
1108 KB |
Output is correct |
30 |
Correct |
2 ms |
852 KB |
Output is correct |
31 |
Correct |
22 ms |
6228 KB |
Output is correct |
32 |
Correct |
19 ms |
5076 KB |
Output is correct |
33 |
Correct |
15 ms |
4692 KB |
Output is correct |
34 |
Correct |
28 ms |
7252 KB |
Output is correct |
35 |
Correct |
26 ms |
7120 KB |
Output is correct |
36 |
Correct |
21 ms |
5840 KB |
Output is correct |
37 |
Correct |
19 ms |
5508 KB |
Output is correct |
38 |
Correct |
30 ms |
7328 KB |
Output is correct |
39 |
Correct |
28 ms |
7324 KB |
Output is correct |
40 |
Correct |
26 ms |
6420 KB |
Output is correct |
41 |
Correct |
27 ms |
7228 KB |
Output is correct |
42 |
Correct |
27 ms |
7244 KB |
Output is correct |
43 |
Correct |
25 ms |
6484 KB |
Output is correct |
44 |
Correct |
27 ms |
7272 KB |
Output is correct |
45 |
Correct |
27 ms |
7268 KB |
Output is correct |
46 |
Correct |
29 ms |
7252 KB |
Output is correct |
47 |
Correct |
36 ms |
7252 KB |
Output is correct |
48 |
Correct |
33 ms |
7300 KB |
Output is correct |
49 |
Correct |
28 ms |
7244 KB |
Output is correct |
50 |
Correct |
453 ms |
88772 KB |
Output is correct |
51 |
Correct |
276 ms |
54896 KB |
Output is correct |
52 |
Correct |
233 ms |
48956 KB |
Output is correct |
53 |
Correct |
202 ms |
43268 KB |
Output is correct |
54 |
Correct |
104 ms |
24140 KB |
Output is correct |
55 |
Correct |
490 ms |
98512 KB |
Output is correct |
56 |
Correct |
431 ms |
85696 KB |
Output is correct |
57 |
Correct |
434 ms |
79352 KB |
Output is correct |
58 |
Correct |
564 ms |
110540 KB |
Output is correct |
59 |
Correct |
558 ms |
107136 KB |
Output is correct |
60 |
Correct |
367 ms |
66864 KB |
Output is correct |
61 |
Correct |
528 ms |
101948 KB |
Output is correct |
62 |
Correct |
108 ms |
23388 KB |
Output is correct |
63 |
Correct |
652 ms |
110524 KB |
Output is correct |
64 |
Correct |
623 ms |
110596 KB |
Output is correct |
65 |
Correct |
526 ms |
97568 KB |
Output is correct |
66 |
Correct |
585 ms |
110540 KB |
Output is correct |
67 |
Correct |
608 ms |
110480 KB |
Output is correct |
68 |
Correct |
573 ms |
110488 KB |
Output is correct |
69 |
Correct |
620 ms |
110584 KB |
Output is correct |
70 |
Correct |
504 ms |
97684 KB |
Output is correct |
71 |
Runtime error |
107 ms |
262144 KB |
Execution killed with signal 9 |
72 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
0 ms |
212 KB |
Output is correct |
17 |
Correct |
0 ms |
212 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
0 ms |
212 KB |
Output is correct |
20 |
Correct |
0 ms |
212 KB |
Output is correct |
21 |
Correct |
1 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
0 ms |
212 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
1 ms |
212 KB |
Output is correct |
26 |
Correct |
24 ms |
5324 KB |
Output is correct |
27 |
Correct |
12 ms |
3412 KB |
Output is correct |
28 |
Correct |
5 ms |
1620 KB |
Output is correct |
29 |
Correct |
3 ms |
1108 KB |
Output is correct |
30 |
Correct |
2 ms |
852 KB |
Output is correct |
31 |
Correct |
22 ms |
6228 KB |
Output is correct |
32 |
Correct |
19 ms |
5076 KB |
Output is correct |
33 |
Correct |
15 ms |
4692 KB |
Output is correct |
34 |
Correct |
28 ms |
7252 KB |
Output is correct |
35 |
Correct |
26 ms |
7120 KB |
Output is correct |
36 |
Correct |
21 ms |
5840 KB |
Output is correct |
37 |
Correct |
19 ms |
5508 KB |
Output is correct |
38 |
Correct |
30 ms |
7328 KB |
Output is correct |
39 |
Correct |
28 ms |
7324 KB |
Output is correct |
40 |
Correct |
26 ms |
6420 KB |
Output is correct |
41 |
Correct |
27 ms |
7228 KB |
Output is correct |
42 |
Correct |
27 ms |
7244 KB |
Output is correct |
43 |
Correct |
25 ms |
6484 KB |
Output is correct |
44 |
Correct |
27 ms |
7272 KB |
Output is correct |
45 |
Correct |
27 ms |
7268 KB |
Output is correct |
46 |
Correct |
29 ms |
7252 KB |
Output is correct |
47 |
Correct |
36 ms |
7252 KB |
Output is correct |
48 |
Correct |
33 ms |
7300 KB |
Output is correct |
49 |
Correct |
28 ms |
7244 KB |
Output is correct |
50 |
Correct |
453 ms |
88772 KB |
Output is correct |
51 |
Correct |
276 ms |
54896 KB |
Output is correct |
52 |
Correct |
233 ms |
48956 KB |
Output is correct |
53 |
Correct |
202 ms |
43268 KB |
Output is correct |
54 |
Correct |
104 ms |
24140 KB |
Output is correct |
55 |
Correct |
490 ms |
98512 KB |
Output is correct |
56 |
Correct |
431 ms |
85696 KB |
Output is correct |
57 |
Correct |
434 ms |
79352 KB |
Output is correct |
58 |
Correct |
564 ms |
110540 KB |
Output is correct |
59 |
Correct |
558 ms |
107136 KB |
Output is correct |
60 |
Correct |
367 ms |
66864 KB |
Output is correct |
61 |
Correct |
528 ms |
101948 KB |
Output is correct |
62 |
Correct |
108 ms |
23388 KB |
Output is correct |
63 |
Correct |
652 ms |
110524 KB |
Output is correct |
64 |
Correct |
623 ms |
110596 KB |
Output is correct |
65 |
Correct |
526 ms |
97568 KB |
Output is correct |
66 |
Correct |
585 ms |
110540 KB |
Output is correct |
67 |
Correct |
608 ms |
110480 KB |
Output is correct |
68 |
Correct |
573 ms |
110488 KB |
Output is correct |
69 |
Correct |
620 ms |
110584 KB |
Output is correct |
70 |
Correct |
504 ms |
97684 KB |
Output is correct |
71 |
Runtime error |
107 ms |
262144 KB |
Execution killed with signal 9 |
72 |
Halted |
0 ms |
0 KB |
- |