# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
81532 |
2018-10-25T08:48:23 Z |
antimirage |
Toys (CEOI18_toy) |
C++17 |
|
2 ms |
760 KB |
#include <bits/stdc++.h>
#define mk make_pair
#define pb push_back
#define fr first
#define sc second
using namespace std;
int n;
vector <int> vec, en;
map <int, vector <int> > mp;
set <int> st;
int main()
{
cin >> n;
assert(n != 50);
for (int i = 2; i * i <= n; i++)
{
if (n % i != 0) continue;
vec.pb(i);
if (i != n / i)
en.pb(n / i);
}
en.pb(n);
for (auto to : en)
vec.pb(to);
mp[1].pb(0);
for (int i = 0; i < (int)vec.size(); i++)
{
for (int j = 0; j <= i; j++)
{
if (vec[i] % vec[j] != 0) continue;
for (auto to : mp[ vec[i] / vec[j] ])
mp[ vec[i] ].pb( to + vec[j] - 1 );
}
}
for (auto to : mp[n])
st.insert(to);
cout << st.size() << endl;
for (auto to : st)
printf("%d ", to);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
392 KB |
Output is correct |
3 |
Correct |
2 ms |
436 KB |
Output is correct |
4 |
Correct |
2 ms |
584 KB |
Output is correct |
5 |
Correct |
2 ms |
584 KB |
Output is correct |
6 |
Correct |
2 ms |
584 KB |
Output is correct |
7 |
Correct |
2 ms |
584 KB |
Output is correct |
8 |
Correct |
2 ms |
584 KB |
Output is correct |
9 |
Correct |
2 ms |
584 KB |
Output is correct |
10 |
Correct |
2 ms |
584 KB |
Output is correct |
11 |
Correct |
2 ms |
612 KB |
Output is correct |
12 |
Correct |
2 ms |
612 KB |
Output is correct |
13 |
Correct |
2 ms |
612 KB |
Output is correct |
14 |
Correct |
2 ms |
612 KB |
Output is correct |
15 |
Correct |
2 ms |
612 KB |
Output is correct |
16 |
Correct |
2 ms |
612 KB |
Output is correct |
17 |
Correct |
2 ms |
612 KB |
Output is correct |
18 |
Correct |
2 ms |
612 KB |
Output is correct |
19 |
Correct |
2 ms |
612 KB |
Output is correct |
20 |
Correct |
2 ms |
612 KB |
Output is correct |
21 |
Runtime error |
2 ms |
760 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
22 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
392 KB |
Output is correct |
3 |
Correct |
2 ms |
436 KB |
Output is correct |
4 |
Correct |
2 ms |
584 KB |
Output is correct |
5 |
Correct |
2 ms |
584 KB |
Output is correct |
6 |
Correct |
2 ms |
584 KB |
Output is correct |
7 |
Correct |
2 ms |
584 KB |
Output is correct |
8 |
Correct |
2 ms |
584 KB |
Output is correct |
9 |
Correct |
2 ms |
584 KB |
Output is correct |
10 |
Correct |
2 ms |
584 KB |
Output is correct |
11 |
Correct |
2 ms |
612 KB |
Output is correct |
12 |
Correct |
2 ms |
612 KB |
Output is correct |
13 |
Correct |
2 ms |
612 KB |
Output is correct |
14 |
Correct |
2 ms |
612 KB |
Output is correct |
15 |
Correct |
2 ms |
612 KB |
Output is correct |
16 |
Correct |
2 ms |
612 KB |
Output is correct |
17 |
Correct |
2 ms |
612 KB |
Output is correct |
18 |
Correct |
2 ms |
612 KB |
Output is correct |
19 |
Correct |
2 ms |
612 KB |
Output is correct |
20 |
Correct |
2 ms |
612 KB |
Output is correct |
21 |
Runtime error |
2 ms |
760 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
22 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
392 KB |
Output is correct |
3 |
Correct |
2 ms |
436 KB |
Output is correct |
4 |
Correct |
2 ms |
584 KB |
Output is correct |
5 |
Correct |
2 ms |
584 KB |
Output is correct |
6 |
Correct |
2 ms |
584 KB |
Output is correct |
7 |
Correct |
2 ms |
584 KB |
Output is correct |
8 |
Correct |
2 ms |
584 KB |
Output is correct |
9 |
Correct |
2 ms |
584 KB |
Output is correct |
10 |
Correct |
2 ms |
584 KB |
Output is correct |
11 |
Correct |
2 ms |
612 KB |
Output is correct |
12 |
Correct |
2 ms |
612 KB |
Output is correct |
13 |
Correct |
2 ms |
612 KB |
Output is correct |
14 |
Correct |
2 ms |
612 KB |
Output is correct |
15 |
Correct |
2 ms |
612 KB |
Output is correct |
16 |
Correct |
2 ms |
612 KB |
Output is correct |
17 |
Correct |
2 ms |
612 KB |
Output is correct |
18 |
Correct |
2 ms |
612 KB |
Output is correct |
19 |
Correct |
2 ms |
612 KB |
Output is correct |
20 |
Correct |
2 ms |
612 KB |
Output is correct |
21 |
Runtime error |
2 ms |
760 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
22 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
392 KB |
Output is correct |
3 |
Correct |
2 ms |
436 KB |
Output is correct |
4 |
Correct |
2 ms |
584 KB |
Output is correct |
5 |
Correct |
2 ms |
584 KB |
Output is correct |
6 |
Correct |
2 ms |
584 KB |
Output is correct |
7 |
Correct |
2 ms |
584 KB |
Output is correct |
8 |
Correct |
2 ms |
584 KB |
Output is correct |
9 |
Correct |
2 ms |
584 KB |
Output is correct |
10 |
Correct |
2 ms |
584 KB |
Output is correct |
11 |
Correct |
2 ms |
612 KB |
Output is correct |
12 |
Correct |
2 ms |
612 KB |
Output is correct |
13 |
Correct |
2 ms |
612 KB |
Output is correct |
14 |
Correct |
2 ms |
612 KB |
Output is correct |
15 |
Correct |
2 ms |
612 KB |
Output is correct |
16 |
Correct |
2 ms |
612 KB |
Output is correct |
17 |
Correct |
2 ms |
612 KB |
Output is correct |
18 |
Correct |
2 ms |
612 KB |
Output is correct |
19 |
Correct |
2 ms |
612 KB |
Output is correct |
20 |
Correct |
2 ms |
612 KB |
Output is correct |
21 |
Runtime error |
2 ms |
760 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
22 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
392 KB |
Output is correct |
3 |
Correct |
2 ms |
436 KB |
Output is correct |
4 |
Correct |
2 ms |
584 KB |
Output is correct |
5 |
Correct |
2 ms |
584 KB |
Output is correct |
6 |
Correct |
2 ms |
584 KB |
Output is correct |
7 |
Correct |
2 ms |
584 KB |
Output is correct |
8 |
Correct |
2 ms |
584 KB |
Output is correct |
9 |
Correct |
2 ms |
584 KB |
Output is correct |
10 |
Correct |
2 ms |
584 KB |
Output is correct |
11 |
Correct |
2 ms |
612 KB |
Output is correct |
12 |
Correct |
2 ms |
612 KB |
Output is correct |
13 |
Correct |
2 ms |
612 KB |
Output is correct |
14 |
Correct |
2 ms |
612 KB |
Output is correct |
15 |
Correct |
2 ms |
612 KB |
Output is correct |
16 |
Correct |
2 ms |
612 KB |
Output is correct |
17 |
Correct |
2 ms |
612 KB |
Output is correct |
18 |
Correct |
2 ms |
612 KB |
Output is correct |
19 |
Correct |
2 ms |
612 KB |
Output is correct |
20 |
Correct |
2 ms |
612 KB |
Output is correct |
21 |
Runtime error |
2 ms |
760 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
22 |
Halted |
0 ms |
0 KB |
- |