Submission #787079

# Submission time Handle Problem Language Result Execution time Memory
787079 2023-07-18T18:49:26 Z beaconmc Toys (CEOI18_toy) PyPy 3
100 / 100
1290 ms 104288 KB
from math import sqrt, floor
n = int(input())

divs = []
for i in range(1, floor(sqrt(n))+1):
    if n%i==0:
        divs.append(i)
        if i != n//i:
            divs.append(n//i)
divs.sort()

divind = dict()
for i in range(len(divs)):
    divind[divs[i]] = i


sus = [set() for i in range(len(divs)+1)]

sus[0].add(0)

for i in range(len(divs)):
    for j in range(1, len(divs)):
        if n%(divs[i] * divs[j]): continue

        for k in sus[i]:
            sus[divind[divs[i] * divs[j]]].add(k + divs[j]-1)
print(len(sus[-2]))
print(" ".join(map(str, sorted(sus[-2]))))
# Verdict Execution time Memory Grader output
1 Correct 30 ms 18356 KB Output is correct
2 Correct 37 ms 18172 KB Output is correct
3 Correct 37 ms 18176 KB Output is correct
4 Correct 33 ms 18248 KB Output is correct
5 Correct 30 ms 18236 KB Output is correct
6 Correct 31 ms 18200 KB Output is correct
7 Correct 29 ms 18220 KB Output is correct
8 Correct 29 ms 18212 KB Output is correct
9 Correct 30 ms 18220 KB Output is correct
10 Correct 30 ms 18180 KB Output is correct
11 Correct 30 ms 18208 KB Output is correct
12 Correct 29 ms 18216 KB Output is correct
13 Correct 31 ms 18252 KB Output is correct
14 Correct 30 ms 18248 KB Output is correct
15 Correct 31 ms 18260 KB Output is correct
16 Correct 30 ms 18200 KB Output is correct
17 Correct 30 ms 18232 KB Output is correct
18 Correct 31 ms 18260 KB Output is correct
19 Correct 37 ms 18204 KB Output is correct
20 Correct 31 ms 18220 KB Output is correct
21 Correct 30 ms 18260 KB Output is correct
22 Correct 36 ms 18248 KB Output is correct
23 Correct 30 ms 18260 KB Output is correct
24 Correct 30 ms 18140 KB Output is correct
25 Correct 29 ms 18268 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 30 ms 18356 KB Output is correct
2 Correct 37 ms 18172 KB Output is correct
3 Correct 37 ms 18176 KB Output is correct
4 Correct 33 ms 18248 KB Output is correct
5 Correct 30 ms 18236 KB Output is correct
6 Correct 31 ms 18200 KB Output is correct
7 Correct 29 ms 18220 KB Output is correct
8 Correct 29 ms 18212 KB Output is correct
9 Correct 30 ms 18220 KB Output is correct
10 Correct 30 ms 18180 KB Output is correct
11 Correct 30 ms 18208 KB Output is correct
12 Correct 29 ms 18216 KB Output is correct
13 Correct 31 ms 18252 KB Output is correct
14 Correct 30 ms 18248 KB Output is correct
15 Correct 31 ms 18260 KB Output is correct
16 Correct 30 ms 18200 KB Output is correct
17 Correct 30 ms 18232 KB Output is correct
18 Correct 31 ms 18260 KB Output is correct
19 Correct 37 ms 18204 KB Output is correct
20 Correct 31 ms 18220 KB Output is correct
21 Correct 30 ms 18260 KB Output is correct
22 Correct 36 ms 18248 KB Output is correct
23 Correct 30 ms 18260 KB Output is correct
24 Correct 30 ms 18140 KB Output is correct
25 Correct 29 ms 18268 KB Output is correct
26 Correct 38 ms 19368 KB Output is correct
27 Correct 39 ms 19196 KB Output is correct
28 Correct 36 ms 19032 KB Output is correct
29 Correct 35 ms 19108 KB Output is correct
30 Correct 36 ms 18808 KB Output is correct
31 Correct 37 ms 18948 KB Output is correct
32 Correct 41 ms 18960 KB Output is correct
33 Correct 37 ms 18900 KB Output is correct
34 Correct 30 ms 18208 KB Output is correct
35 Correct 30 ms 18160 KB Output is correct
36 Correct 32 ms 18184 KB Output is correct
37 Correct 36 ms 18900 KB Output is correct
38 Correct 30 ms 18264 KB Output is correct
39 Correct 37 ms 18148 KB Output is correct
40 Correct 40 ms 19068 KB Output is correct
41 Correct 29 ms 18176 KB Output is correct
42 Correct 39 ms 18220 KB Output is correct
43 Correct 31 ms 18220 KB Output is correct
44 Correct 30 ms 18168 KB Output is correct
45 Correct 33 ms 18644 KB Output is correct
46 Correct 30 ms 18168 KB Output is correct
47 Correct 37 ms 18916 KB Output is correct
48 Correct 38 ms 18152 KB Output is correct
49 Correct 33 ms 18280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 30 ms 18356 KB Output is correct
2 Correct 37 ms 18172 KB Output is correct
3 Correct 37 ms 18176 KB Output is correct
4 Correct 33 ms 18248 KB Output is correct
5 Correct 30 ms 18236 KB Output is correct
6 Correct 31 ms 18200 KB Output is correct
7 Correct 29 ms 18220 KB Output is correct
8 Correct 29 ms 18212 KB Output is correct
9 Correct 30 ms 18220 KB Output is correct
10 Correct 30 ms 18180 KB Output is correct
11 Correct 30 ms 18208 KB Output is correct
12 Correct 29 ms 18216 KB Output is correct
13 Correct 31 ms 18252 KB Output is correct
14 Correct 30 ms 18248 KB Output is correct
15 Correct 31 ms 18260 KB Output is correct
16 Correct 30 ms 18200 KB Output is correct
17 Correct 30 ms 18232 KB Output is correct
18 Correct 31 ms 18260 KB Output is correct
19 Correct 37 ms 18204 KB Output is correct
20 Correct 31 ms 18220 KB Output is correct
21 Correct 30 ms 18260 KB Output is correct
22 Correct 36 ms 18248 KB Output is correct
23 Correct 30 ms 18260 KB Output is correct
24 Correct 30 ms 18140 KB Output is correct
25 Correct 29 ms 18268 KB Output is correct
26 Correct 38 ms 19368 KB Output is correct
27 Correct 39 ms 19196 KB Output is correct
28 Correct 36 ms 19032 KB Output is correct
29 Correct 35 ms 19108 KB Output is correct
30 Correct 36 ms 18808 KB Output is correct
31 Correct 37 ms 18948 KB Output is correct
32 Correct 41 ms 18960 KB Output is correct
33 Correct 37 ms 18900 KB Output is correct
34 Correct 30 ms 18208 KB Output is correct
35 Correct 30 ms 18160 KB Output is correct
36 Correct 32 ms 18184 KB Output is correct
37 Correct 36 ms 18900 KB Output is correct
38 Correct 30 ms 18264 KB Output is correct
39 Correct 37 ms 18148 KB Output is correct
40 Correct 40 ms 19068 KB Output is correct
41 Correct 29 ms 18176 KB Output is correct
42 Correct 39 ms 18220 KB Output is correct
43 Correct 31 ms 18220 KB Output is correct
44 Correct 30 ms 18168 KB Output is correct
45 Correct 33 ms 18644 KB Output is correct
46 Correct 30 ms 18168 KB Output is correct
47 Correct 37 ms 18916 KB Output is correct
48 Correct 38 ms 18152 KB Output is correct
49 Correct 33 ms 18280 KB Output is correct
50 Correct 40 ms 19480 KB Output is correct
51 Correct 41 ms 19856 KB Output is correct
52 Correct 39 ms 19144 KB Output is correct
53 Correct 51 ms 19280 KB Output is correct
54 Correct 39 ms 19116 KB Output is correct
55 Correct 41 ms 19548 KB Output is correct
56 Correct 40 ms 19296 KB Output is correct
57 Correct 42 ms 19912 KB Output is correct
58 Correct 29 ms 18208 KB Output is correct
59 Correct 29 ms 18276 KB Output is correct
60 Correct 38 ms 18732 KB Output is correct
61 Correct 38 ms 19024 KB Output is correct
62 Correct 43 ms 19112 KB Output is correct
63 Correct 37 ms 18860 KB Output is correct
64 Correct 30 ms 18256 KB Output is correct
65 Correct 43 ms 19676 KB Output is correct
66 Correct 37 ms 18188 KB Output is correct
67 Correct 38 ms 18376 KB Output is correct
68 Correct 30 ms 18184 KB Output is correct
69 Correct 37 ms 18920 KB Output is correct
70 Correct 39 ms 19288 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 30 ms 18356 KB Output is correct
2 Correct 37 ms 18172 KB Output is correct
3 Correct 37 ms 18176 KB Output is correct
4 Correct 33 ms 18248 KB Output is correct
5 Correct 30 ms 18236 KB Output is correct
6 Correct 31 ms 18200 KB Output is correct
7 Correct 29 ms 18220 KB Output is correct
8 Correct 29 ms 18212 KB Output is correct
9 Correct 30 ms 18220 KB Output is correct
10 Correct 30 ms 18180 KB Output is correct
11 Correct 30 ms 18208 KB Output is correct
12 Correct 29 ms 18216 KB Output is correct
13 Correct 31 ms 18252 KB Output is correct
14 Correct 30 ms 18248 KB Output is correct
15 Correct 31 ms 18260 KB Output is correct
16 Correct 30 ms 18200 KB Output is correct
17 Correct 30 ms 18232 KB Output is correct
18 Correct 31 ms 18260 KB Output is correct
19 Correct 37 ms 18204 KB Output is correct
20 Correct 31 ms 18220 KB Output is correct
21 Correct 30 ms 18260 KB Output is correct
22 Correct 36 ms 18248 KB Output is correct
23 Correct 30 ms 18260 KB Output is correct
24 Correct 30 ms 18140 KB Output is correct
25 Correct 29 ms 18268 KB Output is correct
26 Correct 38 ms 19368 KB Output is correct
27 Correct 39 ms 19196 KB Output is correct
28 Correct 36 ms 19032 KB Output is correct
29 Correct 35 ms 19108 KB Output is correct
30 Correct 36 ms 18808 KB Output is correct
31 Correct 37 ms 18948 KB Output is correct
32 Correct 41 ms 18960 KB Output is correct
33 Correct 37 ms 18900 KB Output is correct
34 Correct 30 ms 18208 KB Output is correct
35 Correct 30 ms 18160 KB Output is correct
36 Correct 32 ms 18184 KB Output is correct
37 Correct 36 ms 18900 KB Output is correct
38 Correct 30 ms 18264 KB Output is correct
39 Correct 37 ms 18148 KB Output is correct
40 Correct 40 ms 19068 KB Output is correct
41 Correct 29 ms 18176 KB Output is correct
42 Correct 39 ms 18220 KB Output is correct
43 Correct 31 ms 18220 KB Output is correct
44 Correct 30 ms 18168 KB Output is correct
45 Correct 33 ms 18644 KB Output is correct
46 Correct 30 ms 18168 KB Output is correct
47 Correct 37 ms 18916 KB Output is correct
48 Correct 38 ms 18152 KB Output is correct
49 Correct 33 ms 18280 KB Output is correct
50 Correct 40 ms 19480 KB Output is correct
51 Correct 41 ms 19856 KB Output is correct
52 Correct 39 ms 19144 KB Output is correct
53 Correct 51 ms 19280 KB Output is correct
54 Correct 39 ms 19116 KB Output is correct
55 Correct 41 ms 19548 KB Output is correct
56 Correct 40 ms 19296 KB Output is correct
57 Correct 42 ms 19912 KB Output is correct
58 Correct 29 ms 18208 KB Output is correct
59 Correct 29 ms 18276 KB Output is correct
60 Correct 38 ms 18732 KB Output is correct
61 Correct 38 ms 19024 KB Output is correct
62 Correct 43 ms 19112 KB Output is correct
63 Correct 37 ms 18860 KB Output is correct
64 Correct 30 ms 18256 KB Output is correct
65 Correct 43 ms 19676 KB Output is correct
66 Correct 37 ms 18188 KB Output is correct
67 Correct 38 ms 18376 KB Output is correct
68 Correct 30 ms 18184 KB Output is correct
69 Correct 37 ms 18920 KB Output is correct
70 Correct 39 ms 19288 KB Output is correct
71 Correct 199 ms 39372 KB Output is correct
72 Correct 144 ms 36008 KB Output is correct
73 Correct 207 ms 38424 KB Output is correct
74 Correct 131 ms 33192 KB Output is correct
75 Correct 152 ms 34348 KB Output is correct
76 Correct 277 ms 46520 KB Output is correct
77 Correct 264 ms 41600 KB Output is correct
78 Correct 252 ms 41756 KB Output is correct
79 Correct 250 ms 42404 KB Output is correct
80 Correct 32 ms 18640 KB Output is correct
81 Correct 33 ms 18720 KB Output is correct
82 Correct 39 ms 19492 KB Output is correct
83 Correct 61 ms 25072 KB Output is correct
84 Correct 72 ms 27376 KB Output is correct
85 Correct 47 ms 20948 KB Output is correct
86 Correct 39 ms 19172 KB Output is correct
87 Correct 77 ms 28176 KB Output is correct
88 Correct 33 ms 18728 KB Output is correct
89 Correct 33 ms 18712 KB Output is correct
90 Correct 37 ms 19112 KB Output is correct
91 Correct 51 ms 22052 KB Output is correct
92 Correct 86 ms 29000 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 30 ms 18356 KB Output is correct
2 Correct 37 ms 18172 KB Output is correct
3 Correct 37 ms 18176 KB Output is correct
4 Correct 33 ms 18248 KB Output is correct
5 Correct 30 ms 18236 KB Output is correct
6 Correct 31 ms 18200 KB Output is correct
7 Correct 29 ms 18220 KB Output is correct
8 Correct 29 ms 18212 KB Output is correct
9 Correct 30 ms 18220 KB Output is correct
10 Correct 30 ms 18180 KB Output is correct
11 Correct 30 ms 18208 KB Output is correct
12 Correct 29 ms 18216 KB Output is correct
13 Correct 31 ms 18252 KB Output is correct
14 Correct 30 ms 18248 KB Output is correct
15 Correct 31 ms 18260 KB Output is correct
16 Correct 30 ms 18200 KB Output is correct
17 Correct 30 ms 18232 KB Output is correct
18 Correct 31 ms 18260 KB Output is correct
19 Correct 37 ms 18204 KB Output is correct
20 Correct 31 ms 18220 KB Output is correct
21 Correct 30 ms 18260 KB Output is correct
22 Correct 36 ms 18248 KB Output is correct
23 Correct 30 ms 18260 KB Output is correct
24 Correct 30 ms 18140 KB Output is correct
25 Correct 29 ms 18268 KB Output is correct
26 Correct 38 ms 19368 KB Output is correct
27 Correct 39 ms 19196 KB Output is correct
28 Correct 36 ms 19032 KB Output is correct
29 Correct 35 ms 19108 KB Output is correct
30 Correct 36 ms 18808 KB Output is correct
31 Correct 37 ms 18948 KB Output is correct
32 Correct 41 ms 18960 KB Output is correct
33 Correct 37 ms 18900 KB Output is correct
34 Correct 30 ms 18208 KB Output is correct
35 Correct 30 ms 18160 KB Output is correct
36 Correct 32 ms 18184 KB Output is correct
37 Correct 36 ms 18900 KB Output is correct
38 Correct 30 ms 18264 KB Output is correct
39 Correct 37 ms 18148 KB Output is correct
40 Correct 40 ms 19068 KB Output is correct
41 Correct 29 ms 18176 KB Output is correct
42 Correct 39 ms 18220 KB Output is correct
43 Correct 31 ms 18220 KB Output is correct
44 Correct 30 ms 18168 KB Output is correct
45 Correct 33 ms 18644 KB Output is correct
46 Correct 30 ms 18168 KB Output is correct
47 Correct 37 ms 18916 KB Output is correct
48 Correct 38 ms 18152 KB Output is correct
49 Correct 33 ms 18280 KB Output is correct
50 Correct 40 ms 19480 KB Output is correct
51 Correct 41 ms 19856 KB Output is correct
52 Correct 39 ms 19144 KB Output is correct
53 Correct 51 ms 19280 KB Output is correct
54 Correct 39 ms 19116 KB Output is correct
55 Correct 41 ms 19548 KB Output is correct
56 Correct 40 ms 19296 KB Output is correct
57 Correct 42 ms 19912 KB Output is correct
58 Correct 29 ms 18208 KB Output is correct
59 Correct 29 ms 18276 KB Output is correct
60 Correct 38 ms 18732 KB Output is correct
61 Correct 38 ms 19024 KB Output is correct
62 Correct 43 ms 19112 KB Output is correct
63 Correct 37 ms 18860 KB Output is correct
64 Correct 30 ms 18256 KB Output is correct
65 Correct 43 ms 19676 KB Output is correct
66 Correct 37 ms 18188 KB Output is correct
67 Correct 38 ms 18376 KB Output is correct
68 Correct 30 ms 18184 KB Output is correct
69 Correct 37 ms 18920 KB Output is correct
70 Correct 39 ms 19288 KB Output is correct
71 Correct 199 ms 39372 KB Output is correct
72 Correct 144 ms 36008 KB Output is correct
73 Correct 207 ms 38424 KB Output is correct
74 Correct 131 ms 33192 KB Output is correct
75 Correct 152 ms 34348 KB Output is correct
76 Correct 277 ms 46520 KB Output is correct
77 Correct 264 ms 41600 KB Output is correct
78 Correct 252 ms 41756 KB Output is correct
79 Correct 250 ms 42404 KB Output is correct
80 Correct 32 ms 18640 KB Output is correct
81 Correct 33 ms 18720 KB Output is correct
82 Correct 39 ms 19492 KB Output is correct
83 Correct 61 ms 25072 KB Output is correct
84 Correct 72 ms 27376 KB Output is correct
85 Correct 47 ms 20948 KB Output is correct
86 Correct 39 ms 19172 KB Output is correct
87 Correct 77 ms 28176 KB Output is correct
88 Correct 33 ms 18728 KB Output is correct
89 Correct 33 ms 18712 KB Output is correct
90 Correct 37 ms 19112 KB Output is correct
91 Correct 51 ms 22052 KB Output is correct
92 Correct 86 ms 29000 KB Output is correct
93 Correct 1050 ms 98612 KB Output is correct
94 Correct 576 ms 71720 KB Output is correct
95 Correct 662 ms 76152 KB Output is correct
96 Correct 647 ms 68732 KB Output is correct
97 Correct 611 ms 65796 KB Output is correct
98 Correct 1256 ms 101160 KB Output is correct
99 Correct 1203 ms 104288 KB Output is correct
100 Correct 1178 ms 98856 KB Output is correct
101 Correct 1290 ms 101304 KB Output is correct
102 Correct 1067 ms 84788 KB Output is correct
103 Correct 782 ms 84824 KB Output is correct
104 Correct 41 ms 18728 KB Output is correct
105 Correct 38 ms 18668 KB Output is correct
106 Correct 41 ms 19568 KB Output is correct
107 Correct 113 ms 32028 KB Output is correct
108 Correct 204 ms 42012 KB Output is correct
109 Correct 59 ms 24616 KB Output is correct
110 Correct 33 ms 18728 KB Output is correct
111 Correct 139 ms 35240 KB Output is correct
112 Correct 34 ms 18672 KB Output is correct
113 Correct 33 ms 18724 KB Output is correct
114 Correct 46 ms 19940 KB Output is correct
115 Correct 35 ms 18644 KB Output is correct
116 Correct 47 ms 20824 KB Output is correct
117 Correct 247 ms 48556 KB Output is correct