Submission #424758

# Submission time Handle Problem Language Result Execution time Memory
424758 2021-06-12T09:40:59 Z Rouge_Hugo Toys (CEOI18_toy) C++14
59 / 100
360 ms 262148 KB
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pb push_back
using namespace std;
int n;const int N=100090;
int y[N];
vector<int>vis[N];
vector<int>v,vv;
void d(int sum,int p)
{
    if(sum>n)return ;
    if(p>n)return ;
    if(vis[p][sum])return;
    vis[p][sum]=1;
    if(p==1)
    {
        y[sum]=1;return;
    }
    for(auto it:v)
    {
        if(p%it)continue;
        d(sum+it-1,p/it);
    }
}
int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>n;
    for(int i=2;i<=n;i++)
    {
        if(n%i)continue;
        v.pb(i);
        for(int j=0;j<=n+1;j++)vis[i].pb(0);
    }
    for(int j=0;j<=n+1;j++)vis[1].pb(0);
    d(0,n);
    for(int i=0;i<=n;i++)
    {
        if(y[i])vv.pb(i);
    }
    cout<<vv.size()<<endl;
    for(auto it:vv)cout<<it<<" ";
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2636 KB Output is correct
2 Correct 2 ms 2636 KB Output is correct
3 Correct 2 ms 2636 KB Output is correct
4 Correct 2 ms 2636 KB Output is correct
5 Correct 2 ms 2636 KB Output is correct
6 Correct 2 ms 2636 KB Output is correct
7 Correct 2 ms 2636 KB Output is correct
8 Correct 2 ms 2636 KB Output is correct
9 Correct 2 ms 2636 KB Output is correct
10 Correct 2 ms 2636 KB Output is correct
11 Correct 2 ms 2636 KB Output is correct
12 Correct 2 ms 2636 KB Output is correct
13 Correct 2 ms 2636 KB Output is correct
14 Correct 2 ms 2636 KB Output is correct
15 Correct 2 ms 2636 KB Output is correct
16 Correct 2 ms 2636 KB Output is correct
17 Correct 2 ms 2636 KB Output is correct
18 Correct 2 ms 2636 KB Output is correct
19 Correct 2 ms 2636 KB Output is correct
20 Correct 3 ms 2636 KB Output is correct
21 Correct 3 ms 2636 KB Output is correct
22 Correct 2 ms 2636 KB Output is correct
23 Correct 2 ms 2636 KB Output is correct
24 Correct 2 ms 2636 KB Output is correct
25 Correct 2 ms 2636 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2636 KB Output is correct
2 Correct 2 ms 2636 KB Output is correct
3 Correct 2 ms 2636 KB Output is correct
4 Correct 2 ms 2636 KB Output is correct
5 Correct 2 ms 2636 KB Output is correct
6 Correct 2 ms 2636 KB Output is correct
7 Correct 2 ms 2636 KB Output is correct
8 Correct 2 ms 2636 KB Output is correct
9 Correct 2 ms 2636 KB Output is correct
10 Correct 2 ms 2636 KB Output is correct
11 Correct 2 ms 2636 KB Output is correct
12 Correct 2 ms 2636 KB Output is correct
13 Correct 2 ms 2636 KB Output is correct
14 Correct 2 ms 2636 KB Output is correct
15 Correct 2 ms 2636 KB Output is correct
16 Correct 2 ms 2636 KB Output is correct
17 Correct 2 ms 2636 KB Output is correct
18 Correct 2 ms 2636 KB Output is correct
19 Correct 2 ms 2636 KB Output is correct
20 Correct 3 ms 2636 KB Output is correct
21 Correct 3 ms 2636 KB Output is correct
22 Correct 2 ms 2636 KB Output is correct
23 Correct 2 ms 2636 KB Output is correct
24 Correct 2 ms 2636 KB Output is correct
25 Correct 2 ms 2636 KB Output is correct
26 Correct 6 ms 4684 KB Output is correct
27 Correct 6 ms 4144 KB Output is correct
28 Correct 3 ms 3404 KB Output is correct
29 Correct 3 ms 2892 KB Output is correct
30 Correct 2 ms 2892 KB Output is correct
31 Correct 7 ms 5008 KB Output is correct
32 Correct 6 ms 4428 KB Output is correct
33 Correct 5 ms 4428 KB Output is correct
34 Correct 2 ms 2764 KB Output is correct
35 Correct 2 ms 2892 KB Output is correct
36 Correct 3 ms 3232 KB Output is correct
37 Correct 4 ms 3788 KB Output is correct
38 Correct 4 ms 3788 KB Output is correct
39 Correct 3 ms 3276 KB Output is correct
40 Correct 6 ms 4684 KB Output is correct
41 Correct 2 ms 2764 KB Output is correct
42 Correct 2 ms 2764 KB Output is correct
43 Correct 4 ms 3660 KB Output is correct
44 Correct 2 ms 2892 KB Output is correct
45 Correct 5 ms 4316 KB Output is correct
46 Correct 3 ms 3276 KB Output is correct
47 Correct 5 ms 4300 KB Output is correct
48 Correct 2 ms 3020 KB Output is correct
49 Correct 4 ms 4172 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2636 KB Output is correct
2 Correct 2 ms 2636 KB Output is correct
3 Correct 2 ms 2636 KB Output is correct
4 Correct 2 ms 2636 KB Output is correct
5 Correct 2 ms 2636 KB Output is correct
6 Correct 2 ms 2636 KB Output is correct
7 Correct 2 ms 2636 KB Output is correct
8 Correct 2 ms 2636 KB Output is correct
9 Correct 2 ms 2636 KB Output is correct
10 Correct 2 ms 2636 KB Output is correct
11 Correct 2 ms 2636 KB Output is correct
12 Correct 2 ms 2636 KB Output is correct
13 Correct 2 ms 2636 KB Output is correct
14 Correct 2 ms 2636 KB Output is correct
15 Correct 2 ms 2636 KB Output is correct
16 Correct 2 ms 2636 KB Output is correct
17 Correct 2 ms 2636 KB Output is correct
18 Correct 2 ms 2636 KB Output is correct
19 Correct 2 ms 2636 KB Output is correct
20 Correct 3 ms 2636 KB Output is correct
21 Correct 3 ms 2636 KB Output is correct
22 Correct 2 ms 2636 KB Output is correct
23 Correct 2 ms 2636 KB Output is correct
24 Correct 2 ms 2636 KB Output is correct
25 Correct 2 ms 2636 KB Output is correct
26 Correct 6 ms 4684 KB Output is correct
27 Correct 6 ms 4144 KB Output is correct
28 Correct 3 ms 3404 KB Output is correct
29 Correct 3 ms 2892 KB Output is correct
30 Correct 2 ms 2892 KB Output is correct
31 Correct 7 ms 5008 KB Output is correct
32 Correct 6 ms 4428 KB Output is correct
33 Correct 5 ms 4428 KB Output is correct
34 Correct 2 ms 2764 KB Output is correct
35 Correct 2 ms 2892 KB Output is correct
36 Correct 3 ms 3232 KB Output is correct
37 Correct 4 ms 3788 KB Output is correct
38 Correct 4 ms 3788 KB Output is correct
39 Correct 3 ms 3276 KB Output is correct
40 Correct 6 ms 4684 KB Output is correct
41 Correct 2 ms 2764 KB Output is correct
42 Correct 2 ms 2764 KB Output is correct
43 Correct 4 ms 3660 KB Output is correct
44 Correct 2 ms 2892 KB Output is correct
45 Correct 5 ms 4316 KB Output is correct
46 Correct 3 ms 3276 KB Output is correct
47 Correct 5 ms 4300 KB Output is correct
48 Correct 2 ms 3020 KB Output is correct
49 Correct 4 ms 4172 KB Output is correct
50 Correct 99 ms 45088 KB Output is correct
51 Correct 60 ms 29212 KB Output is correct
52 Correct 53 ms 24488 KB Output is correct
53 Correct 42 ms 20920 KB Output is correct
54 Correct 25 ms 13636 KB Output is correct
55 Correct 101 ms 46068 KB Output is correct
56 Correct 84 ms 37320 KB Output is correct
57 Correct 88 ms 38684 KB Output is correct
58 Correct 5 ms 3788 KB Output is correct
59 Correct 6 ms 4564 KB Output is correct
60 Correct 13 ms 7560 KB Output is correct
61 Correct 49 ms 23668 KB Output is correct
62 Correct 16 ms 9760 KB Output is correct
63 Correct 33 ms 17172 KB Output is correct
64 Correct 14 ms 7672 KB Output is correct
65 Correct 62 ms 29624 KB Output is correct
66 Correct 6 ms 4564 KB Output is correct
67 Correct 8 ms 5376 KB Output is correct
68 Correct 23 ms 12412 KB Output is correct
69 Correct 45 ms 21884 KB Output is correct
70 Correct 79 ms 37072 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2636 KB Output is correct
2 Correct 2 ms 2636 KB Output is correct
3 Correct 2 ms 2636 KB Output is correct
4 Correct 2 ms 2636 KB Output is correct
5 Correct 2 ms 2636 KB Output is correct
6 Correct 2 ms 2636 KB Output is correct
7 Correct 2 ms 2636 KB Output is correct
8 Correct 2 ms 2636 KB Output is correct
9 Correct 2 ms 2636 KB Output is correct
10 Correct 2 ms 2636 KB Output is correct
11 Correct 2 ms 2636 KB Output is correct
12 Correct 2 ms 2636 KB Output is correct
13 Correct 2 ms 2636 KB Output is correct
14 Correct 2 ms 2636 KB Output is correct
15 Correct 2 ms 2636 KB Output is correct
16 Correct 2 ms 2636 KB Output is correct
17 Correct 2 ms 2636 KB Output is correct
18 Correct 2 ms 2636 KB Output is correct
19 Correct 2 ms 2636 KB Output is correct
20 Correct 3 ms 2636 KB Output is correct
21 Correct 3 ms 2636 KB Output is correct
22 Correct 2 ms 2636 KB Output is correct
23 Correct 2 ms 2636 KB Output is correct
24 Correct 2 ms 2636 KB Output is correct
25 Correct 2 ms 2636 KB Output is correct
26 Correct 6 ms 4684 KB Output is correct
27 Correct 6 ms 4144 KB Output is correct
28 Correct 3 ms 3404 KB Output is correct
29 Correct 3 ms 2892 KB Output is correct
30 Correct 2 ms 2892 KB Output is correct
31 Correct 7 ms 5008 KB Output is correct
32 Correct 6 ms 4428 KB Output is correct
33 Correct 5 ms 4428 KB Output is correct
34 Correct 2 ms 2764 KB Output is correct
35 Correct 2 ms 2892 KB Output is correct
36 Correct 3 ms 3232 KB Output is correct
37 Correct 4 ms 3788 KB Output is correct
38 Correct 4 ms 3788 KB Output is correct
39 Correct 3 ms 3276 KB Output is correct
40 Correct 6 ms 4684 KB Output is correct
41 Correct 2 ms 2764 KB Output is correct
42 Correct 2 ms 2764 KB Output is correct
43 Correct 4 ms 3660 KB Output is correct
44 Correct 2 ms 2892 KB Output is correct
45 Correct 5 ms 4316 KB Output is correct
46 Correct 3 ms 3276 KB Output is correct
47 Correct 5 ms 4300 KB Output is correct
48 Correct 2 ms 3020 KB Output is correct
49 Correct 4 ms 4172 KB Output is correct
50 Correct 99 ms 45088 KB Output is correct
51 Correct 60 ms 29212 KB Output is correct
52 Correct 53 ms 24488 KB Output is correct
53 Correct 42 ms 20920 KB Output is correct
54 Correct 25 ms 13636 KB Output is correct
55 Correct 101 ms 46068 KB Output is correct
56 Correct 84 ms 37320 KB Output is correct
57 Correct 88 ms 38684 KB Output is correct
58 Correct 5 ms 3788 KB Output is correct
59 Correct 6 ms 4564 KB Output is correct
60 Correct 13 ms 7560 KB Output is correct
61 Correct 49 ms 23668 KB Output is correct
62 Correct 16 ms 9760 KB Output is correct
63 Correct 33 ms 17172 KB Output is correct
64 Correct 14 ms 7672 KB Output is correct
65 Correct 62 ms 29624 KB Output is correct
66 Correct 6 ms 4564 KB Output is correct
67 Correct 8 ms 5376 KB Output is correct
68 Correct 23 ms 12412 KB Output is correct
69 Correct 45 ms 21884 KB Output is correct
70 Correct 79 ms 37072 KB Output is correct
71 Runtime error 360 ms 262148 KB Execution killed with signal 9
72 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2636 KB Output is correct
2 Correct 2 ms 2636 KB Output is correct
3 Correct 2 ms 2636 KB Output is correct
4 Correct 2 ms 2636 KB Output is correct
5 Correct 2 ms 2636 KB Output is correct
6 Correct 2 ms 2636 KB Output is correct
7 Correct 2 ms 2636 KB Output is correct
8 Correct 2 ms 2636 KB Output is correct
9 Correct 2 ms 2636 KB Output is correct
10 Correct 2 ms 2636 KB Output is correct
11 Correct 2 ms 2636 KB Output is correct
12 Correct 2 ms 2636 KB Output is correct
13 Correct 2 ms 2636 KB Output is correct
14 Correct 2 ms 2636 KB Output is correct
15 Correct 2 ms 2636 KB Output is correct
16 Correct 2 ms 2636 KB Output is correct
17 Correct 2 ms 2636 KB Output is correct
18 Correct 2 ms 2636 KB Output is correct
19 Correct 2 ms 2636 KB Output is correct
20 Correct 3 ms 2636 KB Output is correct
21 Correct 3 ms 2636 KB Output is correct
22 Correct 2 ms 2636 KB Output is correct
23 Correct 2 ms 2636 KB Output is correct
24 Correct 2 ms 2636 KB Output is correct
25 Correct 2 ms 2636 KB Output is correct
26 Correct 6 ms 4684 KB Output is correct
27 Correct 6 ms 4144 KB Output is correct
28 Correct 3 ms 3404 KB Output is correct
29 Correct 3 ms 2892 KB Output is correct
30 Correct 2 ms 2892 KB Output is correct
31 Correct 7 ms 5008 KB Output is correct
32 Correct 6 ms 4428 KB Output is correct
33 Correct 5 ms 4428 KB Output is correct
34 Correct 2 ms 2764 KB Output is correct
35 Correct 2 ms 2892 KB Output is correct
36 Correct 3 ms 3232 KB Output is correct
37 Correct 4 ms 3788 KB Output is correct
38 Correct 4 ms 3788 KB Output is correct
39 Correct 3 ms 3276 KB Output is correct
40 Correct 6 ms 4684 KB Output is correct
41 Correct 2 ms 2764 KB Output is correct
42 Correct 2 ms 2764 KB Output is correct
43 Correct 4 ms 3660 KB Output is correct
44 Correct 2 ms 2892 KB Output is correct
45 Correct 5 ms 4316 KB Output is correct
46 Correct 3 ms 3276 KB Output is correct
47 Correct 5 ms 4300 KB Output is correct
48 Correct 2 ms 3020 KB Output is correct
49 Correct 4 ms 4172 KB Output is correct
50 Correct 99 ms 45088 KB Output is correct
51 Correct 60 ms 29212 KB Output is correct
52 Correct 53 ms 24488 KB Output is correct
53 Correct 42 ms 20920 KB Output is correct
54 Correct 25 ms 13636 KB Output is correct
55 Correct 101 ms 46068 KB Output is correct
56 Correct 84 ms 37320 KB Output is correct
57 Correct 88 ms 38684 KB Output is correct
58 Correct 5 ms 3788 KB Output is correct
59 Correct 6 ms 4564 KB Output is correct
60 Correct 13 ms 7560 KB Output is correct
61 Correct 49 ms 23668 KB Output is correct
62 Correct 16 ms 9760 KB Output is correct
63 Correct 33 ms 17172 KB Output is correct
64 Correct 14 ms 7672 KB Output is correct
65 Correct 62 ms 29624 KB Output is correct
66 Correct 6 ms 4564 KB Output is correct
67 Correct 8 ms 5376 KB Output is correct
68 Correct 23 ms 12412 KB Output is correct
69 Correct 45 ms 21884 KB Output is correct
70 Correct 79 ms 37072 KB Output is correct
71 Runtime error 360 ms 262148 KB Execution killed with signal 9
72 Halted 0 ms 0 KB -