#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
#define INF 1e18
#define ret return
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector < pair<int, int> > vii;
typedef long double ld;
typedef tree<pair<int,int>, null_type, less<pair<int,int> >, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;
set <ll> dp[111111];
int main(){
int n;
cin >> n;
if(n==1){
cout << 1 << '\n' << 0;
ret 0;
}
for(int i = 2; i <= n; i++){
dp[i].insert(i-1);
for(int j = 2; j <= sqrt(n); j++){
if(i%j==0){
for(auto it: dp[j]){
for(auto itt: dp[i/j]){
dp[i].insert(it+itt);
}
}
}
}
}
cout << dp[n].size() << endl;
for(auto it: dp[n]){
cout << it << " ";
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
5496 KB |
Output is correct |
2 |
Correct |
7 ms |
5608 KB |
Output is correct |
3 |
Correct |
8 ms |
5608 KB |
Output is correct |
4 |
Correct |
8 ms |
5608 KB |
Output is correct |
5 |
Correct |
8 ms |
5608 KB |
Output is correct |
6 |
Correct |
7 ms |
5632 KB |
Output is correct |
7 |
Correct |
8 ms |
5688 KB |
Output is correct |
8 |
Correct |
7 ms |
5688 KB |
Output is correct |
9 |
Correct |
7 ms |
5708 KB |
Output is correct |
10 |
Correct |
8 ms |
5768 KB |
Output is correct |
11 |
Correct |
7 ms |
5768 KB |
Output is correct |
12 |
Correct |
8 ms |
5768 KB |
Output is correct |
13 |
Correct |
6 ms |
5768 KB |
Output is correct |
14 |
Correct |
8 ms |
5768 KB |
Output is correct |
15 |
Correct |
8 ms |
5768 KB |
Output is correct |
16 |
Correct |
7 ms |
5768 KB |
Output is correct |
17 |
Correct |
8 ms |
5768 KB |
Output is correct |
18 |
Correct |
9 ms |
5768 KB |
Output is correct |
19 |
Correct |
7 ms |
5768 KB |
Output is correct |
20 |
Correct |
7 ms |
5768 KB |
Output is correct |
21 |
Correct |
7 ms |
5768 KB |
Output is correct |
22 |
Correct |
7 ms |
5768 KB |
Output is correct |
23 |
Correct |
8 ms |
5796 KB |
Output is correct |
24 |
Correct |
8 ms |
5796 KB |
Output is correct |
25 |
Correct |
7 ms |
5796 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
5496 KB |
Output is correct |
2 |
Correct |
7 ms |
5608 KB |
Output is correct |
3 |
Correct |
8 ms |
5608 KB |
Output is correct |
4 |
Correct |
8 ms |
5608 KB |
Output is correct |
5 |
Correct |
8 ms |
5608 KB |
Output is correct |
6 |
Correct |
7 ms |
5632 KB |
Output is correct |
7 |
Correct |
8 ms |
5688 KB |
Output is correct |
8 |
Correct |
7 ms |
5688 KB |
Output is correct |
9 |
Correct |
7 ms |
5708 KB |
Output is correct |
10 |
Correct |
8 ms |
5768 KB |
Output is correct |
11 |
Correct |
7 ms |
5768 KB |
Output is correct |
12 |
Correct |
8 ms |
5768 KB |
Output is correct |
13 |
Correct |
6 ms |
5768 KB |
Output is correct |
14 |
Correct |
8 ms |
5768 KB |
Output is correct |
15 |
Correct |
8 ms |
5768 KB |
Output is correct |
16 |
Correct |
7 ms |
5768 KB |
Output is correct |
17 |
Correct |
8 ms |
5768 KB |
Output is correct |
18 |
Correct |
9 ms |
5768 KB |
Output is correct |
19 |
Correct |
7 ms |
5768 KB |
Output is correct |
20 |
Correct |
7 ms |
5768 KB |
Output is correct |
21 |
Correct |
7 ms |
5768 KB |
Output is correct |
22 |
Correct |
7 ms |
5768 KB |
Output is correct |
23 |
Correct |
8 ms |
5796 KB |
Output is correct |
24 |
Correct |
8 ms |
5796 KB |
Output is correct |
25 |
Correct |
7 ms |
5796 KB |
Output is correct |
26 |
Correct |
56 ms |
9724 KB |
Output is correct |
27 |
Correct |
39 ms |
9724 KB |
Output is correct |
28 |
Correct |
21 ms |
9724 KB |
Output is correct |
29 |
Correct |
12 ms |
9724 KB |
Output is correct |
30 |
Correct |
10 ms |
9724 KB |
Output is correct |
31 |
Correct |
58 ms |
10476 KB |
Output is correct |
32 |
Correct |
51 ms |
10476 KB |
Output is correct |
33 |
Correct |
42 ms |
10476 KB |
Output is correct |
34 |
Correct |
93 ms |
11372 KB |
Output is correct |
35 |
Correct |
70 ms |
11372 KB |
Output is correct |
36 |
Correct |
61 ms |
11372 KB |
Output is correct |
37 |
Correct |
56 ms |
11372 KB |
Output is correct |
38 |
Correct |
73 ms |
11500 KB |
Output is correct |
39 |
Correct |
72 ms |
11500 KB |
Output is correct |
40 |
Correct |
64 ms |
11500 KB |
Output is correct |
41 |
Correct |
73 ms |
11500 KB |
Output is correct |
42 |
Correct |
72 ms |
11500 KB |
Output is correct |
43 |
Correct |
72 ms |
11500 KB |
Output is correct |
44 |
Correct |
85 ms |
11516 KB |
Output is correct |
45 |
Correct |
75 ms |
11632 KB |
Output is correct |
46 |
Correct |
83 ms |
11632 KB |
Output is correct |
47 |
Correct |
81 ms |
11632 KB |
Output is correct |
48 |
Correct |
82 ms |
11632 KB |
Output is correct |
49 |
Correct |
70 ms |
11632 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
5496 KB |
Output is correct |
2 |
Correct |
7 ms |
5608 KB |
Output is correct |
3 |
Correct |
8 ms |
5608 KB |
Output is correct |
4 |
Correct |
8 ms |
5608 KB |
Output is correct |
5 |
Correct |
8 ms |
5608 KB |
Output is correct |
6 |
Correct |
7 ms |
5632 KB |
Output is correct |
7 |
Correct |
8 ms |
5688 KB |
Output is correct |
8 |
Correct |
7 ms |
5688 KB |
Output is correct |
9 |
Correct |
7 ms |
5708 KB |
Output is correct |
10 |
Correct |
8 ms |
5768 KB |
Output is correct |
11 |
Correct |
7 ms |
5768 KB |
Output is correct |
12 |
Correct |
8 ms |
5768 KB |
Output is correct |
13 |
Correct |
6 ms |
5768 KB |
Output is correct |
14 |
Correct |
8 ms |
5768 KB |
Output is correct |
15 |
Correct |
8 ms |
5768 KB |
Output is correct |
16 |
Correct |
7 ms |
5768 KB |
Output is correct |
17 |
Correct |
8 ms |
5768 KB |
Output is correct |
18 |
Correct |
9 ms |
5768 KB |
Output is correct |
19 |
Correct |
7 ms |
5768 KB |
Output is correct |
20 |
Correct |
7 ms |
5768 KB |
Output is correct |
21 |
Correct |
7 ms |
5768 KB |
Output is correct |
22 |
Correct |
7 ms |
5768 KB |
Output is correct |
23 |
Correct |
8 ms |
5796 KB |
Output is correct |
24 |
Correct |
8 ms |
5796 KB |
Output is correct |
25 |
Correct |
7 ms |
5796 KB |
Output is correct |
26 |
Correct |
56 ms |
9724 KB |
Output is correct |
27 |
Correct |
39 ms |
9724 KB |
Output is correct |
28 |
Correct |
21 ms |
9724 KB |
Output is correct |
29 |
Correct |
12 ms |
9724 KB |
Output is correct |
30 |
Correct |
10 ms |
9724 KB |
Output is correct |
31 |
Correct |
58 ms |
10476 KB |
Output is correct |
32 |
Correct |
51 ms |
10476 KB |
Output is correct |
33 |
Correct |
42 ms |
10476 KB |
Output is correct |
34 |
Correct |
93 ms |
11372 KB |
Output is correct |
35 |
Correct |
70 ms |
11372 KB |
Output is correct |
36 |
Correct |
61 ms |
11372 KB |
Output is correct |
37 |
Correct |
56 ms |
11372 KB |
Output is correct |
38 |
Correct |
73 ms |
11500 KB |
Output is correct |
39 |
Correct |
72 ms |
11500 KB |
Output is correct |
40 |
Correct |
64 ms |
11500 KB |
Output is correct |
41 |
Correct |
73 ms |
11500 KB |
Output is correct |
42 |
Correct |
72 ms |
11500 KB |
Output is correct |
43 |
Correct |
72 ms |
11500 KB |
Output is correct |
44 |
Correct |
85 ms |
11516 KB |
Output is correct |
45 |
Correct |
75 ms |
11632 KB |
Output is correct |
46 |
Correct |
83 ms |
11632 KB |
Output is correct |
47 |
Correct |
81 ms |
11632 KB |
Output is correct |
48 |
Correct |
82 ms |
11632 KB |
Output is correct |
49 |
Correct |
70 ms |
11632 KB |
Output is correct |
50 |
Correct |
1460 ms |
82476 KB |
Output is correct |
51 |
Correct |
794 ms |
82476 KB |
Output is correct |
52 |
Correct |
729 ms |
82476 KB |
Output is correct |
53 |
Correct |
624 ms |
82476 KB |
Output is correct |
54 |
Correct |
332 ms |
82476 KB |
Output is correct |
55 |
Correct |
1636 ms |
91092 KB |
Output is correct |
56 |
Correct |
1387 ms |
91092 KB |
Output is correct |
57 |
Correct |
1265 ms |
91092 KB |
Output is correct |
58 |
Correct |
1856 ms |
101584 KB |
Output is correct |
59 |
Correct |
1828 ms |
101584 KB |
Output is correct |
60 |
Correct |
1010 ms |
101584 KB |
Output is correct |
61 |
Correct |
1770 ms |
101584 KB |
Output is correct |
62 |
Correct |
286 ms |
101584 KB |
Output is correct |
63 |
Correct |
1747 ms |
101584 KB |
Output is correct |
64 |
Correct |
1948 ms |
101664 KB |
Output is correct |
65 |
Correct |
1626 ms |
101664 KB |
Output is correct |
66 |
Correct |
1854 ms |
101664 KB |
Output is correct |
67 |
Correct |
1802 ms |
101664 KB |
Output is correct |
68 |
Correct |
1862 ms |
101664 KB |
Output is correct |
69 |
Correct |
1908 ms |
101664 KB |
Output is correct |
70 |
Correct |
1635 ms |
101664 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
5496 KB |
Output is correct |
2 |
Correct |
7 ms |
5608 KB |
Output is correct |
3 |
Correct |
8 ms |
5608 KB |
Output is correct |
4 |
Correct |
8 ms |
5608 KB |
Output is correct |
5 |
Correct |
8 ms |
5608 KB |
Output is correct |
6 |
Correct |
7 ms |
5632 KB |
Output is correct |
7 |
Correct |
8 ms |
5688 KB |
Output is correct |
8 |
Correct |
7 ms |
5688 KB |
Output is correct |
9 |
Correct |
7 ms |
5708 KB |
Output is correct |
10 |
Correct |
8 ms |
5768 KB |
Output is correct |
11 |
Correct |
7 ms |
5768 KB |
Output is correct |
12 |
Correct |
8 ms |
5768 KB |
Output is correct |
13 |
Correct |
6 ms |
5768 KB |
Output is correct |
14 |
Correct |
8 ms |
5768 KB |
Output is correct |
15 |
Correct |
8 ms |
5768 KB |
Output is correct |
16 |
Correct |
7 ms |
5768 KB |
Output is correct |
17 |
Correct |
8 ms |
5768 KB |
Output is correct |
18 |
Correct |
9 ms |
5768 KB |
Output is correct |
19 |
Correct |
7 ms |
5768 KB |
Output is correct |
20 |
Correct |
7 ms |
5768 KB |
Output is correct |
21 |
Correct |
7 ms |
5768 KB |
Output is correct |
22 |
Correct |
7 ms |
5768 KB |
Output is correct |
23 |
Correct |
8 ms |
5796 KB |
Output is correct |
24 |
Correct |
8 ms |
5796 KB |
Output is correct |
25 |
Correct |
7 ms |
5796 KB |
Output is correct |
26 |
Correct |
56 ms |
9724 KB |
Output is correct |
27 |
Correct |
39 ms |
9724 KB |
Output is correct |
28 |
Correct |
21 ms |
9724 KB |
Output is correct |
29 |
Correct |
12 ms |
9724 KB |
Output is correct |
30 |
Correct |
10 ms |
9724 KB |
Output is correct |
31 |
Correct |
58 ms |
10476 KB |
Output is correct |
32 |
Correct |
51 ms |
10476 KB |
Output is correct |
33 |
Correct |
42 ms |
10476 KB |
Output is correct |
34 |
Correct |
93 ms |
11372 KB |
Output is correct |
35 |
Correct |
70 ms |
11372 KB |
Output is correct |
36 |
Correct |
61 ms |
11372 KB |
Output is correct |
37 |
Correct |
56 ms |
11372 KB |
Output is correct |
38 |
Correct |
73 ms |
11500 KB |
Output is correct |
39 |
Correct |
72 ms |
11500 KB |
Output is correct |
40 |
Correct |
64 ms |
11500 KB |
Output is correct |
41 |
Correct |
73 ms |
11500 KB |
Output is correct |
42 |
Correct |
72 ms |
11500 KB |
Output is correct |
43 |
Correct |
72 ms |
11500 KB |
Output is correct |
44 |
Correct |
85 ms |
11516 KB |
Output is correct |
45 |
Correct |
75 ms |
11632 KB |
Output is correct |
46 |
Correct |
83 ms |
11632 KB |
Output is correct |
47 |
Correct |
81 ms |
11632 KB |
Output is correct |
48 |
Correct |
82 ms |
11632 KB |
Output is correct |
49 |
Correct |
70 ms |
11632 KB |
Output is correct |
50 |
Correct |
1460 ms |
82476 KB |
Output is correct |
51 |
Correct |
794 ms |
82476 KB |
Output is correct |
52 |
Correct |
729 ms |
82476 KB |
Output is correct |
53 |
Correct |
624 ms |
82476 KB |
Output is correct |
54 |
Correct |
332 ms |
82476 KB |
Output is correct |
55 |
Correct |
1636 ms |
91092 KB |
Output is correct |
56 |
Correct |
1387 ms |
91092 KB |
Output is correct |
57 |
Correct |
1265 ms |
91092 KB |
Output is correct |
58 |
Correct |
1856 ms |
101584 KB |
Output is correct |
59 |
Correct |
1828 ms |
101584 KB |
Output is correct |
60 |
Correct |
1010 ms |
101584 KB |
Output is correct |
61 |
Correct |
1770 ms |
101584 KB |
Output is correct |
62 |
Correct |
286 ms |
101584 KB |
Output is correct |
63 |
Correct |
1747 ms |
101584 KB |
Output is correct |
64 |
Correct |
1948 ms |
101664 KB |
Output is correct |
65 |
Correct |
1626 ms |
101664 KB |
Output is correct |
66 |
Correct |
1854 ms |
101664 KB |
Output is correct |
67 |
Correct |
1802 ms |
101664 KB |
Output is correct |
68 |
Correct |
1862 ms |
101664 KB |
Output is correct |
69 |
Correct |
1908 ms |
101664 KB |
Output is correct |
70 |
Correct |
1635 ms |
101664 KB |
Output is correct |
71 |
Execution timed out |
5028 ms |
101664 KB |
Time limit exceeded |
72 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
5496 KB |
Output is correct |
2 |
Correct |
7 ms |
5608 KB |
Output is correct |
3 |
Correct |
8 ms |
5608 KB |
Output is correct |
4 |
Correct |
8 ms |
5608 KB |
Output is correct |
5 |
Correct |
8 ms |
5608 KB |
Output is correct |
6 |
Correct |
7 ms |
5632 KB |
Output is correct |
7 |
Correct |
8 ms |
5688 KB |
Output is correct |
8 |
Correct |
7 ms |
5688 KB |
Output is correct |
9 |
Correct |
7 ms |
5708 KB |
Output is correct |
10 |
Correct |
8 ms |
5768 KB |
Output is correct |
11 |
Correct |
7 ms |
5768 KB |
Output is correct |
12 |
Correct |
8 ms |
5768 KB |
Output is correct |
13 |
Correct |
6 ms |
5768 KB |
Output is correct |
14 |
Correct |
8 ms |
5768 KB |
Output is correct |
15 |
Correct |
8 ms |
5768 KB |
Output is correct |
16 |
Correct |
7 ms |
5768 KB |
Output is correct |
17 |
Correct |
8 ms |
5768 KB |
Output is correct |
18 |
Correct |
9 ms |
5768 KB |
Output is correct |
19 |
Correct |
7 ms |
5768 KB |
Output is correct |
20 |
Correct |
7 ms |
5768 KB |
Output is correct |
21 |
Correct |
7 ms |
5768 KB |
Output is correct |
22 |
Correct |
7 ms |
5768 KB |
Output is correct |
23 |
Correct |
8 ms |
5796 KB |
Output is correct |
24 |
Correct |
8 ms |
5796 KB |
Output is correct |
25 |
Correct |
7 ms |
5796 KB |
Output is correct |
26 |
Correct |
56 ms |
9724 KB |
Output is correct |
27 |
Correct |
39 ms |
9724 KB |
Output is correct |
28 |
Correct |
21 ms |
9724 KB |
Output is correct |
29 |
Correct |
12 ms |
9724 KB |
Output is correct |
30 |
Correct |
10 ms |
9724 KB |
Output is correct |
31 |
Correct |
58 ms |
10476 KB |
Output is correct |
32 |
Correct |
51 ms |
10476 KB |
Output is correct |
33 |
Correct |
42 ms |
10476 KB |
Output is correct |
34 |
Correct |
93 ms |
11372 KB |
Output is correct |
35 |
Correct |
70 ms |
11372 KB |
Output is correct |
36 |
Correct |
61 ms |
11372 KB |
Output is correct |
37 |
Correct |
56 ms |
11372 KB |
Output is correct |
38 |
Correct |
73 ms |
11500 KB |
Output is correct |
39 |
Correct |
72 ms |
11500 KB |
Output is correct |
40 |
Correct |
64 ms |
11500 KB |
Output is correct |
41 |
Correct |
73 ms |
11500 KB |
Output is correct |
42 |
Correct |
72 ms |
11500 KB |
Output is correct |
43 |
Correct |
72 ms |
11500 KB |
Output is correct |
44 |
Correct |
85 ms |
11516 KB |
Output is correct |
45 |
Correct |
75 ms |
11632 KB |
Output is correct |
46 |
Correct |
83 ms |
11632 KB |
Output is correct |
47 |
Correct |
81 ms |
11632 KB |
Output is correct |
48 |
Correct |
82 ms |
11632 KB |
Output is correct |
49 |
Correct |
70 ms |
11632 KB |
Output is correct |
50 |
Correct |
1460 ms |
82476 KB |
Output is correct |
51 |
Correct |
794 ms |
82476 KB |
Output is correct |
52 |
Correct |
729 ms |
82476 KB |
Output is correct |
53 |
Correct |
624 ms |
82476 KB |
Output is correct |
54 |
Correct |
332 ms |
82476 KB |
Output is correct |
55 |
Correct |
1636 ms |
91092 KB |
Output is correct |
56 |
Correct |
1387 ms |
91092 KB |
Output is correct |
57 |
Correct |
1265 ms |
91092 KB |
Output is correct |
58 |
Correct |
1856 ms |
101584 KB |
Output is correct |
59 |
Correct |
1828 ms |
101584 KB |
Output is correct |
60 |
Correct |
1010 ms |
101584 KB |
Output is correct |
61 |
Correct |
1770 ms |
101584 KB |
Output is correct |
62 |
Correct |
286 ms |
101584 KB |
Output is correct |
63 |
Correct |
1747 ms |
101584 KB |
Output is correct |
64 |
Correct |
1948 ms |
101664 KB |
Output is correct |
65 |
Correct |
1626 ms |
101664 KB |
Output is correct |
66 |
Correct |
1854 ms |
101664 KB |
Output is correct |
67 |
Correct |
1802 ms |
101664 KB |
Output is correct |
68 |
Correct |
1862 ms |
101664 KB |
Output is correct |
69 |
Correct |
1908 ms |
101664 KB |
Output is correct |
70 |
Correct |
1635 ms |
101664 KB |
Output is correct |
71 |
Execution timed out |
5028 ms |
101664 KB |
Time limit exceeded |
72 |
Halted |
0 ms |
0 KB |
- |