답안 #493218

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
493218 2021-12-10T12:28:05 Z blue Toys (CEOI18_toy) C++17
39 / 100
5000 ms 46196 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++)
        {
            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());
    }

    cout << sz(res[n]) << '\n';
    for(int r: res[n]) cout << r << ' ';
    cout << '\n';
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 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 1 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 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 1 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 0 ms 204 KB Output is correct
25 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 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 1 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 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 1 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 0 ms 204 KB Output is correct
25 Correct 0 ms 204 KB Output is correct
26 Correct 171 ms 4432 KB Output is correct
27 Correct 78 ms 2692 KB Output is correct
28 Correct 21 ms 1208 KB Output is correct
29 Correct 11 ms 716 KB Output is correct
30 Correct 6 ms 588 KB Output is correct
31 Correct 216 ms 5292 KB Output is correct
32 Correct 152 ms 4144 KB Output is correct
33 Correct 132 ms 3832 KB Output is correct
34 Correct 297 ms 6296 KB Output is correct
35 Correct 272 ms 6152 KB Output is correct
36 Correct 193 ms 4852 KB Output is correct
37 Correct 180 ms 4636 KB Output is correct
38 Correct 279 ms 6284 KB Output is correct
39 Correct 280 ms 6212 KB Output is correct
40 Correct 235 ms 5432 KB Output is correct
41 Correct 279 ms 6212 KB Output is correct
42 Correct 279 ms 6204 KB Output is correct
43 Correct 236 ms 5492 KB Output is correct
44 Correct 280 ms 6304 KB Output is correct
45 Correct 297 ms 6416 KB Output is correct
46 Correct 282 ms 6228 KB Output is correct
47 Correct 284 ms 6256 KB Output is correct
48 Correct 284 ms 6312 KB Output is correct
49 Correct 277 ms 6224 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 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 1 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 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 1 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 0 ms 204 KB Output is correct
25 Correct 0 ms 204 KB Output is correct
26 Correct 171 ms 4432 KB Output is correct
27 Correct 78 ms 2692 KB Output is correct
28 Correct 21 ms 1208 KB Output is correct
29 Correct 11 ms 716 KB Output is correct
30 Correct 6 ms 588 KB Output is correct
31 Correct 216 ms 5292 KB Output is correct
32 Correct 152 ms 4144 KB Output is correct
33 Correct 132 ms 3832 KB Output is correct
34 Correct 297 ms 6296 KB Output is correct
35 Correct 272 ms 6152 KB Output is correct
36 Correct 193 ms 4852 KB Output is correct
37 Correct 180 ms 4636 KB Output is correct
38 Correct 279 ms 6284 KB Output is correct
39 Correct 280 ms 6212 KB Output is correct
40 Correct 235 ms 5432 KB Output is correct
41 Correct 279 ms 6212 KB Output is correct
42 Correct 279 ms 6204 KB Output is correct
43 Correct 236 ms 5492 KB Output is correct
44 Correct 280 ms 6304 KB Output is correct
45 Correct 297 ms 6416 KB Output is correct
46 Correct 282 ms 6228 KB Output is correct
47 Correct 284 ms 6256 KB Output is correct
48 Correct 284 ms 6312 KB Output is correct
49 Correct 277 ms 6224 KB Output is correct
50 Execution timed out 5079 ms 46196 KB Time limit exceeded
51 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 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 1 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 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 1 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 0 ms 204 KB Output is correct
25 Correct 0 ms 204 KB Output is correct
26 Correct 171 ms 4432 KB Output is correct
27 Correct 78 ms 2692 KB Output is correct
28 Correct 21 ms 1208 KB Output is correct
29 Correct 11 ms 716 KB Output is correct
30 Correct 6 ms 588 KB Output is correct
31 Correct 216 ms 5292 KB Output is correct
32 Correct 152 ms 4144 KB Output is correct
33 Correct 132 ms 3832 KB Output is correct
34 Correct 297 ms 6296 KB Output is correct
35 Correct 272 ms 6152 KB Output is correct
36 Correct 193 ms 4852 KB Output is correct
37 Correct 180 ms 4636 KB Output is correct
38 Correct 279 ms 6284 KB Output is correct
39 Correct 280 ms 6212 KB Output is correct
40 Correct 235 ms 5432 KB Output is correct
41 Correct 279 ms 6212 KB Output is correct
42 Correct 279 ms 6204 KB Output is correct
43 Correct 236 ms 5492 KB Output is correct
44 Correct 280 ms 6304 KB Output is correct
45 Correct 297 ms 6416 KB Output is correct
46 Correct 282 ms 6228 KB Output is correct
47 Correct 284 ms 6256 KB Output is correct
48 Correct 284 ms 6312 KB Output is correct
49 Correct 277 ms 6224 KB Output is correct
50 Execution timed out 5079 ms 46196 KB Time limit exceeded
51 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 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 1 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 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 1 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 0 ms 204 KB Output is correct
25 Correct 0 ms 204 KB Output is correct
26 Correct 171 ms 4432 KB Output is correct
27 Correct 78 ms 2692 KB Output is correct
28 Correct 21 ms 1208 KB Output is correct
29 Correct 11 ms 716 KB Output is correct
30 Correct 6 ms 588 KB Output is correct
31 Correct 216 ms 5292 KB Output is correct
32 Correct 152 ms 4144 KB Output is correct
33 Correct 132 ms 3832 KB Output is correct
34 Correct 297 ms 6296 KB Output is correct
35 Correct 272 ms 6152 KB Output is correct
36 Correct 193 ms 4852 KB Output is correct
37 Correct 180 ms 4636 KB Output is correct
38 Correct 279 ms 6284 KB Output is correct
39 Correct 280 ms 6212 KB Output is correct
40 Correct 235 ms 5432 KB Output is correct
41 Correct 279 ms 6212 KB Output is correct
42 Correct 279 ms 6204 KB Output is correct
43 Correct 236 ms 5492 KB Output is correct
44 Correct 280 ms 6304 KB Output is correct
45 Correct 297 ms 6416 KB Output is correct
46 Correct 282 ms 6228 KB Output is correct
47 Correct 284 ms 6256 KB Output is correct
48 Correct 284 ms 6312 KB Output is correct
49 Correct 277 ms 6224 KB Output is correct
50 Execution timed out 5079 ms 46196 KB Time limit exceeded
51 Halted 0 ms 0 KB -