답안 #748920

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
748920 2023-05-27T06:59:03 Z bgnbvnbv Toys (CEOI18_toy) C++14
100 / 100
745 ms 9232 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll, ll>
#define fi first
#define se second
#define pb push_back

const int N = 1e5+5;
const long long mod = 1e9+7;
const long double pi = acos(-1);
const int base = 300;
ll k, t;
ll a[N], ans, m, n, b[N], tong, d[N], c[N], lab[N], cnt, h[N], P[N][20];
vector<pll> val[N];
vector<ll> adj[N], res;

string s;
set<ll> st;
void cal(ll n, ll lst, ll sum)
{
    st.insert(sum+n-1);
    for(int i = lst; i <= n / i; i ++)
    {
        if(n % i == 0)
        {
            cal(n/i, i, sum+i-1);
        }
    }
}
void sol()
{
    cin >> n;
    cal(n, 2, 0);
    cout << st.size() << '\n';
    for(ll x : st)cout << x <<" ";
}
int main()
{
    sol();
}

# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 4948 KB Output is correct
2 Correct 3 ms 4948 KB Output is correct
3 Correct 3 ms 4948 KB Output is correct
4 Correct 3 ms 5008 KB Output is correct
5 Correct 4 ms 4948 KB Output is correct
6 Correct 3 ms 4948 KB Output is correct
7 Correct 3 ms 5016 KB Output is correct
8 Correct 3 ms 4948 KB Output is correct
9 Correct 3 ms 4948 KB Output is correct
10 Correct 3 ms 5016 KB Output is correct
11 Correct 3 ms 4948 KB Output is correct
12 Correct 4 ms 5012 KB Output is correct
13 Correct 3 ms 5008 KB Output is correct
14 Correct 3 ms 4948 KB Output is correct
15 Correct 2 ms 4948 KB Output is correct
16 Correct 3 ms 4948 KB Output is correct
17 Correct 2 ms 4948 KB Output is correct
18 Correct 3 ms 4948 KB Output is correct
19 Correct 3 ms 4908 KB Output is correct
20 Correct 4 ms 5000 KB Output is correct
21 Correct 3 ms 4948 KB Output is correct
22 Correct 3 ms 4948 KB Output is correct
23 Correct 3 ms 5012 KB Output is correct
24 Correct 3 ms 4948 KB Output is correct
25 Correct 2 ms 4948 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 4948 KB Output is correct
2 Correct 3 ms 4948 KB Output is correct
3 Correct 3 ms 4948 KB Output is correct
4 Correct 3 ms 5008 KB Output is correct
5 Correct 4 ms 4948 KB Output is correct
6 Correct 3 ms 4948 KB Output is correct
7 Correct 3 ms 5016 KB Output is correct
8 Correct 3 ms 4948 KB Output is correct
9 Correct 3 ms 4948 KB Output is correct
10 Correct 3 ms 5016 KB Output is correct
11 Correct 3 ms 4948 KB Output is correct
12 Correct 4 ms 5012 KB Output is correct
13 Correct 3 ms 5008 KB Output is correct
14 Correct 3 ms 4948 KB Output is correct
15 Correct 2 ms 4948 KB Output is correct
16 Correct 3 ms 4948 KB Output is correct
17 Correct 2 ms 4948 KB Output is correct
18 Correct 3 ms 4948 KB Output is correct
19 Correct 3 ms 4908 KB Output is correct
20 Correct 4 ms 5000 KB Output is correct
21 Correct 3 ms 4948 KB Output is correct
22 Correct 3 ms 4948 KB Output is correct
23 Correct 3 ms 5012 KB Output is correct
24 Correct 3 ms 4948 KB Output is correct
25 Correct 2 ms 4948 KB Output is correct
26 Correct 3 ms 5012 KB Output is correct
27 Correct 3 ms 4948 KB Output is correct
28 Correct 3 ms 5016 KB Output is correct
29 Correct 3 ms 4948 KB Output is correct
30 Correct 3 ms 4948 KB Output is correct
31 Correct 3 ms 5008 KB Output is correct
32 Correct 4 ms 5016 KB Output is correct
33 Correct 3 ms 4948 KB Output is correct
34 Correct 2 ms 4948 KB Output is correct
35 Correct 3 ms 4948 KB Output is correct
36 Correct 3 ms 5012 KB Output is correct
37 Correct 3 ms 4948 KB Output is correct
38 Correct 3 ms 4948 KB Output is correct
39 Correct 3 ms 4948 KB Output is correct
40 Correct 3 ms 4948 KB Output is correct
41 Correct 3 ms 4948 KB Output is correct
42 Correct 3 ms 4948 KB Output is correct
43 Correct 3 ms 4948 KB Output is correct
44 Correct 3 ms 5012 KB Output is correct
45 Correct 3 ms 4992 KB Output is correct
46 Correct 3 ms 4948 KB Output is correct
47 Correct 3 ms 4948 KB Output is correct
48 Correct 3 ms 4948 KB Output is correct
49 Correct 3 ms 5016 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 4948 KB Output is correct
2 Correct 3 ms 4948 KB Output is correct
3 Correct 3 ms 4948 KB Output is correct
4 Correct 3 ms 5008 KB Output is correct
5 Correct 4 ms 4948 KB Output is correct
6 Correct 3 ms 4948 KB Output is correct
7 Correct 3 ms 5016 KB Output is correct
8 Correct 3 ms 4948 KB Output is correct
9 Correct 3 ms 4948 KB Output is correct
10 Correct 3 ms 5016 KB Output is correct
11 Correct 3 ms 4948 KB Output is correct
12 Correct 4 ms 5012 KB Output is correct
13 Correct 3 ms 5008 KB Output is correct
14 Correct 3 ms 4948 KB Output is correct
15 Correct 2 ms 4948 KB Output is correct
16 Correct 3 ms 4948 KB Output is correct
17 Correct 2 ms 4948 KB Output is correct
18 Correct 3 ms 4948 KB Output is correct
19 Correct 3 ms 4908 KB Output is correct
20 Correct 4 ms 5000 KB Output is correct
21 Correct 3 ms 4948 KB Output is correct
22 Correct 3 ms 4948 KB Output is correct
23 Correct 3 ms 5012 KB Output is correct
24 Correct 3 ms 4948 KB Output is correct
25 Correct 2 ms 4948 KB Output is correct
26 Correct 3 ms 5012 KB Output is correct
27 Correct 3 ms 4948 KB Output is correct
28 Correct 3 ms 5016 KB Output is correct
29 Correct 3 ms 4948 KB Output is correct
30 Correct 3 ms 4948 KB Output is correct
31 Correct 3 ms 5008 KB Output is correct
32 Correct 4 ms 5016 KB Output is correct
33 Correct 3 ms 4948 KB Output is correct
34 Correct 2 ms 4948 KB Output is correct
35 Correct 3 ms 4948 KB Output is correct
36 Correct 3 ms 5012 KB Output is correct
37 Correct 3 ms 4948 KB Output is correct
38 Correct 3 ms 4948 KB Output is correct
39 Correct 3 ms 4948 KB Output is correct
40 Correct 3 ms 4948 KB Output is correct
41 Correct 3 ms 4948 KB Output is correct
42 Correct 3 ms 4948 KB Output is correct
43 Correct 3 ms 4948 KB Output is correct
44 Correct 3 ms 5012 KB Output is correct
45 Correct 3 ms 4992 KB Output is correct
46 Correct 3 ms 4948 KB Output is correct
47 Correct 3 ms 4948 KB Output is correct
48 Correct 3 ms 4948 KB Output is correct
49 Correct 3 ms 5016 KB Output is correct
50 Correct 4 ms 4948 KB Output is correct
51 Correct 3 ms 4948 KB Output is correct
52 Correct 3 ms 4948 KB Output is correct
53 Correct 3 ms 4948 KB Output is correct
54 Correct 3 ms 4948 KB Output is correct
55 Correct 3 ms 5012 KB Output is correct
56 Correct 3 ms 4948 KB Output is correct
57 Correct 3 ms 5012 KB Output is correct
58 Correct 3 ms 4948 KB Output is correct
59 Correct 3 ms 4948 KB Output is correct
60 Correct 3 ms 4948 KB Output is correct
61 Correct 3 ms 5016 KB Output is correct
62 Correct 3 ms 4948 KB Output is correct
63 Correct 3 ms 4948 KB Output is correct
64 Correct 3 ms 4948 KB Output is correct
65 Correct 4 ms 4948 KB Output is correct
66 Correct 3 ms 4948 KB Output is correct
67 Correct 3 ms 4948 KB Output is correct
68 Correct 3 ms 5008 KB Output is correct
69 Correct 2 ms 5016 KB Output is correct
70 Correct 3 ms 5012 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 4948 KB Output is correct
2 Correct 3 ms 4948 KB Output is correct
3 Correct 3 ms 4948 KB Output is correct
4 Correct 3 ms 5008 KB Output is correct
5 Correct 4 ms 4948 KB Output is correct
6 Correct 3 ms 4948 KB Output is correct
7 Correct 3 ms 5016 KB Output is correct
8 Correct 3 ms 4948 KB Output is correct
9 Correct 3 ms 4948 KB Output is correct
10 Correct 3 ms 5016 KB Output is correct
11 Correct 3 ms 4948 KB Output is correct
12 Correct 4 ms 5012 KB Output is correct
13 Correct 3 ms 5008 KB Output is correct
14 Correct 3 ms 4948 KB Output is correct
15 Correct 2 ms 4948 KB Output is correct
16 Correct 3 ms 4948 KB Output is correct
17 Correct 2 ms 4948 KB Output is correct
18 Correct 3 ms 4948 KB Output is correct
19 Correct 3 ms 4908 KB Output is correct
20 Correct 4 ms 5000 KB Output is correct
21 Correct 3 ms 4948 KB Output is correct
22 Correct 3 ms 4948 KB Output is correct
23 Correct 3 ms 5012 KB Output is correct
24 Correct 3 ms 4948 KB Output is correct
25 Correct 2 ms 4948 KB Output is correct
26 Correct 3 ms 5012 KB Output is correct
27 Correct 3 ms 4948 KB Output is correct
28 Correct 3 ms 5016 KB Output is correct
29 Correct 3 ms 4948 KB Output is correct
30 Correct 3 ms 4948 KB Output is correct
31 Correct 3 ms 5008 KB Output is correct
32 Correct 4 ms 5016 KB Output is correct
33 Correct 3 ms 4948 KB Output is correct
34 Correct 2 ms 4948 KB Output is correct
35 Correct 3 ms 4948 KB Output is correct
36 Correct 3 ms 5012 KB Output is correct
37 Correct 3 ms 4948 KB Output is correct
38 Correct 3 ms 4948 KB Output is correct
39 Correct 3 ms 4948 KB Output is correct
40 Correct 3 ms 4948 KB Output is correct
41 Correct 3 ms 4948 KB Output is correct
42 Correct 3 ms 4948 KB Output is correct
43 Correct 3 ms 4948 KB Output is correct
44 Correct 3 ms 5012 KB Output is correct
45 Correct 3 ms 4992 KB Output is correct
46 Correct 3 ms 4948 KB Output is correct
47 Correct 3 ms 4948 KB Output is correct
48 Correct 3 ms 4948 KB Output is correct
49 Correct 3 ms 5016 KB Output is correct
50 Correct 4 ms 4948 KB Output is correct
51 Correct 3 ms 4948 KB Output is correct
52 Correct 3 ms 4948 KB Output is correct
53 Correct 3 ms 4948 KB Output is correct
54 Correct 3 ms 4948 KB Output is correct
55 Correct 3 ms 5012 KB Output is correct
56 Correct 3 ms 4948 KB Output is correct
57 Correct 3 ms 5012 KB Output is correct
58 Correct 3 ms 4948 KB Output is correct
59 Correct 3 ms 4948 KB Output is correct
60 Correct 3 ms 4948 KB Output is correct
61 Correct 3 ms 5016 KB Output is correct
62 Correct 3 ms 4948 KB Output is correct
63 Correct 3 ms 4948 KB Output is correct
64 Correct 3 ms 4948 KB Output is correct
65 Correct 4 ms 4948 KB Output is correct
66 Correct 3 ms 4948 KB Output is correct
67 Correct 3 ms 4948 KB Output is correct
68 Correct 3 ms 5008 KB Output is correct
69 Correct 2 ms 5016 KB Output is correct
70 Correct 3 ms 5012 KB Output is correct
71 Correct 66 ms 6064 KB Output is correct
72 Correct 45 ms 5908 KB Output is correct
73 Correct 60 ms 5856 KB Output is correct
74 Correct 34 ms 5836 KB Output is correct
75 Correct 38 ms 5720 KB Output is correct
76 Correct 112 ms 6408 KB Output is correct
77 Correct 118 ms 6124 KB Output is correct
78 Correct 94 ms 6200 KB Output is correct
79 Correct 89 ms 6060 KB Output is correct
80 Correct 3 ms 4948 KB Output is correct
81 Correct 3 ms 4944 KB Output is correct
82 Correct 5 ms 5076 KB Output is correct
83 Correct 20 ms 5356 KB Output is correct
84 Correct 18 ms 5332 KB Output is correct
85 Correct 9 ms 5076 KB Output is correct
86 Correct 3 ms 4948 KB Output is correct
87 Correct 26 ms 5484 KB Output is correct
88 Correct 3 ms 4948 KB Output is correct
89 Correct 3 ms 4948 KB Output is correct
90 Correct 4 ms 4996 KB Output is correct
91 Correct 11 ms 5204 KB Output is correct
92 Correct 21 ms 5540 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 4948 KB Output is correct
2 Correct 3 ms 4948 KB Output is correct
3 Correct 3 ms 4948 KB Output is correct
4 Correct 3 ms 5008 KB Output is correct
5 Correct 4 ms 4948 KB Output is correct
6 Correct 3 ms 4948 KB Output is correct
7 Correct 3 ms 5016 KB Output is correct
8 Correct 3 ms 4948 KB Output is correct
9 Correct 3 ms 4948 KB Output is correct
10 Correct 3 ms 5016 KB Output is correct
11 Correct 3 ms 4948 KB Output is correct
12 Correct 4 ms 5012 KB Output is correct
13 Correct 3 ms 5008 KB Output is correct
14 Correct 3 ms 4948 KB Output is correct
15 Correct 2 ms 4948 KB Output is correct
16 Correct 3 ms 4948 KB Output is correct
17 Correct 2 ms 4948 KB Output is correct
18 Correct 3 ms 4948 KB Output is correct
19 Correct 3 ms 4908 KB Output is correct
20 Correct 4 ms 5000 KB Output is correct
21 Correct 3 ms 4948 KB Output is correct
22 Correct 3 ms 4948 KB Output is correct
23 Correct 3 ms 5012 KB Output is correct
24 Correct 3 ms 4948 KB Output is correct
25 Correct 2 ms 4948 KB Output is correct
26 Correct 3 ms 5012 KB Output is correct
27 Correct 3 ms 4948 KB Output is correct
28 Correct 3 ms 5016 KB Output is correct
29 Correct 3 ms 4948 KB Output is correct
30 Correct 3 ms 4948 KB Output is correct
31 Correct 3 ms 5008 KB Output is correct
32 Correct 4 ms 5016 KB Output is correct
33 Correct 3 ms 4948 KB Output is correct
34 Correct 2 ms 4948 KB Output is correct
35 Correct 3 ms 4948 KB Output is correct
36 Correct 3 ms 5012 KB Output is correct
37 Correct 3 ms 4948 KB Output is correct
38 Correct 3 ms 4948 KB Output is correct
39 Correct 3 ms 4948 KB Output is correct
40 Correct 3 ms 4948 KB Output is correct
41 Correct 3 ms 4948 KB Output is correct
42 Correct 3 ms 4948 KB Output is correct
43 Correct 3 ms 4948 KB Output is correct
44 Correct 3 ms 5012 KB Output is correct
45 Correct 3 ms 4992 KB Output is correct
46 Correct 3 ms 4948 KB Output is correct
47 Correct 3 ms 4948 KB Output is correct
48 Correct 3 ms 4948 KB Output is correct
49 Correct 3 ms 5016 KB Output is correct
50 Correct 4 ms 4948 KB Output is correct
51 Correct 3 ms 4948 KB Output is correct
52 Correct 3 ms 4948 KB Output is correct
53 Correct 3 ms 4948 KB Output is correct
54 Correct 3 ms 4948 KB Output is correct
55 Correct 3 ms 5012 KB Output is correct
56 Correct 3 ms 4948 KB Output is correct
57 Correct 3 ms 5012 KB Output is correct
58 Correct 3 ms 4948 KB Output is correct
59 Correct 3 ms 4948 KB Output is correct
60 Correct 3 ms 4948 KB Output is correct
61 Correct 3 ms 5016 KB Output is correct
62 Correct 3 ms 4948 KB Output is correct
63 Correct 3 ms 4948 KB Output is correct
64 Correct 3 ms 4948 KB Output is correct
65 Correct 4 ms 4948 KB Output is correct
66 Correct 3 ms 4948 KB Output is correct
67 Correct 3 ms 4948 KB Output is correct
68 Correct 3 ms 5008 KB Output is correct
69 Correct 2 ms 5016 KB Output is correct
70 Correct 3 ms 5012 KB Output is correct
71 Correct 66 ms 6064 KB Output is correct
72 Correct 45 ms 5908 KB Output is correct
73 Correct 60 ms 5856 KB Output is correct
74 Correct 34 ms 5836 KB Output is correct
75 Correct 38 ms 5720 KB Output is correct
76 Correct 112 ms 6408 KB Output is correct
77 Correct 118 ms 6124 KB Output is correct
78 Correct 94 ms 6200 KB Output is correct
79 Correct 89 ms 6060 KB Output is correct
80 Correct 3 ms 4948 KB Output is correct
81 Correct 3 ms 4944 KB Output is correct
82 Correct 5 ms 5076 KB Output is correct
83 Correct 20 ms 5356 KB Output is correct
84 Correct 18 ms 5332 KB Output is correct
85 Correct 9 ms 5076 KB Output is correct
86 Correct 3 ms 4948 KB Output is correct
87 Correct 26 ms 5484 KB Output is correct
88 Correct 3 ms 4948 KB Output is correct
89 Correct 3 ms 4948 KB Output is correct
90 Correct 4 ms 4996 KB Output is correct
91 Correct 11 ms 5204 KB Output is correct
92 Correct 21 ms 5540 KB Output is correct
93 Correct 525 ms 8648 KB Output is correct
94 Correct 267 ms 7964 KB Output is correct
95 Correct 302 ms 7892 KB Output is correct
96 Correct 254 ms 7676 KB Output is correct
97 Correct 236 ms 7432 KB Output is correct
98 Correct 645 ms 9128 KB Output is correct
99 Correct 745 ms 9232 KB Output is correct
100 Correct 609 ms 9016 KB Output is correct
101 Correct 687 ms 8780 KB Output is correct
102 Correct 606 ms 8460 KB Output is correct
103 Correct 404 ms 8292 KB Output is correct
104 Correct 3 ms 4948 KB Output is correct
105 Correct 4 ms 5076 KB Output is correct
106 Correct 9 ms 5012 KB Output is correct
107 Correct 87 ms 5944 KB Output is correct
108 Correct 168 ms 6468 KB Output is correct
109 Correct 27 ms 5284 KB Output is correct
110 Correct 5 ms 4948 KB Output is correct
111 Correct 106 ms 6008 KB Output is correct
112 Correct 3 ms 5012 KB Output is correct
113 Correct 4 ms 4948 KB Output is correct
114 Correct 12 ms 5076 KB Output is correct
115 Correct 3 ms 4948 KB Output is correct
116 Correct 31 ms 5152 KB Output is correct
117 Correct 111 ms 6916 KB Output is correct