답안 #975334

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
975334 2024-05-04T19:43:42 Z IBory Toys (CEOI18_toy) C++17
100 / 100
675 ms 86372 KB
#include <bits/stdc++.h>
#include <unordered_set>
using namespace std;

const int MAX = 111111;
vector<int> D;
unordered_set<int> S[MAX];

int main() {
	int N;
	cin >> N;

	for (int i = 1; i * i <= N; ++i) {
		if (N % i) continue;
		D.push_back(i);
		if (i * i != N) D.push_back(N / i);
	}
	sort(D.begin(), D.end());
	S[0].insert(0);

	for (int i = 0; i < D.size(); ++i) {
		for (int j = 0; j < i; ++j) {
			if (D[i] % D[j]) continue;
			for (int n : S[j]) S[i].insert(n + D[i] / D[j] - 1);
		}
	}

	vector<int> ans;
	for (int n : S[D.size() - 1]) ans.push_back(n);
	sort(ans.begin(), ans.end());
	cout << ans.size() << '\n';
	for (int n : ans) cout << n << ' ';
	return 0;
}

Compilation message

toy.cpp: In function 'int main()':
toy.cpp:21:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |  for (int i = 0; i < D.size(); ++i) {
      |                  ~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 6492 KB Output is correct
2 Correct 2 ms 6500 KB Output is correct
3 Correct 5 ms 6492 KB Output is correct
4 Correct 2 ms 6492 KB Output is correct
5 Correct 2 ms 6492 KB Output is correct
6 Correct 2 ms 6492 KB Output is correct
7 Correct 2 ms 6496 KB Output is correct
8 Correct 3 ms 6492 KB Output is correct
9 Correct 2 ms 6492 KB Output is correct
10 Correct 2 ms 6492 KB Output is correct
11 Correct 2 ms 6492 KB Output is correct
12 Correct 2 ms 6492 KB Output is correct
13 Correct 2 ms 6492 KB Output is correct
14 Correct 2 ms 6488 KB Output is correct
15 Correct 2 ms 6492 KB Output is correct
16 Correct 2 ms 6492 KB Output is correct
17 Correct 2 ms 6492 KB Output is correct
18 Correct 2 ms 6492 KB Output is correct
19 Correct 2 ms 6492 KB Output is correct
20 Correct 2 ms 6492 KB Output is correct
21 Correct 2 ms 6496 KB Output is correct
22 Correct 2 ms 6492 KB Output is correct
23 Correct 2 ms 6492 KB Output is correct
24 Correct 2 ms 6492 KB Output is correct
25 Correct 2 ms 6492 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 6492 KB Output is correct
2 Correct 2 ms 6500 KB Output is correct
3 Correct 5 ms 6492 KB Output is correct
4 Correct 2 ms 6492 KB Output is correct
5 Correct 2 ms 6492 KB Output is correct
6 Correct 2 ms 6492 KB Output is correct
7 Correct 2 ms 6496 KB Output is correct
8 Correct 3 ms 6492 KB Output is correct
9 Correct 2 ms 6492 KB Output is correct
10 Correct 2 ms 6492 KB Output is correct
11 Correct 2 ms 6492 KB Output is correct
12 Correct 2 ms 6492 KB Output is correct
13 Correct 2 ms 6492 KB Output is correct
14 Correct 2 ms 6488 KB Output is correct
15 Correct 2 ms 6492 KB Output is correct
16 Correct 2 ms 6492 KB Output is correct
17 Correct 2 ms 6492 KB Output is correct
18 Correct 2 ms 6492 KB Output is correct
19 Correct 2 ms 6492 KB Output is correct
20 Correct 2 ms 6492 KB Output is correct
21 Correct 2 ms 6496 KB Output is correct
22 Correct 2 ms 6492 KB Output is correct
23 Correct 2 ms 6492 KB Output is correct
24 Correct 2 ms 6492 KB Output is correct
25 Correct 2 ms 6492 KB Output is correct
26 Correct 2 ms 6492 KB Output is correct
27 Correct 2 ms 6492 KB Output is correct
28 Correct 2 ms 6492 KB Output is correct
29 Correct 2 ms 6532 KB Output is correct
30 Correct 2 ms 6492 KB Output is correct
31 Correct 2 ms 6492 KB Output is correct
32 Correct 4 ms 6492 KB Output is correct
33 Correct 2 ms 6488 KB Output is correct
34 Correct 3 ms 6488 KB Output is correct
35 Correct 2 ms 6492 KB Output is correct
36 Correct 2 ms 6744 KB Output is correct
37 Correct 2 ms 6492 KB Output is correct
38 Correct 3 ms 6492 KB Output is correct
39 Correct 2 ms 6492 KB Output is correct
40 Correct 2 ms 6492 KB Output is correct
41 Correct 2 ms 6488 KB Output is correct
42 Correct 3 ms 6492 KB Output is correct
43 Correct 3 ms 6492 KB Output is correct
44 Correct 2 ms 6488 KB Output is correct
45 Correct 2 ms 6488 KB Output is correct
46 Correct 2 ms 6744 KB Output is correct
47 Correct 2 ms 6492 KB Output is correct
48 Correct 2 ms 6492 KB Output is correct
49 Correct 2 ms 6492 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 6492 KB Output is correct
2 Correct 2 ms 6500 KB Output is correct
3 Correct 5 ms 6492 KB Output is correct
4 Correct 2 ms 6492 KB Output is correct
5 Correct 2 ms 6492 KB Output is correct
6 Correct 2 ms 6492 KB Output is correct
7 Correct 2 ms 6496 KB Output is correct
8 Correct 3 ms 6492 KB Output is correct
9 Correct 2 ms 6492 KB Output is correct
10 Correct 2 ms 6492 KB Output is correct
11 Correct 2 ms 6492 KB Output is correct
12 Correct 2 ms 6492 KB Output is correct
13 Correct 2 ms 6492 KB Output is correct
14 Correct 2 ms 6488 KB Output is correct
15 Correct 2 ms 6492 KB Output is correct
16 Correct 2 ms 6492 KB Output is correct
17 Correct 2 ms 6492 KB Output is correct
18 Correct 2 ms 6492 KB Output is correct
19 Correct 2 ms 6492 KB Output is correct
20 Correct 2 ms 6492 KB Output is correct
21 Correct 2 ms 6496 KB Output is correct
22 Correct 2 ms 6492 KB Output is correct
23 Correct 2 ms 6492 KB Output is correct
24 Correct 2 ms 6492 KB Output is correct
25 Correct 2 ms 6492 KB Output is correct
26 Correct 2 ms 6492 KB Output is correct
27 Correct 2 ms 6492 KB Output is correct
28 Correct 2 ms 6492 KB Output is correct
29 Correct 2 ms 6532 KB Output is correct
30 Correct 2 ms 6492 KB Output is correct
31 Correct 2 ms 6492 KB Output is correct
32 Correct 4 ms 6492 KB Output is correct
33 Correct 2 ms 6488 KB Output is correct
34 Correct 3 ms 6488 KB Output is correct
35 Correct 2 ms 6492 KB Output is correct
36 Correct 2 ms 6744 KB Output is correct
37 Correct 2 ms 6492 KB Output is correct
38 Correct 3 ms 6492 KB Output is correct
39 Correct 2 ms 6492 KB Output is correct
40 Correct 2 ms 6492 KB Output is correct
41 Correct 2 ms 6488 KB Output is correct
42 Correct 3 ms 6492 KB Output is correct
43 Correct 3 ms 6492 KB Output is correct
44 Correct 2 ms 6488 KB Output is correct
45 Correct 2 ms 6488 KB Output is correct
46 Correct 2 ms 6744 KB Output is correct
47 Correct 2 ms 6492 KB Output is correct
48 Correct 2 ms 6492 KB Output is correct
49 Correct 2 ms 6492 KB Output is correct
50 Correct 3 ms 6748 KB Output is correct
51 Correct 3 ms 6748 KB Output is correct
52 Correct 3 ms 6748 KB Output is correct
53 Correct 3 ms 6492 KB Output is correct
54 Correct 3 ms 6492 KB Output is correct
55 Correct 3 ms 6748 KB Output is correct
56 Correct 3 ms 6748 KB Output is correct
57 Correct 3 ms 6748 KB Output is correct
58 Correct 2 ms 6492 KB Output is correct
59 Correct 2 ms 6492 KB Output is correct
60 Correct 2 ms 6492 KB Output is correct
61 Correct 3 ms 6492 KB Output is correct
62 Correct 2 ms 6492 KB Output is correct
63 Correct 2 ms 6492 KB Output is correct
64 Correct 2 ms 6492 KB Output is correct
65 Correct 3 ms 6492 KB Output is correct
66 Correct 2 ms 6492 KB Output is correct
67 Correct 2 ms 6492 KB Output is correct
68 Correct 2 ms 6492 KB Output is correct
69 Correct 2 ms 6492 KB Output is correct
70 Correct 2 ms 6492 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 6492 KB Output is correct
2 Correct 2 ms 6500 KB Output is correct
3 Correct 5 ms 6492 KB Output is correct
4 Correct 2 ms 6492 KB Output is correct
5 Correct 2 ms 6492 KB Output is correct
6 Correct 2 ms 6492 KB Output is correct
7 Correct 2 ms 6496 KB Output is correct
8 Correct 3 ms 6492 KB Output is correct
9 Correct 2 ms 6492 KB Output is correct
10 Correct 2 ms 6492 KB Output is correct
11 Correct 2 ms 6492 KB Output is correct
12 Correct 2 ms 6492 KB Output is correct
13 Correct 2 ms 6492 KB Output is correct
14 Correct 2 ms 6488 KB Output is correct
15 Correct 2 ms 6492 KB Output is correct
16 Correct 2 ms 6492 KB Output is correct
17 Correct 2 ms 6492 KB Output is correct
18 Correct 2 ms 6492 KB Output is correct
19 Correct 2 ms 6492 KB Output is correct
20 Correct 2 ms 6492 KB Output is correct
21 Correct 2 ms 6496 KB Output is correct
22 Correct 2 ms 6492 KB Output is correct
23 Correct 2 ms 6492 KB Output is correct
24 Correct 2 ms 6492 KB Output is correct
25 Correct 2 ms 6492 KB Output is correct
26 Correct 2 ms 6492 KB Output is correct
27 Correct 2 ms 6492 KB Output is correct
28 Correct 2 ms 6492 KB Output is correct
29 Correct 2 ms 6532 KB Output is correct
30 Correct 2 ms 6492 KB Output is correct
31 Correct 2 ms 6492 KB Output is correct
32 Correct 4 ms 6492 KB Output is correct
33 Correct 2 ms 6488 KB Output is correct
34 Correct 3 ms 6488 KB Output is correct
35 Correct 2 ms 6492 KB Output is correct
36 Correct 2 ms 6744 KB Output is correct
37 Correct 2 ms 6492 KB Output is correct
38 Correct 3 ms 6492 KB Output is correct
39 Correct 2 ms 6492 KB Output is correct
40 Correct 2 ms 6492 KB Output is correct
41 Correct 2 ms 6488 KB Output is correct
42 Correct 3 ms 6492 KB Output is correct
43 Correct 3 ms 6492 KB Output is correct
44 Correct 2 ms 6488 KB Output is correct
45 Correct 2 ms 6488 KB Output is correct
46 Correct 2 ms 6744 KB Output is correct
47 Correct 2 ms 6492 KB Output is correct
48 Correct 2 ms 6492 KB Output is correct
49 Correct 2 ms 6492 KB Output is correct
50 Correct 3 ms 6748 KB Output is correct
51 Correct 3 ms 6748 KB Output is correct
52 Correct 3 ms 6748 KB Output is correct
53 Correct 3 ms 6492 KB Output is correct
54 Correct 3 ms 6492 KB Output is correct
55 Correct 3 ms 6748 KB Output is correct
56 Correct 3 ms 6748 KB Output is correct
57 Correct 3 ms 6748 KB Output is correct
58 Correct 2 ms 6492 KB Output is correct
59 Correct 2 ms 6492 KB Output is correct
60 Correct 2 ms 6492 KB Output is correct
61 Correct 3 ms 6492 KB Output is correct
62 Correct 2 ms 6492 KB Output is correct
63 Correct 2 ms 6492 KB Output is correct
64 Correct 2 ms 6492 KB Output is correct
65 Correct 3 ms 6492 KB Output is correct
66 Correct 2 ms 6492 KB Output is correct
67 Correct 2 ms 6492 KB Output is correct
68 Correct 2 ms 6492 KB Output is correct
69 Correct 2 ms 6492 KB Output is correct
70 Correct 2 ms 6492 KB Output is correct
71 Correct 82 ms 23288 KB Output is correct
72 Correct 61 ms 19024 KB Output is correct
73 Correct 73 ms 21332 KB Output is correct
74 Correct 48 ms 16432 KB Output is correct
75 Correct 49 ms 16976 KB Output is correct
76 Correct 129 ms 29012 KB Output is correct
77 Correct 109 ms 26792 KB Output is correct
78 Correct 96 ms 25152 KB Output is correct
79 Correct 95 ms 24748 KB Output is correct
80 Correct 2 ms 6492 KB Output is correct
81 Correct 3 ms 6492 KB Output is correct
82 Correct 3 ms 6748 KB Output is correct
83 Correct 14 ms 9568 KB Output is correct
84 Correct 17 ms 10268 KB Output is correct
85 Correct 6 ms 7516 KB Output is correct
86 Correct 3 ms 6492 KB Output is correct
87 Correct 19 ms 10672 KB Output is correct
88 Correct 3 ms 6492 KB Output is correct
89 Correct 2 ms 6492 KB Output is correct
90 Correct 2 ms 6492 KB Output is correct
91 Correct 8 ms 8264 KB Output is correct
92 Correct 26 ms 12096 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 6492 KB Output is correct
2 Correct 2 ms 6500 KB Output is correct
3 Correct 5 ms 6492 KB Output is correct
4 Correct 2 ms 6492 KB Output is correct
5 Correct 2 ms 6492 KB Output is correct
6 Correct 2 ms 6492 KB Output is correct
7 Correct 2 ms 6496 KB Output is correct
8 Correct 3 ms 6492 KB Output is correct
9 Correct 2 ms 6492 KB Output is correct
10 Correct 2 ms 6492 KB Output is correct
11 Correct 2 ms 6492 KB Output is correct
12 Correct 2 ms 6492 KB Output is correct
13 Correct 2 ms 6492 KB Output is correct
14 Correct 2 ms 6488 KB Output is correct
15 Correct 2 ms 6492 KB Output is correct
16 Correct 2 ms 6492 KB Output is correct
17 Correct 2 ms 6492 KB Output is correct
18 Correct 2 ms 6492 KB Output is correct
19 Correct 2 ms 6492 KB Output is correct
20 Correct 2 ms 6492 KB Output is correct
21 Correct 2 ms 6496 KB Output is correct
22 Correct 2 ms 6492 KB Output is correct
23 Correct 2 ms 6492 KB Output is correct
24 Correct 2 ms 6492 KB Output is correct
25 Correct 2 ms 6492 KB Output is correct
26 Correct 2 ms 6492 KB Output is correct
27 Correct 2 ms 6492 KB Output is correct
28 Correct 2 ms 6492 KB Output is correct
29 Correct 2 ms 6532 KB Output is correct
30 Correct 2 ms 6492 KB Output is correct
31 Correct 2 ms 6492 KB Output is correct
32 Correct 4 ms 6492 KB Output is correct
33 Correct 2 ms 6488 KB Output is correct
34 Correct 3 ms 6488 KB Output is correct
35 Correct 2 ms 6492 KB Output is correct
36 Correct 2 ms 6744 KB Output is correct
37 Correct 2 ms 6492 KB Output is correct
38 Correct 3 ms 6492 KB Output is correct
39 Correct 2 ms 6492 KB Output is correct
40 Correct 2 ms 6492 KB Output is correct
41 Correct 2 ms 6488 KB Output is correct
42 Correct 3 ms 6492 KB Output is correct
43 Correct 3 ms 6492 KB Output is correct
44 Correct 2 ms 6488 KB Output is correct
45 Correct 2 ms 6488 KB Output is correct
46 Correct 2 ms 6744 KB Output is correct
47 Correct 2 ms 6492 KB Output is correct
48 Correct 2 ms 6492 KB Output is correct
49 Correct 2 ms 6492 KB Output is correct
50 Correct 3 ms 6748 KB Output is correct
51 Correct 3 ms 6748 KB Output is correct
52 Correct 3 ms 6748 KB Output is correct
53 Correct 3 ms 6492 KB Output is correct
54 Correct 3 ms 6492 KB Output is correct
55 Correct 3 ms 6748 KB Output is correct
56 Correct 3 ms 6748 KB Output is correct
57 Correct 3 ms 6748 KB Output is correct
58 Correct 2 ms 6492 KB Output is correct
59 Correct 2 ms 6492 KB Output is correct
60 Correct 2 ms 6492 KB Output is correct
61 Correct 3 ms 6492 KB Output is correct
62 Correct 2 ms 6492 KB Output is correct
63 Correct 2 ms 6492 KB Output is correct
64 Correct 2 ms 6492 KB Output is correct
65 Correct 3 ms 6492 KB Output is correct
66 Correct 2 ms 6492 KB Output is correct
67 Correct 2 ms 6492 KB Output is correct
68 Correct 2 ms 6492 KB Output is correct
69 Correct 2 ms 6492 KB Output is correct
70 Correct 2 ms 6492 KB Output is correct
71 Correct 82 ms 23288 KB Output is correct
72 Correct 61 ms 19024 KB Output is correct
73 Correct 73 ms 21332 KB Output is correct
74 Correct 48 ms 16432 KB Output is correct
75 Correct 49 ms 16976 KB Output is correct
76 Correct 129 ms 29012 KB Output is correct
77 Correct 109 ms 26792 KB Output is correct
78 Correct 96 ms 25152 KB Output is correct
79 Correct 95 ms 24748 KB Output is correct
80 Correct 2 ms 6492 KB Output is correct
81 Correct 3 ms 6492 KB Output is correct
82 Correct 3 ms 6748 KB Output is correct
83 Correct 14 ms 9568 KB Output is correct
84 Correct 17 ms 10268 KB Output is correct
85 Correct 6 ms 7516 KB Output is correct
86 Correct 3 ms 6492 KB Output is correct
87 Correct 19 ms 10672 KB Output is correct
88 Correct 3 ms 6492 KB Output is correct
89 Correct 2 ms 6492 KB Output is correct
90 Correct 2 ms 6492 KB Output is correct
91 Correct 8 ms 8264 KB Output is correct
92 Correct 26 ms 12096 KB Output is correct
93 Correct 547 ms 77136 KB Output is correct
94 Correct 326 ms 53800 KB Output is correct
95 Correct 333 ms 56168 KB Output is correct
96 Correct 325 ms 51080 KB Output is correct
97 Correct 258 ms 47368 KB Output is correct
98 Correct 622 ms 84872 KB Output is correct
99 Correct 675 ms 86372 KB Output is correct
100 Correct 598 ms 83292 KB Output is correct
101 Correct 566 ms 77408 KB Output is correct
102 Correct 505 ms 70028 KB Output is correct
103 Correct 428 ms 63540 KB Output is correct
104 Correct 2 ms 6492 KB Output is correct
105 Correct 3 ms 6492 KB Output is correct
106 Correct 4 ms 7004 KB Output is correct
107 Correct 40 ms 14944 KB Output is correct
108 Correct 95 ms 24752 KB Output is correct
109 Correct 12 ms 8996 KB Output is correct
110 Correct 2 ms 6492 KB Output is correct
111 Correct 54 ms 17296 KB Output is correct
112 Correct 3 ms 6492 KB Output is correct
113 Correct 2 ms 6492 KB Output is correct
114 Correct 5 ms 7004 KB Output is correct
115 Correct 2 ms 6488 KB Output is correct
116 Correct 7 ms 7768 KB Output is correct
117 Correct 111 ms 28876 KB Output is correct