# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
942786 | 2024-03-11T04:42:36 Z | vjudge1 | Toys (CEOI18_toy) | C++17 | 5000 ms | 1676 KB |
#include <bits/stdc++.h> #define int long long #define ff first #define ss second #define pb push_back #define all(x) x.begin(),x.end() using namespace std; signed main(){ ios_base::sync_with_stdio(); cin.tie(0);cout.tie(0); int n; cin>>n; vector <int> v; for(int i=2;i*i<=n;i++){ while(n%i==0){ v.pb(i); n/=i; } } if(n>1)v.pb(n); set <int> res; do{ vector <int> sum[v.size()+1]; sum[0].pb(0); for(int i=0;i<v.size();i++){ int x=1; for(int j=i;j>=0;j--){ x*=v[j]; for(auto val : sum[j])sum[i+1].pb(x-1+val); } } for(auto x : sum[v.size()]){ res.insert(x); } }while(next_permutation(all(v))); cout<<res.size()<<"\n"; for(auto x : res)cout<<x<<" "; cout<<"\n"; } /* */
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 600 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 600 KB | Output is correct |
9 | Correct | 0 ms | 348 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 1 ms | 348 KB | Output is correct |
12 | Correct | 0 ms | 348 KB | Output is correct |
13 | Correct | 0 ms | 348 KB | Output is correct |
14 | Correct | 0 ms | 348 KB | Output is correct |
15 | Correct | 0 ms | 600 KB | Output is correct |
16 | Correct | 0 ms | 348 KB | Output is correct |
17 | Correct | 0 ms | 348 KB | Output is correct |
18 | Correct | 0 ms | 348 KB | Output is correct |
19 | Correct | 0 ms | 348 KB | Output is correct |
20 | Correct | 0 ms | 348 KB | Output is correct |
21 | Correct | 0 ms | 348 KB | Output is correct |
22 | Correct | 1 ms | 348 KB | Output is correct |
23 | Correct | 0 ms | 348 KB | Output is correct |
24 | Correct | 0 ms | 348 KB | Output is correct |
25 | Correct | 0 ms | 344 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 600 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 600 KB | Output is correct |
9 | Correct | 0 ms | 348 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 1 ms | 348 KB | Output is correct |
12 | Correct | 0 ms | 348 KB | Output is correct |
13 | Correct | 0 ms | 348 KB | Output is correct |
14 | Correct | 0 ms | 348 KB | Output is correct |
15 | Correct | 0 ms | 600 KB | Output is correct |
16 | Correct | 0 ms | 348 KB | Output is correct |
17 | Correct | 0 ms | 348 KB | Output is correct |
18 | Correct | 0 ms | 348 KB | Output is correct |
19 | Correct | 0 ms | 348 KB | Output is correct |
20 | Correct | 0 ms | 348 KB | Output is correct |
21 | Correct | 0 ms | 348 KB | Output is correct |
22 | Correct | 1 ms | 348 KB | Output is correct |
23 | Correct | 0 ms | 348 KB | Output is correct |
24 | Correct | 0 ms | 348 KB | Output is correct |
25 | Correct | 0 ms | 344 KB | Output is correct |
26 | Correct | 4 ms | 348 KB | Output is correct |
27 | Correct | 3 ms | 344 KB | Output is correct |
28 | Correct | 1 ms | 348 KB | Output is correct |
29 | Correct | 1 ms | 388 KB | Output is correct |
30 | Correct | 1 ms | 348 KB | Output is correct |
31 | Correct | 9 ms | 348 KB | Output is correct |
32 | Correct | 5 ms | 504 KB | Output is correct |
33 | Correct | 4 ms | 348 KB | Output is correct |
34 | Correct | 1 ms | 344 KB | Output is correct |
35 | Correct | 1 ms | 344 KB | Output is correct |
36 | Correct | 1 ms | 348 KB | Output is correct |
37 | Correct | 3 ms | 348 KB | Output is correct |
38 | Correct | 1 ms | 352 KB | Output is correct |
39 | Correct | 0 ms | 352 KB | Output is correct |
40 | Correct | 2 ms | 352 KB | Output is correct |
41 | Correct | 1 ms | 544 KB | Output is correct |
42 | Correct | 0 ms | 348 KB | Output is correct |
43 | Correct | 1 ms | 348 KB | Output is correct |
44 | Correct | 0 ms | 348 KB | Output is correct |
45 | Correct | 1 ms | 348 KB | Output is correct |
46 | Correct | 0 ms | 348 KB | Output is correct |
47 | Correct | 1 ms | 348 KB | Output is correct |
48 | Correct | 1 ms | 348 KB | Output is correct |
49 | Correct | 1 ms | 500 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 600 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 600 KB | Output is correct |
9 | Correct | 0 ms | 348 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 1 ms | 348 KB | Output is correct |
12 | Correct | 0 ms | 348 KB | Output is correct |
13 | Correct | 0 ms | 348 KB | Output is correct |
14 | Correct | 0 ms | 348 KB | Output is correct |
15 | Correct | 0 ms | 600 KB | Output is correct |
16 | Correct | 0 ms | 348 KB | Output is correct |
17 | Correct | 0 ms | 348 KB | Output is correct |
18 | Correct | 0 ms | 348 KB | Output is correct |
19 | Correct | 0 ms | 348 KB | Output is correct |
20 | Correct | 0 ms | 348 KB | Output is correct |
21 | Correct | 0 ms | 348 KB | Output is correct |
22 | Correct | 1 ms | 348 KB | Output is correct |
23 | Correct | 0 ms | 348 KB | Output is correct |
24 | Correct | 0 ms | 348 KB | Output is correct |
25 | Correct | 0 ms | 344 KB | Output is correct |
26 | Correct | 4 ms | 348 KB | Output is correct |
27 | Correct | 3 ms | 344 KB | Output is correct |
28 | Correct | 1 ms | 348 KB | Output is correct |
29 | Correct | 1 ms | 388 KB | Output is correct |
30 | Correct | 1 ms | 348 KB | Output is correct |
31 | Correct | 9 ms | 348 KB | Output is correct |
32 | Correct | 5 ms | 504 KB | Output is correct |
33 | Correct | 4 ms | 348 KB | Output is correct |
34 | Correct | 1 ms | 344 KB | Output is correct |
35 | Correct | 1 ms | 344 KB | Output is correct |
36 | Correct | 1 ms | 348 KB | Output is correct |
37 | Correct | 3 ms | 348 KB | Output is correct |
38 | Correct | 1 ms | 352 KB | Output is correct |
39 | Correct | 0 ms | 352 KB | Output is correct |
40 | Correct | 2 ms | 352 KB | Output is correct |
41 | Correct | 1 ms | 544 KB | Output is correct |
42 | Correct | 0 ms | 348 KB | Output is correct |
43 | Correct | 1 ms | 348 KB | Output is correct |
44 | Correct | 0 ms | 348 KB | Output is correct |
45 | Correct | 1 ms | 348 KB | Output is correct |
46 | Correct | 0 ms | 348 KB | Output is correct |
47 | Correct | 1 ms | 348 KB | Output is correct |
48 | Correct | 1 ms | 348 KB | Output is correct |
49 | Correct | 1 ms | 500 KB | Output is correct |
50 | Correct | 70 ms | 596 KB | Output is correct |
51 | Correct | 46 ms | 452 KB | Output is correct |
52 | Correct | 82 ms | 344 KB | Output is correct |
53 | Correct | 68 ms | 344 KB | Output is correct |
54 | Correct | 12 ms | 344 KB | Output is correct |
55 | Correct | 319 ms | 476 KB | Output is correct |
56 | Correct | 258 ms | 344 KB | Output is correct |
57 | Correct | 148 ms | 456 KB | Output is correct |
58 | Correct | 0 ms | 344 KB | Output is correct |
59 | Correct | 0 ms | 348 KB | Output is correct |
60 | Correct | 1 ms | 984 KB | Output is correct |
61 | Correct | 142 ms | 544 KB | Output is correct |
62 | Correct | 10 ms | 344 KB | Output is correct |
63 | Correct | 3 ms | 348 KB | Output is correct |
64 | Correct | 0 ms | 348 KB | Output is correct |
65 | Correct | 35 ms | 468 KB | Output is correct |
66 | Correct | 0 ms | 344 KB | Output is correct |
67 | Correct | 0 ms | 348 KB | Output is correct |
68 | Correct | 0 ms | 348 KB | Output is correct |
69 | Correct | 1 ms | 348 KB | Output is correct |
70 | Correct | 6 ms | 348 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 600 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 600 KB | Output is correct |
9 | Correct | 0 ms | 348 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 1 ms | 348 KB | Output is correct |
12 | Correct | 0 ms | 348 KB | Output is correct |
13 | Correct | 0 ms | 348 KB | Output is correct |
14 | Correct | 0 ms | 348 KB | Output is correct |
15 | Correct | 0 ms | 600 KB | Output is correct |
16 | Correct | 0 ms | 348 KB | Output is correct |
17 | Correct | 0 ms | 348 KB | Output is correct |
18 | Correct | 0 ms | 348 KB | Output is correct |
19 | Correct | 0 ms | 348 KB | Output is correct |
20 | Correct | 0 ms | 348 KB | Output is correct |
21 | Correct | 0 ms | 348 KB | Output is correct |
22 | Correct | 1 ms | 348 KB | Output is correct |
23 | Correct | 0 ms | 348 KB | Output is correct |
24 | Correct | 0 ms | 348 KB | Output is correct |
25 | Correct | 0 ms | 344 KB | Output is correct |
26 | Correct | 4 ms | 348 KB | Output is correct |
27 | Correct | 3 ms | 344 KB | Output is correct |
28 | Correct | 1 ms | 348 KB | Output is correct |
29 | Correct | 1 ms | 388 KB | Output is correct |
30 | Correct | 1 ms | 348 KB | Output is correct |
31 | Correct | 9 ms | 348 KB | Output is correct |
32 | Correct | 5 ms | 504 KB | Output is correct |
33 | Correct | 4 ms | 348 KB | Output is correct |
34 | Correct | 1 ms | 344 KB | Output is correct |
35 | Correct | 1 ms | 344 KB | Output is correct |
36 | Correct | 1 ms | 348 KB | Output is correct |
37 | Correct | 3 ms | 348 KB | Output is correct |
38 | Correct | 1 ms | 352 KB | Output is correct |
39 | Correct | 0 ms | 352 KB | Output is correct |
40 | Correct | 2 ms | 352 KB | Output is correct |
41 | Correct | 1 ms | 544 KB | Output is correct |
42 | Correct | 0 ms | 348 KB | Output is correct |
43 | Correct | 1 ms | 348 KB | Output is correct |
44 | Correct | 0 ms | 348 KB | Output is correct |
45 | Correct | 1 ms | 348 KB | Output is correct |
46 | Correct | 0 ms | 348 KB | Output is correct |
47 | Correct | 1 ms | 348 KB | Output is correct |
48 | Correct | 1 ms | 348 KB | Output is correct |
49 | Correct | 1 ms | 500 KB | Output is correct |
50 | Correct | 70 ms | 596 KB | Output is correct |
51 | Correct | 46 ms | 452 KB | Output is correct |
52 | Correct | 82 ms | 344 KB | Output is correct |
53 | Correct | 68 ms | 344 KB | Output is correct |
54 | Correct | 12 ms | 344 KB | Output is correct |
55 | Correct | 319 ms | 476 KB | Output is correct |
56 | Correct | 258 ms | 344 KB | Output is correct |
57 | Correct | 148 ms | 456 KB | Output is correct |
58 | Correct | 0 ms | 344 KB | Output is correct |
59 | Correct | 0 ms | 348 KB | Output is correct |
60 | Correct | 1 ms | 984 KB | Output is correct |
61 | Correct | 142 ms | 544 KB | Output is correct |
62 | Correct | 10 ms | 344 KB | Output is correct |
63 | Correct | 3 ms | 348 KB | Output is correct |
64 | Correct | 0 ms | 348 KB | Output is correct |
65 | Correct | 35 ms | 468 KB | Output is correct |
66 | Correct | 0 ms | 344 KB | Output is correct |
67 | Correct | 0 ms | 348 KB | Output is correct |
68 | Correct | 0 ms | 348 KB | Output is correct |
69 | Correct | 1 ms | 348 KB | Output is correct |
70 | Correct | 6 ms | 348 KB | Output is correct |
71 | Execution timed out | 5027 ms | 1676 KB | Time limit exceeded |
72 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 600 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 600 KB | Output is correct |
9 | Correct | 0 ms | 348 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 1 ms | 348 KB | Output is correct |
12 | Correct | 0 ms | 348 KB | Output is correct |
13 | Correct | 0 ms | 348 KB | Output is correct |
14 | Correct | 0 ms | 348 KB | Output is correct |
15 | Correct | 0 ms | 600 KB | Output is correct |
16 | Correct | 0 ms | 348 KB | Output is correct |
17 | Correct | 0 ms | 348 KB | Output is correct |
18 | Correct | 0 ms | 348 KB | Output is correct |
19 | Correct | 0 ms | 348 KB | Output is correct |
20 | Correct | 0 ms | 348 KB | Output is correct |
21 | Correct | 0 ms | 348 KB | Output is correct |
22 | Correct | 1 ms | 348 KB | Output is correct |
23 | Correct | 0 ms | 348 KB | Output is correct |
24 | Correct | 0 ms | 348 KB | Output is correct |
25 | Correct | 0 ms | 344 KB | Output is correct |
26 | Correct | 4 ms | 348 KB | Output is correct |
27 | Correct | 3 ms | 344 KB | Output is correct |
28 | Correct | 1 ms | 348 KB | Output is correct |
29 | Correct | 1 ms | 388 KB | Output is correct |
30 | Correct | 1 ms | 348 KB | Output is correct |
31 | Correct | 9 ms | 348 KB | Output is correct |
32 | Correct | 5 ms | 504 KB | Output is correct |
33 | Correct | 4 ms | 348 KB | Output is correct |
34 | Correct | 1 ms | 344 KB | Output is correct |
35 | Correct | 1 ms | 344 KB | Output is correct |
36 | Correct | 1 ms | 348 KB | Output is correct |
37 | Correct | 3 ms | 348 KB | Output is correct |
38 | Correct | 1 ms | 352 KB | Output is correct |
39 | Correct | 0 ms | 352 KB | Output is correct |
40 | Correct | 2 ms | 352 KB | Output is correct |
41 | Correct | 1 ms | 544 KB | Output is correct |
42 | Correct | 0 ms | 348 KB | Output is correct |
43 | Correct | 1 ms | 348 KB | Output is correct |
44 | Correct | 0 ms | 348 KB | Output is correct |
45 | Correct | 1 ms | 348 KB | Output is correct |
46 | Correct | 0 ms | 348 KB | Output is correct |
47 | Correct | 1 ms | 348 KB | Output is correct |
48 | Correct | 1 ms | 348 KB | Output is correct |
49 | Correct | 1 ms | 500 KB | Output is correct |
50 | Correct | 70 ms | 596 KB | Output is correct |
51 | Correct | 46 ms | 452 KB | Output is correct |
52 | Correct | 82 ms | 344 KB | Output is correct |
53 | Correct | 68 ms | 344 KB | Output is correct |
54 | Correct | 12 ms | 344 KB | Output is correct |
55 | Correct | 319 ms | 476 KB | Output is correct |
56 | Correct | 258 ms | 344 KB | Output is correct |
57 | Correct | 148 ms | 456 KB | Output is correct |
58 | Correct | 0 ms | 344 KB | Output is correct |
59 | Correct | 0 ms | 348 KB | Output is correct |
60 | Correct | 1 ms | 984 KB | Output is correct |
61 | Correct | 142 ms | 544 KB | Output is correct |
62 | Correct | 10 ms | 344 KB | Output is correct |
63 | Correct | 3 ms | 348 KB | Output is correct |
64 | Correct | 0 ms | 348 KB | Output is correct |
65 | Correct | 35 ms | 468 KB | Output is correct |
66 | Correct | 0 ms | 344 KB | Output is correct |
67 | Correct | 0 ms | 348 KB | Output is correct |
68 | Correct | 0 ms | 348 KB | Output is correct |
69 | Correct | 1 ms | 348 KB | Output is correct |
70 | Correct | 6 ms | 348 KB | Output is correct |
71 | Execution timed out | 5027 ms | 1676 KB | Time limit exceeded |
72 | Halted | 0 ms | 0 KB | - |