Submission #142911

# Submission time Handle Problem Language Result Execution time Memory
142911 2019-08-12T07:03:24 Z IC_COLDSTOP Toys (CEOI18_toy) C++17
100 / 100
3485 ms 71432 KB
#include<bits/stdc++.h>

using namespace std;
#define ll long long
//#define int ll
#define MP make_pair
#define pb push_back
#define F first
#define S second
#define REP(i,a,b) for(int i=a; i<b; i++)
#define pii pair<int,int>

const int MX=1e5+3, mod=1e9+7;

int n;
set<int> st;
unordered_map<int,int> mark[MX];

void ANS(int u, int v){
	if(mark[v][u]) return;
	mark[v][u]=1;
	st.insert(u-1+v);
	for(int i=2; i<=sqrt(u); i++) if(u%i==0) ANS(u/i, v+i-1);
}

int32_t main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n;
	ANS(n,0);
	cout<<st.size()<<endl;
	for(auto u:st) cout<<u<<" ";
	cout<<endl;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 7 ms 5880 KB Output is correct
2 Correct 8 ms 5880 KB Output is correct
3 Correct 7 ms 5880 KB Output is correct
4 Correct 7 ms 5884 KB Output is correct
5 Correct 7 ms 5752 KB Output is correct
6 Correct 8 ms 5880 KB Output is correct
7 Correct 8 ms 5880 KB Output is correct
8 Correct 7 ms 5880 KB Output is correct
9 Correct 7 ms 5880 KB Output is correct
10 Correct 7 ms 5752 KB Output is correct
11 Correct 7 ms 5752 KB Output is correct
12 Correct 7 ms 5752 KB Output is correct
13 Correct 7 ms 5852 KB Output is correct
14 Correct 7 ms 6028 KB Output is correct
15 Correct 8 ms 5752 KB Output is correct
16 Correct 7 ms 5752 KB Output is correct
17 Correct 7 ms 5884 KB Output is correct
18 Correct 8 ms 5852 KB Output is correct
19 Correct 7 ms 5752 KB Output is correct
20 Correct 8 ms 5832 KB Output is correct
21 Correct 7 ms 5880 KB Output is correct
22 Correct 9 ms 5880 KB Output is correct
23 Correct 7 ms 5880 KB Output is correct
24 Correct 7 ms 5884 KB Output is correct
25 Correct 7 ms 5752 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 5880 KB Output is correct
2 Correct 8 ms 5880 KB Output is correct
3 Correct 7 ms 5880 KB Output is correct
4 Correct 7 ms 5884 KB Output is correct
5 Correct 7 ms 5752 KB Output is correct
6 Correct 8 ms 5880 KB Output is correct
7 Correct 8 ms 5880 KB Output is correct
8 Correct 7 ms 5880 KB Output is correct
9 Correct 7 ms 5880 KB Output is correct
10 Correct 7 ms 5752 KB Output is correct
11 Correct 7 ms 5752 KB Output is correct
12 Correct 7 ms 5752 KB Output is correct
13 Correct 7 ms 5852 KB Output is correct
14 Correct 7 ms 6028 KB Output is correct
15 Correct 8 ms 5752 KB Output is correct
16 Correct 7 ms 5752 KB Output is correct
17 Correct 7 ms 5884 KB Output is correct
18 Correct 8 ms 5852 KB Output is correct
19 Correct 7 ms 5752 KB Output is correct
20 Correct 8 ms 5832 KB Output is correct
21 Correct 7 ms 5880 KB Output is correct
22 Correct 9 ms 5880 KB Output is correct
23 Correct 7 ms 5880 KB Output is correct
24 Correct 7 ms 5884 KB Output is correct
25 Correct 7 ms 5752 KB Output is correct
26 Correct 8 ms 5880 KB Output is correct
27 Correct 7 ms 5880 KB Output is correct
28 Correct 8 ms 5880 KB Output is correct
29 Correct 9 ms 5880 KB Output is correct
30 Correct 9 ms 5880 KB Output is correct
31 Correct 8 ms 5880 KB Output is correct
32 Correct 8 ms 5880 KB Output is correct
33 Correct 8 ms 5880 KB Output is correct
34 Correct 7 ms 5880 KB Output is correct
35 Correct 7 ms 5892 KB Output is correct
36 Correct 8 ms 5880 KB Output is correct
37 Correct 8 ms 5880 KB Output is correct
38 Correct 8 ms 5752 KB Output is correct
39 Correct 7 ms 5880 KB Output is correct
40 Correct 7 ms 5880 KB Output is correct
41 Correct 7 ms 5752 KB Output is correct
42 Correct 8 ms 5880 KB Output is correct
43 Correct 8 ms 5880 KB Output is correct
44 Correct 7 ms 5880 KB Output is correct
45 Correct 7 ms 5752 KB Output is correct
46 Correct 7 ms 5752 KB Output is correct
47 Correct 8 ms 5880 KB Output is correct
48 Correct 7 ms 5752 KB Output is correct
49 Correct 7 ms 5752 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 5880 KB Output is correct
2 Correct 8 ms 5880 KB Output is correct
3 Correct 7 ms 5880 KB Output is correct
4 Correct 7 ms 5884 KB Output is correct
5 Correct 7 ms 5752 KB Output is correct
6 Correct 8 ms 5880 KB Output is correct
7 Correct 8 ms 5880 KB Output is correct
8 Correct 7 ms 5880 KB Output is correct
9 Correct 7 ms 5880 KB Output is correct
10 Correct 7 ms 5752 KB Output is correct
11 Correct 7 ms 5752 KB Output is correct
12 Correct 7 ms 5752 KB Output is correct
13 Correct 7 ms 5852 KB Output is correct
14 Correct 7 ms 6028 KB Output is correct
15 Correct 8 ms 5752 KB Output is correct
16 Correct 7 ms 5752 KB Output is correct
17 Correct 7 ms 5884 KB Output is correct
18 Correct 8 ms 5852 KB Output is correct
19 Correct 7 ms 5752 KB Output is correct
20 Correct 8 ms 5832 KB Output is correct
21 Correct 7 ms 5880 KB Output is correct
22 Correct 9 ms 5880 KB Output is correct
23 Correct 7 ms 5880 KB Output is correct
24 Correct 7 ms 5884 KB Output is correct
25 Correct 7 ms 5752 KB Output is correct
26 Correct 8 ms 5880 KB Output is correct
27 Correct 7 ms 5880 KB Output is correct
28 Correct 8 ms 5880 KB Output is correct
29 Correct 9 ms 5880 KB Output is correct
30 Correct 9 ms 5880 KB Output is correct
31 Correct 8 ms 5880 KB Output is correct
32 Correct 8 ms 5880 KB Output is correct
33 Correct 8 ms 5880 KB Output is correct
34 Correct 7 ms 5880 KB Output is correct
35 Correct 7 ms 5892 KB Output is correct
36 Correct 8 ms 5880 KB Output is correct
37 Correct 8 ms 5880 KB Output is correct
38 Correct 8 ms 5752 KB Output is correct
39 Correct 7 ms 5880 KB Output is correct
40 Correct 7 ms 5880 KB Output is correct
41 Correct 7 ms 5752 KB Output is correct
42 Correct 8 ms 5880 KB Output is correct
43 Correct 8 ms 5880 KB Output is correct
44 Correct 7 ms 5880 KB Output is correct
45 Correct 7 ms 5752 KB Output is correct
46 Correct 7 ms 5752 KB Output is correct
47 Correct 8 ms 5880 KB Output is correct
48 Correct 7 ms 5752 KB Output is correct
49 Correct 7 ms 5752 KB Output is correct
50 Correct 9 ms 6008 KB Output is correct
51 Correct 10 ms 6024 KB Output is correct
52 Correct 9 ms 6008 KB Output is correct
53 Correct 9 ms 6136 KB Output is correct
54 Correct 8 ms 5880 KB Output is correct
55 Correct 10 ms 6136 KB Output is correct
56 Correct 10 ms 6136 KB Output is correct
57 Correct 10 ms 6008 KB Output is correct
58 Correct 19 ms 5880 KB Output is correct
59 Correct 6 ms 5880 KB Output is correct
60 Correct 8 ms 5880 KB Output is correct
61 Correct 9 ms 6008 KB Output is correct
62 Correct 9 ms 5852 KB Output is correct
63 Correct 8 ms 5892 KB Output is correct
64 Correct 7 ms 5880 KB Output is correct
65 Correct 9 ms 5880 KB Output is correct
66 Correct 8 ms 5880 KB Output is correct
67 Correct 7 ms 5752 KB Output is correct
68 Correct 7 ms 5752 KB Output is correct
69 Correct 7 ms 5756 KB Output is correct
70 Correct 8 ms 5880 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 5880 KB Output is correct
2 Correct 8 ms 5880 KB Output is correct
3 Correct 7 ms 5880 KB Output is correct
4 Correct 7 ms 5884 KB Output is correct
5 Correct 7 ms 5752 KB Output is correct
6 Correct 8 ms 5880 KB Output is correct
7 Correct 8 ms 5880 KB Output is correct
8 Correct 7 ms 5880 KB Output is correct
9 Correct 7 ms 5880 KB Output is correct
10 Correct 7 ms 5752 KB Output is correct
11 Correct 7 ms 5752 KB Output is correct
12 Correct 7 ms 5752 KB Output is correct
13 Correct 7 ms 5852 KB Output is correct
14 Correct 7 ms 6028 KB Output is correct
15 Correct 8 ms 5752 KB Output is correct
16 Correct 7 ms 5752 KB Output is correct
17 Correct 7 ms 5884 KB Output is correct
18 Correct 8 ms 5852 KB Output is correct
19 Correct 7 ms 5752 KB Output is correct
20 Correct 8 ms 5832 KB Output is correct
21 Correct 7 ms 5880 KB Output is correct
22 Correct 9 ms 5880 KB Output is correct
23 Correct 7 ms 5880 KB Output is correct
24 Correct 7 ms 5884 KB Output is correct
25 Correct 7 ms 5752 KB Output is correct
26 Correct 8 ms 5880 KB Output is correct
27 Correct 7 ms 5880 KB Output is correct
28 Correct 8 ms 5880 KB Output is correct
29 Correct 9 ms 5880 KB Output is correct
30 Correct 9 ms 5880 KB Output is correct
31 Correct 8 ms 5880 KB Output is correct
32 Correct 8 ms 5880 KB Output is correct
33 Correct 8 ms 5880 KB Output is correct
34 Correct 7 ms 5880 KB Output is correct
35 Correct 7 ms 5892 KB Output is correct
36 Correct 8 ms 5880 KB Output is correct
37 Correct 8 ms 5880 KB Output is correct
38 Correct 8 ms 5752 KB Output is correct
39 Correct 7 ms 5880 KB Output is correct
40 Correct 7 ms 5880 KB Output is correct
41 Correct 7 ms 5752 KB Output is correct
42 Correct 8 ms 5880 KB Output is correct
43 Correct 8 ms 5880 KB Output is correct
44 Correct 7 ms 5880 KB Output is correct
45 Correct 7 ms 5752 KB Output is correct
46 Correct 7 ms 5752 KB Output is correct
47 Correct 8 ms 5880 KB Output is correct
48 Correct 7 ms 5752 KB Output is correct
49 Correct 7 ms 5752 KB Output is correct
50 Correct 9 ms 6008 KB Output is correct
51 Correct 10 ms 6024 KB Output is correct
52 Correct 9 ms 6008 KB Output is correct
53 Correct 9 ms 6136 KB Output is correct
54 Correct 8 ms 5880 KB Output is correct
55 Correct 10 ms 6136 KB Output is correct
56 Correct 10 ms 6136 KB Output is correct
57 Correct 10 ms 6008 KB Output is correct
58 Correct 19 ms 5880 KB Output is correct
59 Correct 6 ms 5880 KB Output is correct
60 Correct 8 ms 5880 KB Output is correct
61 Correct 9 ms 6008 KB Output is correct
62 Correct 9 ms 5852 KB Output is correct
63 Correct 8 ms 5892 KB Output is correct
64 Correct 7 ms 5880 KB Output is correct
65 Correct 9 ms 5880 KB Output is correct
66 Correct 8 ms 5880 KB Output is correct
67 Correct 7 ms 5752 KB Output is correct
68 Correct 7 ms 5752 KB Output is correct
69 Correct 7 ms 5756 KB Output is correct
70 Correct 8 ms 5880 KB Output is correct
71 Correct 399 ms 19272 KB Output is correct
72 Correct 253 ms 15836 KB Output is correct
73 Correct 313 ms 17912 KB Output is correct
74 Correct 173 ms 13748 KB Output is correct
75 Correct 200 ms 14196 KB Output is correct
76 Correct 573 ms 24372 KB Output is correct
77 Correct 505 ms 22220 KB Output is correct
78 Correct 484 ms 21104 KB Output is correct
79 Correct 408 ms 20728 KB Output is correct
80 Correct 7 ms 5880 KB Output is correct
81 Correct 7 ms 5880 KB Output is correct
82 Correct 11 ms 6076 KB Output is correct
83 Correct 49 ms 8316 KB Output is correct
84 Correct 54 ms 8824 KB Output is correct
85 Correct 21 ms 6648 KB Output is correct
86 Correct 8 ms 5756 KB Output is correct
87 Correct 65 ms 9208 KB Output is correct
88 Correct 7 ms 5884 KB Output is correct
89 Correct 9 ms 5800 KB Output is correct
90 Correct 9 ms 5880 KB Output is correct
91 Correct 34 ms 7032 KB Output is correct
92 Correct 93 ms 10232 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 5880 KB Output is correct
2 Correct 8 ms 5880 KB Output is correct
3 Correct 7 ms 5880 KB Output is correct
4 Correct 7 ms 5884 KB Output is correct
5 Correct 7 ms 5752 KB Output is correct
6 Correct 8 ms 5880 KB Output is correct
7 Correct 8 ms 5880 KB Output is correct
8 Correct 7 ms 5880 KB Output is correct
9 Correct 7 ms 5880 KB Output is correct
10 Correct 7 ms 5752 KB Output is correct
11 Correct 7 ms 5752 KB Output is correct
12 Correct 7 ms 5752 KB Output is correct
13 Correct 7 ms 5852 KB Output is correct
14 Correct 7 ms 6028 KB Output is correct
15 Correct 8 ms 5752 KB Output is correct
16 Correct 7 ms 5752 KB Output is correct
17 Correct 7 ms 5884 KB Output is correct
18 Correct 8 ms 5852 KB Output is correct
19 Correct 7 ms 5752 KB Output is correct
20 Correct 8 ms 5832 KB Output is correct
21 Correct 7 ms 5880 KB Output is correct
22 Correct 9 ms 5880 KB Output is correct
23 Correct 7 ms 5880 KB Output is correct
24 Correct 7 ms 5884 KB Output is correct
25 Correct 7 ms 5752 KB Output is correct
26 Correct 8 ms 5880 KB Output is correct
27 Correct 7 ms 5880 KB Output is correct
28 Correct 8 ms 5880 KB Output is correct
29 Correct 9 ms 5880 KB Output is correct
30 Correct 9 ms 5880 KB Output is correct
31 Correct 8 ms 5880 KB Output is correct
32 Correct 8 ms 5880 KB Output is correct
33 Correct 8 ms 5880 KB Output is correct
34 Correct 7 ms 5880 KB Output is correct
35 Correct 7 ms 5892 KB Output is correct
36 Correct 8 ms 5880 KB Output is correct
37 Correct 8 ms 5880 KB Output is correct
38 Correct 8 ms 5752 KB Output is correct
39 Correct 7 ms 5880 KB Output is correct
40 Correct 7 ms 5880 KB Output is correct
41 Correct 7 ms 5752 KB Output is correct
42 Correct 8 ms 5880 KB Output is correct
43 Correct 8 ms 5880 KB Output is correct
44 Correct 7 ms 5880 KB Output is correct
45 Correct 7 ms 5752 KB Output is correct
46 Correct 7 ms 5752 KB Output is correct
47 Correct 8 ms 5880 KB Output is correct
48 Correct 7 ms 5752 KB Output is correct
49 Correct 7 ms 5752 KB Output is correct
50 Correct 9 ms 6008 KB Output is correct
51 Correct 10 ms 6024 KB Output is correct
52 Correct 9 ms 6008 KB Output is correct
53 Correct 9 ms 6136 KB Output is correct
54 Correct 8 ms 5880 KB Output is correct
55 Correct 10 ms 6136 KB Output is correct
56 Correct 10 ms 6136 KB Output is correct
57 Correct 10 ms 6008 KB Output is correct
58 Correct 19 ms 5880 KB Output is correct
59 Correct 6 ms 5880 KB Output is correct
60 Correct 8 ms 5880 KB Output is correct
61 Correct 9 ms 6008 KB Output is correct
62 Correct 9 ms 5852 KB Output is correct
63 Correct 8 ms 5892 KB Output is correct
64 Correct 7 ms 5880 KB Output is correct
65 Correct 9 ms 5880 KB Output is correct
66 Correct 8 ms 5880 KB Output is correct
67 Correct 7 ms 5752 KB Output is correct
68 Correct 7 ms 5752 KB Output is correct
69 Correct 7 ms 5756 KB Output is correct
70 Correct 8 ms 5880 KB Output is correct
71 Correct 399 ms 19272 KB Output is correct
72 Correct 253 ms 15836 KB Output is correct
73 Correct 313 ms 17912 KB Output is correct
74 Correct 173 ms 13748 KB Output is correct
75 Correct 200 ms 14196 KB Output is correct
76 Correct 573 ms 24372 KB Output is correct
77 Correct 505 ms 22220 KB Output is correct
78 Correct 484 ms 21104 KB Output is correct
79 Correct 408 ms 20728 KB Output is correct
80 Correct 7 ms 5880 KB Output is correct
81 Correct 7 ms 5880 KB Output is correct
82 Correct 11 ms 6076 KB Output is correct
83 Correct 49 ms 8316 KB Output is correct
84 Correct 54 ms 8824 KB Output is correct
85 Correct 21 ms 6648 KB Output is correct
86 Correct 8 ms 5756 KB Output is correct
87 Correct 65 ms 9208 KB Output is correct
88 Correct 7 ms 5884 KB Output is correct
89 Correct 9 ms 5800 KB Output is correct
90 Correct 9 ms 5880 KB Output is correct
91 Correct 34 ms 7032 KB Output is correct
92 Correct 93 ms 10232 KB Output is correct
93 Correct 2894 ms 63780 KB Output is correct
94 Correct 1601 ms 44408 KB Output is correct
95 Correct 1808 ms 46740 KB Output is correct
96 Correct 1482 ms 42136 KB Output is correct
97 Correct 1354 ms 38824 KB Output is correct
98 Correct 3374 ms 70232 KB Output is correct
99 Correct 3485 ms 71432 KB Output is correct
100 Correct 3134 ms 68720 KB Output is correct
101 Correct 2900 ms 64048 KB Output is correct
102 Correct 2625 ms 58336 KB Output is correct
103 Correct 2212 ms 52468 KB Output is correct
104 Correct 7 ms 5880 KB Output is correct
105 Correct 8 ms 5880 KB Output is correct
106 Correct 15 ms 6392 KB Output is correct
107 Correct 193 ms 13048 KB Output is correct
108 Correct 474 ms 20828 KB Output is correct
109 Correct 51 ms 8056 KB Output is correct
110 Correct 9 ms 5880 KB Output is correct
111 Correct 255 ms 14524 KB Output is correct
112 Correct 10 ms 5880 KB Output is correct
113 Correct 8 ms 5880 KB Output is correct
114 Correct 19 ms 6264 KB Output is correct
115 Correct 7 ms 5852 KB Output is correct
116 Correct 34 ms 6648 KB Output is correct
117 Correct 571 ms 23260 KB Output is correct