Submission #78953

# Submission time Handle Problem Language Result Execution time Memory
78953 2018-10-09T17:55:29 Z aminra Toys (CEOI18_toy) C++14
100 / 100
3694 ms 92104 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = (int)1e9 + 7;
const int MAXN = (int)1e5 + 7;
const int infint = (int)1e9;
vector<int> dv;
set<int> dp[MAXN];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int n;
	cin >> n;
	for (int i = 1; i * i <= n; i++)
	{
	    if(n % i)
	        continue;
		dv.push_back(i);
		if(i * i != n)
			dv.push_back(n / i);
	}
	sort(dv.begin(), dv.end());
	dp[0].insert(0);
	for (int i = 1; i < dv.size(); i++)
		for (int j = 0; j < i; j++)
			if(dv[i] % dv[j] == 0)
				for (auto u : dp[j])
					dp[i].insert(u + dv[i] / dv[j] - 1);
	cout << dp[dv.size() - 1].size() << "\n";
	for (auto u : dp[dv.size() - 1])
		cout << u << " ";
}

Compilation message

toy.cpp: In function 'int main()':
toy.cpp:18:6: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
      if(n % i)
      ^~
toy.cpp:20:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   dv.push_back(i);
   ^~
toy.cpp:26:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 1; i < dv.size(); i++)
                  ~~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 6 ms 5112 KB Output is correct
2 Correct 6 ms 5120 KB Output is correct
3 Correct 6 ms 5120 KB Output is correct
4 Correct 5 ms 5120 KB Output is correct
5 Correct 6 ms 5208 KB Output is correct
6 Correct 6 ms 5244 KB Output is correct
7 Correct 6 ms 5244 KB Output is correct
8 Correct 6 ms 5244 KB Output is correct
9 Correct 6 ms 5244 KB Output is correct
10 Correct 6 ms 5244 KB Output is correct
11 Correct 6 ms 5308 KB Output is correct
12 Correct 6 ms 5308 KB Output is correct
13 Correct 6 ms 5404 KB Output is correct
14 Correct 6 ms 5404 KB Output is correct
15 Correct 6 ms 5404 KB Output is correct
16 Correct 6 ms 5404 KB Output is correct
17 Correct 6 ms 5404 KB Output is correct
18 Correct 6 ms 5404 KB Output is correct
19 Correct 6 ms 5404 KB Output is correct
20 Correct 6 ms 5404 KB Output is correct
21 Correct 6 ms 5404 KB Output is correct
22 Correct 6 ms 5404 KB Output is correct
23 Correct 6 ms 5432 KB Output is correct
24 Correct 7 ms 5432 KB Output is correct
25 Correct 6 ms 5432 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 5112 KB Output is correct
2 Correct 6 ms 5120 KB Output is correct
3 Correct 6 ms 5120 KB Output is correct
4 Correct 5 ms 5120 KB Output is correct
5 Correct 6 ms 5208 KB Output is correct
6 Correct 6 ms 5244 KB Output is correct
7 Correct 6 ms 5244 KB Output is correct
8 Correct 6 ms 5244 KB Output is correct
9 Correct 6 ms 5244 KB Output is correct
10 Correct 6 ms 5244 KB Output is correct
11 Correct 6 ms 5308 KB Output is correct
12 Correct 6 ms 5308 KB Output is correct
13 Correct 6 ms 5404 KB Output is correct
14 Correct 6 ms 5404 KB Output is correct
15 Correct 6 ms 5404 KB Output is correct
16 Correct 6 ms 5404 KB Output is correct
17 Correct 6 ms 5404 KB Output is correct
18 Correct 6 ms 5404 KB Output is correct
19 Correct 6 ms 5404 KB Output is correct
20 Correct 6 ms 5404 KB Output is correct
21 Correct 6 ms 5404 KB Output is correct
22 Correct 6 ms 5404 KB Output is correct
23 Correct 6 ms 5432 KB Output is correct
24 Correct 7 ms 5432 KB Output is correct
25 Correct 6 ms 5432 KB Output is correct
26 Correct 7 ms 5472 KB Output is correct
27 Correct 6 ms 5476 KB Output is correct
28 Correct 6 ms 5480 KB Output is correct
29 Correct 6 ms 5480 KB Output is correct
30 Correct 6 ms 5480 KB Output is correct
31 Correct 6 ms 5492 KB Output is correct
32 Correct 6 ms 5500 KB Output is correct
33 Correct 7 ms 5536 KB Output is correct
34 Correct 5 ms 5536 KB Output is correct
35 Correct 5 ms 5536 KB Output is correct
36 Correct 6 ms 5536 KB Output is correct
37 Correct 6 ms 5536 KB Output is correct
38 Correct 6 ms 5536 KB Output is correct
39 Correct 6 ms 5536 KB Output is correct
40 Correct 6 ms 5536 KB Output is correct
41 Correct 6 ms 5536 KB Output is correct
42 Correct 6 ms 5536 KB Output is correct
43 Correct 6 ms 5536 KB Output is correct
44 Correct 6 ms 5536 KB Output is correct
45 Correct 6 ms 5536 KB Output is correct
46 Correct 6 ms 5536 KB Output is correct
47 Correct 6 ms 5556 KB Output is correct
48 Correct 6 ms 5556 KB Output is correct
49 Correct 6 ms 5556 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 5112 KB Output is correct
2 Correct 6 ms 5120 KB Output is correct
3 Correct 6 ms 5120 KB Output is correct
4 Correct 5 ms 5120 KB Output is correct
5 Correct 6 ms 5208 KB Output is correct
6 Correct 6 ms 5244 KB Output is correct
7 Correct 6 ms 5244 KB Output is correct
8 Correct 6 ms 5244 KB Output is correct
9 Correct 6 ms 5244 KB Output is correct
10 Correct 6 ms 5244 KB Output is correct
11 Correct 6 ms 5308 KB Output is correct
12 Correct 6 ms 5308 KB Output is correct
13 Correct 6 ms 5404 KB Output is correct
14 Correct 6 ms 5404 KB Output is correct
15 Correct 6 ms 5404 KB Output is correct
16 Correct 6 ms 5404 KB Output is correct
17 Correct 6 ms 5404 KB Output is correct
18 Correct 6 ms 5404 KB Output is correct
19 Correct 6 ms 5404 KB Output is correct
20 Correct 6 ms 5404 KB Output is correct
21 Correct 6 ms 5404 KB Output is correct
22 Correct 6 ms 5404 KB Output is correct
23 Correct 6 ms 5432 KB Output is correct
24 Correct 7 ms 5432 KB Output is correct
25 Correct 6 ms 5432 KB Output is correct
26 Correct 7 ms 5472 KB Output is correct
27 Correct 6 ms 5476 KB Output is correct
28 Correct 6 ms 5480 KB Output is correct
29 Correct 6 ms 5480 KB Output is correct
30 Correct 6 ms 5480 KB Output is correct
31 Correct 6 ms 5492 KB Output is correct
32 Correct 6 ms 5500 KB Output is correct
33 Correct 7 ms 5536 KB Output is correct
34 Correct 5 ms 5536 KB Output is correct
35 Correct 5 ms 5536 KB Output is correct
36 Correct 6 ms 5536 KB Output is correct
37 Correct 6 ms 5536 KB Output is correct
38 Correct 6 ms 5536 KB Output is correct
39 Correct 6 ms 5536 KB Output is correct
40 Correct 6 ms 5536 KB Output is correct
41 Correct 6 ms 5536 KB Output is correct
42 Correct 6 ms 5536 KB Output is correct
43 Correct 6 ms 5536 KB Output is correct
44 Correct 6 ms 5536 KB Output is correct
45 Correct 6 ms 5536 KB Output is correct
46 Correct 6 ms 5536 KB Output is correct
47 Correct 6 ms 5556 KB Output is correct
48 Correct 6 ms 5556 KB Output is correct
49 Correct 6 ms 5556 KB Output is correct
50 Correct 9 ms 5696 KB Output is correct
51 Correct 9 ms 5700 KB Output is correct
52 Correct 9 ms 5704 KB Output is correct
53 Correct 10 ms 5708 KB Output is correct
54 Correct 7 ms 5708 KB Output is correct
55 Correct 11 ms 5844 KB Output is correct
56 Correct 11 ms 5848 KB Output is correct
57 Correct 11 ms 5848 KB Output is correct
58 Correct 6 ms 5848 KB Output is correct
59 Correct 6 ms 5848 KB Output is correct
60 Correct 6 ms 5848 KB Output is correct
61 Correct 9 ms 5848 KB Output is correct
62 Correct 7 ms 5848 KB Output is correct
63 Correct 6 ms 5848 KB Output is correct
64 Correct 6 ms 5848 KB Output is correct
65 Correct 8 ms 5848 KB Output is correct
66 Correct 6 ms 5848 KB Output is correct
67 Correct 6 ms 5848 KB Output is correct
68 Correct 6 ms 5848 KB Output is correct
69 Correct 6 ms 5848 KB Output is correct
70 Correct 7 ms 5848 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 5112 KB Output is correct
2 Correct 6 ms 5120 KB Output is correct
3 Correct 6 ms 5120 KB Output is correct
4 Correct 5 ms 5120 KB Output is correct
5 Correct 6 ms 5208 KB Output is correct
6 Correct 6 ms 5244 KB Output is correct
7 Correct 6 ms 5244 KB Output is correct
8 Correct 6 ms 5244 KB Output is correct
9 Correct 6 ms 5244 KB Output is correct
10 Correct 6 ms 5244 KB Output is correct
11 Correct 6 ms 5308 KB Output is correct
12 Correct 6 ms 5308 KB Output is correct
13 Correct 6 ms 5404 KB Output is correct
14 Correct 6 ms 5404 KB Output is correct
15 Correct 6 ms 5404 KB Output is correct
16 Correct 6 ms 5404 KB Output is correct
17 Correct 6 ms 5404 KB Output is correct
18 Correct 6 ms 5404 KB Output is correct
19 Correct 6 ms 5404 KB Output is correct
20 Correct 6 ms 5404 KB Output is correct
21 Correct 6 ms 5404 KB Output is correct
22 Correct 6 ms 5404 KB Output is correct
23 Correct 6 ms 5432 KB Output is correct
24 Correct 7 ms 5432 KB Output is correct
25 Correct 6 ms 5432 KB Output is correct
26 Correct 7 ms 5472 KB Output is correct
27 Correct 6 ms 5476 KB Output is correct
28 Correct 6 ms 5480 KB Output is correct
29 Correct 6 ms 5480 KB Output is correct
30 Correct 6 ms 5480 KB Output is correct
31 Correct 6 ms 5492 KB Output is correct
32 Correct 6 ms 5500 KB Output is correct
33 Correct 7 ms 5536 KB Output is correct
34 Correct 5 ms 5536 KB Output is correct
35 Correct 5 ms 5536 KB Output is correct
36 Correct 6 ms 5536 KB Output is correct
37 Correct 6 ms 5536 KB Output is correct
38 Correct 6 ms 5536 KB Output is correct
39 Correct 6 ms 5536 KB Output is correct
40 Correct 6 ms 5536 KB Output is correct
41 Correct 6 ms 5536 KB Output is correct
42 Correct 6 ms 5536 KB Output is correct
43 Correct 6 ms 5536 KB Output is correct
44 Correct 6 ms 5536 KB Output is correct
45 Correct 6 ms 5536 KB Output is correct
46 Correct 6 ms 5536 KB Output is correct
47 Correct 6 ms 5556 KB Output is correct
48 Correct 6 ms 5556 KB Output is correct
49 Correct 6 ms 5556 KB Output is correct
50 Correct 9 ms 5696 KB Output is correct
51 Correct 9 ms 5700 KB Output is correct
52 Correct 9 ms 5704 KB Output is correct
53 Correct 10 ms 5708 KB Output is correct
54 Correct 7 ms 5708 KB Output is correct
55 Correct 11 ms 5844 KB Output is correct
56 Correct 11 ms 5848 KB Output is correct
57 Correct 11 ms 5848 KB Output is correct
58 Correct 6 ms 5848 KB Output is correct
59 Correct 6 ms 5848 KB Output is correct
60 Correct 6 ms 5848 KB Output is correct
61 Correct 9 ms 5848 KB Output is correct
62 Correct 7 ms 5848 KB Output is correct
63 Correct 6 ms 5848 KB Output is correct
64 Correct 6 ms 5848 KB Output is correct
65 Correct 8 ms 5848 KB Output is correct
66 Correct 6 ms 5848 KB Output is correct
67 Correct 6 ms 5848 KB Output is correct
68 Correct 6 ms 5848 KB Output is correct
69 Correct 6 ms 5848 KB Output is correct
70 Correct 7 ms 5848 KB Output is correct
71 Correct 509 ms 24024 KB Output is correct
72 Correct 345 ms 24024 KB Output is correct
73 Correct 491 ms 24024 KB Output is correct
74 Correct 273 ms 24024 KB Output is correct
75 Correct 313 ms 24024 KB Output is correct
76 Correct 825 ms 30168 KB Output is correct
77 Correct 743 ms 30168 KB Output is correct
78 Correct 646 ms 30168 KB Output is correct
79 Correct 645 ms 30168 KB Output is correct
80 Correct 6 ms 30168 KB Output is correct
81 Correct 6 ms 30168 KB Output is correct
82 Correct 10 ms 30168 KB Output is correct
83 Correct 71 ms 30168 KB Output is correct
84 Correct 89 ms 30168 KB Output is correct
85 Correct 23 ms 30168 KB Output is correct
86 Correct 6 ms 30168 KB Output is correct
87 Correct 97 ms 30168 KB Output is correct
88 Correct 6 ms 30168 KB Output is correct
89 Correct 6 ms 30168 KB Output is correct
90 Correct 6 ms 30168 KB Output is correct
91 Correct 29 ms 30168 KB Output is correct
92 Correct 133 ms 30168 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 5112 KB Output is correct
2 Correct 6 ms 5120 KB Output is correct
3 Correct 6 ms 5120 KB Output is correct
4 Correct 5 ms 5120 KB Output is correct
5 Correct 6 ms 5208 KB Output is correct
6 Correct 6 ms 5244 KB Output is correct
7 Correct 6 ms 5244 KB Output is correct
8 Correct 6 ms 5244 KB Output is correct
9 Correct 6 ms 5244 KB Output is correct
10 Correct 6 ms 5244 KB Output is correct
11 Correct 6 ms 5308 KB Output is correct
12 Correct 6 ms 5308 KB Output is correct
13 Correct 6 ms 5404 KB Output is correct
14 Correct 6 ms 5404 KB Output is correct
15 Correct 6 ms 5404 KB Output is correct
16 Correct 6 ms 5404 KB Output is correct
17 Correct 6 ms 5404 KB Output is correct
18 Correct 6 ms 5404 KB Output is correct
19 Correct 6 ms 5404 KB Output is correct
20 Correct 6 ms 5404 KB Output is correct
21 Correct 6 ms 5404 KB Output is correct
22 Correct 6 ms 5404 KB Output is correct
23 Correct 6 ms 5432 KB Output is correct
24 Correct 7 ms 5432 KB Output is correct
25 Correct 6 ms 5432 KB Output is correct
26 Correct 7 ms 5472 KB Output is correct
27 Correct 6 ms 5476 KB Output is correct
28 Correct 6 ms 5480 KB Output is correct
29 Correct 6 ms 5480 KB Output is correct
30 Correct 6 ms 5480 KB Output is correct
31 Correct 6 ms 5492 KB Output is correct
32 Correct 6 ms 5500 KB Output is correct
33 Correct 7 ms 5536 KB Output is correct
34 Correct 5 ms 5536 KB Output is correct
35 Correct 5 ms 5536 KB Output is correct
36 Correct 6 ms 5536 KB Output is correct
37 Correct 6 ms 5536 KB Output is correct
38 Correct 6 ms 5536 KB Output is correct
39 Correct 6 ms 5536 KB Output is correct
40 Correct 6 ms 5536 KB Output is correct
41 Correct 6 ms 5536 KB Output is correct
42 Correct 6 ms 5536 KB Output is correct
43 Correct 6 ms 5536 KB Output is correct
44 Correct 6 ms 5536 KB Output is correct
45 Correct 6 ms 5536 KB Output is correct
46 Correct 6 ms 5536 KB Output is correct
47 Correct 6 ms 5556 KB Output is correct
48 Correct 6 ms 5556 KB Output is correct
49 Correct 6 ms 5556 KB Output is correct
50 Correct 9 ms 5696 KB Output is correct
51 Correct 9 ms 5700 KB Output is correct
52 Correct 9 ms 5704 KB Output is correct
53 Correct 10 ms 5708 KB Output is correct
54 Correct 7 ms 5708 KB Output is correct
55 Correct 11 ms 5844 KB Output is correct
56 Correct 11 ms 5848 KB Output is correct
57 Correct 11 ms 5848 KB Output is correct
58 Correct 6 ms 5848 KB Output is correct
59 Correct 6 ms 5848 KB Output is correct
60 Correct 6 ms 5848 KB Output is correct
61 Correct 9 ms 5848 KB Output is correct
62 Correct 7 ms 5848 KB Output is correct
63 Correct 6 ms 5848 KB Output is correct
64 Correct 6 ms 5848 KB Output is correct
65 Correct 8 ms 5848 KB Output is correct
66 Correct 6 ms 5848 KB Output is correct
67 Correct 6 ms 5848 KB Output is correct
68 Correct 6 ms 5848 KB Output is correct
69 Correct 6 ms 5848 KB Output is correct
70 Correct 7 ms 5848 KB Output is correct
71 Correct 509 ms 24024 KB Output is correct
72 Correct 345 ms 24024 KB Output is correct
73 Correct 491 ms 24024 KB Output is correct
74 Correct 273 ms 24024 KB Output is correct
75 Correct 313 ms 24024 KB Output is correct
76 Correct 825 ms 30168 KB Output is correct
77 Correct 743 ms 30168 KB Output is correct
78 Correct 646 ms 30168 KB Output is correct
79 Correct 645 ms 30168 KB Output is correct
80 Correct 6 ms 30168 KB Output is correct
81 Correct 6 ms 30168 KB Output is correct
82 Correct 10 ms 30168 KB Output is correct
83 Correct 71 ms 30168 KB Output is correct
84 Correct 89 ms 30168 KB Output is correct
85 Correct 23 ms 30168 KB Output is correct
86 Correct 6 ms 30168 KB Output is correct
87 Correct 97 ms 30168 KB Output is correct
88 Correct 6 ms 30168 KB Output is correct
89 Correct 6 ms 30168 KB Output is correct
90 Correct 6 ms 30168 KB Output is correct
91 Correct 29 ms 30168 KB Output is correct
92 Correct 133 ms 30168 KB Output is correct
93 Correct 3015 ms 82700 KB Output is correct
94 Correct 1719 ms 82700 KB Output is correct
95 Correct 1919 ms 82700 KB Output is correct
96 Correct 1710 ms 82700 KB Output is correct
97 Correct 1532 ms 82700 KB Output is correct
98 Correct 3406 ms 90772 KB Output is correct
99 Correct 3694 ms 92104 KB Output is correct
100 Correct 3362 ms 92104 KB Output is correct
101 Correct 3199 ms 92104 KB Output is correct
102 Correct 2871 ms 92104 KB Output is correct
103 Correct 2239 ms 92104 KB Output is correct
104 Correct 6 ms 92104 KB Output is correct
105 Correct 6 ms 92104 KB Output is correct
106 Correct 13 ms 92104 KB Output is correct
107 Correct 232 ms 92104 KB Output is correct
108 Correct 585 ms 92104 KB Output is correct
109 Correct 51 ms 92104 KB Output is correct
110 Correct 6 ms 92104 KB Output is correct
111 Correct 290 ms 92104 KB Output is correct
112 Correct 7 ms 92104 KB Output is correct
113 Correct 6 ms 92104 KB Output is correct
114 Correct 12 ms 92104 KB Output is correct
115 Correct 6 ms 92104 KB Output is correct
116 Correct 23 ms 92104 KB Output is correct
117 Correct 586 ms 92104 KB Output is correct