답안 #493216

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
493216 2021-12-10T12:24:50 Z blue Toys (CEOI18_toy) C++17
39 / 100
5000 ms 38980 KB
#include <iostream>
#include <vector>
#include <set>
using namespace std;

#define sz(x) (int(x.size()))

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

    set<int> res[1+n];
    res[1].insert(0);
    for(int i = 1; i <= n; i++)
    {
        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].insert(a+b);
                // break;
            }
        }
        // cerr << i << " : " << flag << '\n';
        res[i].insert(i-1);
        // cerr << i << ' ' << sz(res[i]) << '\n';
        // if(i == n) cerr << "!!! " << sz(res[n]) << '\n';

        // cerr << "i = " << i << ": ";
        // for(int r: res[i]) cerr << r << ' ';
        // cerr << '\n';
    }

    cout << sz(res[n]) << '\n';
    for(int r: res[n]) cout << r << ' ';
    cout << '\n';
}
# 결과 실행 시간 메모리 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 1 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 236 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 1 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 288 KB Output is correct
23 Correct 1 ms 292 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 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 1 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 236 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 1 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 288 KB Output is correct
23 Correct 1 ms 292 KB Output is correct
24 Correct 0 ms 204 KB Output is correct
25 Correct 0 ms 204 KB Output is correct
26 Correct 180 ms 4580 KB Output is correct
27 Correct 86 ms 2860 KB Output is correct
28 Correct 23 ms 1356 KB Output is correct
29 Correct 12 ms 972 KB Output is correct
30 Correct 7 ms 704 KB Output is correct
31 Correct 228 ms 5316 KB Output is correct
32 Correct 164 ms 4464 KB Output is correct
33 Correct 145 ms 3976 KB Output is correct
34 Correct 309 ms 6492 KB Output is correct
35 Correct 297 ms 6324 KB Output is correct
36 Correct 210 ms 5012 KB Output is correct
37 Correct 193 ms 4804 KB Output is correct
38 Correct 306 ms 6560 KB Output is correct
39 Correct 306 ms 6428 KB Output is correct
40 Correct 251 ms 5744 KB Output is correct
41 Correct 299 ms 6384 KB Output is correct
42 Correct 289 ms 6340 KB Output is correct
43 Correct 254 ms 5704 KB Output is correct
44 Correct 300 ms 6332 KB Output is correct
45 Correct 301 ms 6536 KB Output is correct
46 Correct 304 ms 6412 KB Output is correct
47 Correct 312 ms 6340 KB Output is correct
48 Correct 314 ms 6512 KB Output is correct
49 Correct 299 ms 6340 KB Output is correct
# 결과 실행 시간 메모리 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 1 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 236 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 1 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 288 KB Output is correct
23 Correct 1 ms 292 KB Output is correct
24 Correct 0 ms 204 KB Output is correct
25 Correct 0 ms 204 KB Output is correct
26 Correct 180 ms 4580 KB Output is correct
27 Correct 86 ms 2860 KB Output is correct
28 Correct 23 ms 1356 KB Output is correct
29 Correct 12 ms 972 KB Output is correct
30 Correct 7 ms 704 KB Output is correct
31 Correct 228 ms 5316 KB Output is correct
32 Correct 164 ms 4464 KB Output is correct
33 Correct 145 ms 3976 KB Output is correct
34 Correct 309 ms 6492 KB Output is correct
35 Correct 297 ms 6324 KB Output is correct
36 Correct 210 ms 5012 KB Output is correct
37 Correct 193 ms 4804 KB Output is correct
38 Correct 306 ms 6560 KB Output is correct
39 Correct 306 ms 6428 KB Output is correct
40 Correct 251 ms 5744 KB Output is correct
41 Correct 299 ms 6384 KB Output is correct
42 Correct 289 ms 6340 KB Output is correct
43 Correct 254 ms 5704 KB Output is correct
44 Correct 300 ms 6332 KB Output is correct
45 Correct 301 ms 6536 KB Output is correct
46 Correct 304 ms 6412 KB Output is correct
47 Correct 312 ms 6340 KB Output is correct
48 Correct 314 ms 6512 KB Output is correct
49 Correct 299 ms 6340 KB Output is correct
50 Execution timed out 5047 ms 38980 KB Time limit exceeded
51 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 1 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 236 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 1 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 288 KB Output is correct
23 Correct 1 ms 292 KB Output is correct
24 Correct 0 ms 204 KB Output is correct
25 Correct 0 ms 204 KB Output is correct
26 Correct 180 ms 4580 KB Output is correct
27 Correct 86 ms 2860 KB Output is correct
28 Correct 23 ms 1356 KB Output is correct
29 Correct 12 ms 972 KB Output is correct
30 Correct 7 ms 704 KB Output is correct
31 Correct 228 ms 5316 KB Output is correct
32 Correct 164 ms 4464 KB Output is correct
33 Correct 145 ms 3976 KB Output is correct
34 Correct 309 ms 6492 KB Output is correct
35 Correct 297 ms 6324 KB Output is correct
36 Correct 210 ms 5012 KB Output is correct
37 Correct 193 ms 4804 KB Output is correct
38 Correct 306 ms 6560 KB Output is correct
39 Correct 306 ms 6428 KB Output is correct
40 Correct 251 ms 5744 KB Output is correct
41 Correct 299 ms 6384 KB Output is correct
42 Correct 289 ms 6340 KB Output is correct
43 Correct 254 ms 5704 KB Output is correct
44 Correct 300 ms 6332 KB Output is correct
45 Correct 301 ms 6536 KB Output is correct
46 Correct 304 ms 6412 KB Output is correct
47 Correct 312 ms 6340 KB Output is correct
48 Correct 314 ms 6512 KB Output is correct
49 Correct 299 ms 6340 KB Output is correct
50 Execution timed out 5047 ms 38980 KB Time limit exceeded
51 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 1 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 236 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 1 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 288 KB Output is correct
23 Correct 1 ms 292 KB Output is correct
24 Correct 0 ms 204 KB Output is correct
25 Correct 0 ms 204 KB Output is correct
26 Correct 180 ms 4580 KB Output is correct
27 Correct 86 ms 2860 KB Output is correct
28 Correct 23 ms 1356 KB Output is correct
29 Correct 12 ms 972 KB Output is correct
30 Correct 7 ms 704 KB Output is correct
31 Correct 228 ms 5316 KB Output is correct
32 Correct 164 ms 4464 KB Output is correct
33 Correct 145 ms 3976 KB Output is correct
34 Correct 309 ms 6492 KB Output is correct
35 Correct 297 ms 6324 KB Output is correct
36 Correct 210 ms 5012 KB Output is correct
37 Correct 193 ms 4804 KB Output is correct
38 Correct 306 ms 6560 KB Output is correct
39 Correct 306 ms 6428 KB Output is correct
40 Correct 251 ms 5744 KB Output is correct
41 Correct 299 ms 6384 KB Output is correct
42 Correct 289 ms 6340 KB Output is correct
43 Correct 254 ms 5704 KB Output is correct
44 Correct 300 ms 6332 KB Output is correct
45 Correct 301 ms 6536 KB Output is correct
46 Correct 304 ms 6412 KB Output is correct
47 Correct 312 ms 6340 KB Output is correct
48 Correct 314 ms 6512 KB Output is correct
49 Correct 299 ms 6340 KB Output is correct
50 Execution timed out 5047 ms 38980 KB Time limit exceeded
51 Halted 0 ms 0 KB -