# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
934317 | 2024-02-27T07:06:26 Z | tamir1 | Toys (CEOI18_toy) | C++14 | 5000 ms | 68048 KB |
#include<bits/stdc++.h> #define ll int using namespace std; ll n,i,j,m,x,y; vector<ll> a,b; unordered_map<ll,ll> mp; int main(){ /*ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);*/ //cin >> n; scanf("%d",&n); for(i=1;i*i<=n;i++){ if(n%i!=0) continue; if(i*i==n){ a.push_back(i); continue; } a.push_back(i); b.push_back(n/i); } m=b.size(); for(i=m-1;i>=0;i--) a.push_back(b[i]); m=a.size(); vector<set<ll>> s(m); for(i=0;i<m;i++){ mp[a[i]]=i; x=a[i]; s[i].insert(x-1); for(j=1;a[j]*a[j]<=x && j<i;j++){ y=a[j]; if(x%y!=0) continue; for(ll l:s[mp[y]]){ for(ll r:s[mp[x/y]]){ s[i].insert(l+r); } } } } //cout << s[m-1].size() << "\n"; printf("%d\n",s[m-1].size()); for(ll i:s[m-1]) printf("%d ",i); //cout << i << " "; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 432 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 1 ms | 600 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 348 KB | Output is correct |
9 | Correct | 0 ms | 348 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 0 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 | 348 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 | 344 KB | Output is correct |
19 | Correct | 0 ms | 348 KB | Output is correct |
20 | Correct | 1 ms | 344 KB | Output is correct |
21 | Correct | 0 ms | 344 KB | Output is correct |
22 | Correct | 1 ms | 348 KB | Output is correct |
23 | Correct | 0 ms | 436 KB | Output is correct |
24 | Correct | 0 ms | 348 KB | Output is correct |
25 | Correct | 0 ms | 348 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 432 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 1 ms | 600 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 348 KB | Output is correct |
9 | Correct | 0 ms | 348 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 0 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 | 348 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 | 344 KB | Output is correct |
19 | Correct | 0 ms | 348 KB | Output is correct |
20 | Correct | 1 ms | 344 KB | Output is correct |
21 | Correct | 0 ms | 344 KB | Output is correct |
22 | Correct | 1 ms | 348 KB | Output is correct |
23 | Correct | 0 ms | 436 KB | Output is correct |
24 | Correct | 0 ms | 348 KB | Output is correct |
25 | Correct | 0 ms | 348 KB | Output is correct |
26 | Correct | 1 ms | 344 KB | Output is correct |
27 | Correct | 1 ms | 344 KB | Output is correct |
28 | Correct | 1 ms | 348 KB | Output is correct |
29 | Correct | 1 ms | 348 KB | Output is correct |
30 | Correct | 1 ms | 344 KB | Output is correct |
31 | Correct | 1 ms | 520 KB | Output is correct |
32 | Correct | 1 ms | 344 KB | Output is correct |
33 | Correct | 1 ms | 348 KB | Output is correct |
34 | Correct | 1 ms | 344 KB | Output is correct |
35 | Correct | 0 ms | 348 KB | Output is correct |
36 | Correct | 0 ms | 348 KB | Output is correct |
37 | Correct | 1 ms | 348 KB | Output is correct |
38 | Correct | 0 ms | 348 KB | Output is correct |
39 | Correct | 0 ms | 348 KB | Output is correct |
40 | Correct | 1 ms | 348 KB | Output is correct |
41 | Correct | 0 ms | 348 KB | Output is correct |
42 | Correct | 0 ms | 436 KB | Output is correct |
43 | Correct | 0 ms | 600 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 | 0 ms | 348 KB | Output is correct |
49 | Correct | 0 ms | 432 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 432 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 1 ms | 600 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 348 KB | Output is correct |
9 | Correct | 0 ms | 348 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 0 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 | 348 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 | 344 KB | Output is correct |
19 | Correct | 0 ms | 348 KB | Output is correct |
20 | Correct | 1 ms | 344 KB | Output is correct |
21 | Correct | 0 ms | 344 KB | Output is correct |
22 | Correct | 1 ms | 348 KB | Output is correct |
23 | Correct | 0 ms | 436 KB | Output is correct |
24 | Correct | 0 ms | 348 KB | Output is correct |
25 | Correct | 0 ms | 348 KB | Output is correct |
26 | Correct | 1 ms | 344 KB | Output is correct |
27 | Correct | 1 ms | 344 KB | Output is correct |
28 | Correct | 1 ms | 348 KB | Output is correct |
29 | Correct | 1 ms | 348 KB | Output is correct |
30 | Correct | 1 ms | 344 KB | Output is correct |
31 | Correct | 1 ms | 520 KB | Output is correct |
32 | Correct | 1 ms | 344 KB | Output is correct |
33 | Correct | 1 ms | 348 KB | Output is correct |
34 | Correct | 1 ms | 344 KB | Output is correct |
35 | Correct | 0 ms | 348 KB | Output is correct |
36 | Correct | 0 ms | 348 KB | Output is correct |
37 | Correct | 1 ms | 348 KB | Output is correct |
38 | Correct | 0 ms | 348 KB | Output is correct |
39 | Correct | 0 ms | 348 KB | Output is correct |
40 | Correct | 1 ms | 348 KB | Output is correct |
41 | Correct | 0 ms | 348 KB | Output is correct |
42 | Correct | 0 ms | 436 KB | Output is correct |
43 | Correct | 0 ms | 600 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 | 0 ms | 348 KB | Output is correct |
49 | Correct | 0 ms | 432 KB | Output is correct |
50 | Correct | 4 ms | 1104 KB | Output is correct |
51 | Correct | 3 ms | 604 KB | Output is correct |
52 | Correct | 4 ms | 604 KB | Output is correct |
53 | Correct | 3 ms | 604 KB | Output is correct |
54 | Correct | 1 ms | 348 KB | Output is correct |
55 | Correct | 6 ms | 604 KB | Output is correct |
56 | Correct | 6 ms | 684 KB | Output is correct |
57 | Correct | 5 ms | 604 KB | Output is correct |
58 | Correct | 0 ms | 348 KB | Output is correct |
59 | Correct | 0 ms | 440 KB | Output is correct |
60 | Correct | 1 ms | 348 KB | Output is correct |
61 | Correct | 3 ms | 604 KB | Output is correct |
62 | Correct | 1 ms | 348 KB | Output is correct |
63 | Correct | 1 ms | 344 KB | Output is correct |
64 | Correct | 0 ms | 440 KB | Output is correct |
65 | Correct | 3 ms | 604 KB | Output is correct |
66 | Correct | 1 ms | 344 KB | Output is correct |
67 | Correct | 1 ms | 348 KB | Output is correct |
68 | Correct | 0 ms | 344 KB | Output is correct |
69 | Correct | 0 ms | 344 KB | Output is correct |
70 | Correct | 1 ms | 348 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 432 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 1 ms | 600 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 348 KB | Output is correct |
9 | Correct | 0 ms | 348 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 0 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 | 348 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 | 344 KB | Output is correct |
19 | Correct | 0 ms | 348 KB | Output is correct |
20 | Correct | 1 ms | 344 KB | Output is correct |
21 | Correct | 0 ms | 344 KB | Output is correct |
22 | Correct | 1 ms | 348 KB | Output is correct |
23 | Correct | 0 ms | 436 KB | Output is correct |
24 | Correct | 0 ms | 348 KB | Output is correct |
25 | Correct | 0 ms | 348 KB | Output is correct |
26 | Correct | 1 ms | 344 KB | Output is correct |
27 | Correct | 1 ms | 344 KB | Output is correct |
28 | Correct | 1 ms | 348 KB | Output is correct |
29 | Correct | 1 ms | 348 KB | Output is correct |
30 | Correct | 1 ms | 344 KB | Output is correct |
31 | Correct | 1 ms | 520 KB | Output is correct |
32 | Correct | 1 ms | 344 KB | Output is correct |
33 | Correct | 1 ms | 348 KB | Output is correct |
34 | Correct | 1 ms | 344 KB | Output is correct |
35 | Correct | 0 ms | 348 KB | Output is correct |
36 | Correct | 0 ms | 348 KB | Output is correct |
37 | Correct | 1 ms | 348 KB | Output is correct |
38 | Correct | 0 ms | 348 KB | Output is correct |
39 | Correct | 0 ms | 348 KB | Output is correct |
40 | Correct | 1 ms | 348 KB | Output is correct |
41 | Correct | 0 ms | 348 KB | Output is correct |
42 | Correct | 0 ms | 436 KB | Output is correct |
43 | Correct | 0 ms | 600 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 | 0 ms | 348 KB | Output is correct |
49 | Correct | 0 ms | 432 KB | Output is correct |
50 | Correct | 4 ms | 1104 KB | Output is correct |
51 | Correct | 3 ms | 604 KB | Output is correct |
52 | Correct | 4 ms | 604 KB | Output is correct |
53 | Correct | 3 ms | 604 KB | Output is correct |
54 | Correct | 1 ms | 348 KB | Output is correct |
55 | Correct | 6 ms | 604 KB | Output is correct |
56 | Correct | 6 ms | 684 KB | Output is correct |
57 | Correct | 5 ms | 604 KB | Output is correct |
58 | Correct | 0 ms | 348 KB | Output is correct |
59 | Correct | 0 ms | 440 KB | Output is correct |
60 | Correct | 1 ms | 348 KB | Output is correct |
61 | Correct | 3 ms | 604 KB | Output is correct |
62 | Correct | 1 ms | 348 KB | Output is correct |
63 | Correct | 1 ms | 344 KB | Output is correct |
64 | Correct | 0 ms | 440 KB | Output is correct |
65 | Correct | 3 ms | 604 KB | Output is correct |
66 | Correct | 1 ms | 344 KB | Output is correct |
67 | Correct | 1 ms | 348 KB | Output is correct |
68 | Correct | 0 ms | 344 KB | Output is correct |
69 | Correct | 0 ms | 344 KB | Output is correct |
70 | Correct | 1 ms | 348 KB | Output is correct |
71 | Correct | 860 ms | 18644 KB | Output is correct |
72 | Correct | 499 ms | 14272 KB | Output is correct |
73 | Correct | 909 ms | 16732 KB | Output is correct |
74 | Correct | 368 ms | 11092 KB | Output is correct |
75 | Correct | 493 ms | 12112 KB | Output is correct |
76 | Correct | 1814 ms | 25072 KB | Output is correct |
77 | Correct | 1949 ms | 22232 KB | Output is correct |
78 | Correct | 1365 ms | 20632 KB | Output is correct |
79 | Correct | 1472 ms | 20468 KB | Output is correct |
80 | Correct | 0 ms | 348 KB | Output is correct |
81 | Correct | 0 ms | 348 KB | Output is correct |
82 | Correct | 10 ms | 604 KB | Output is correct |
83 | Correct | 181 ms | 3652 KB | Output is correct |
84 | Correct | 160 ms | 4436 KB | Output is correct |
85 | Correct | 33 ms | 1628 KB | Output is correct |
86 | Correct | 1 ms | 348 KB | Output is correct |
87 | Correct | 196 ms | 5084 KB | Output is correct |
88 | Correct | 1 ms | 344 KB | Output is correct |
89 | Correct | 0 ms | 348 KB | Output is correct |
90 | Correct | 1 ms | 348 KB | Output is correct |
91 | Correct | 26 ms | 2224 KB | Output is correct |
92 | Correct | 125 ms | 6484 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 432 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 1 ms | 600 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 348 KB | Output is correct |
9 | Correct | 0 ms | 348 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 0 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 | 348 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 | 344 KB | Output is correct |
19 | Correct | 0 ms | 348 KB | Output is correct |
20 | Correct | 1 ms | 344 KB | Output is correct |
21 | Correct | 0 ms | 344 KB | Output is correct |
22 | Correct | 1 ms | 348 KB | Output is correct |
23 | Correct | 0 ms | 436 KB | Output is correct |
24 | Correct | 0 ms | 348 KB | Output is correct |
25 | Correct | 0 ms | 348 KB | Output is correct |
26 | Correct | 1 ms | 344 KB | Output is correct |
27 | Correct | 1 ms | 344 KB | Output is correct |
28 | Correct | 1 ms | 348 KB | Output is correct |
29 | Correct | 1 ms | 348 KB | Output is correct |
30 | Correct | 1 ms | 344 KB | Output is correct |
31 | Correct | 1 ms | 520 KB | Output is correct |
32 | Correct | 1 ms | 344 KB | Output is correct |
33 | Correct | 1 ms | 348 KB | Output is correct |
34 | Correct | 1 ms | 344 KB | Output is correct |
35 | Correct | 0 ms | 348 KB | Output is correct |
36 | Correct | 0 ms | 348 KB | Output is correct |
37 | Correct | 1 ms | 348 KB | Output is correct |
38 | Correct | 0 ms | 348 KB | Output is correct |
39 | Correct | 0 ms | 348 KB | Output is correct |
40 | Correct | 1 ms | 348 KB | Output is correct |
41 | Correct | 0 ms | 348 KB | Output is correct |
42 | Correct | 0 ms | 436 KB | Output is correct |
43 | Correct | 0 ms | 600 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 | 0 ms | 348 KB | Output is correct |
49 | Correct | 0 ms | 432 KB | Output is correct |
50 | Correct | 4 ms | 1104 KB | Output is correct |
51 | Correct | 3 ms | 604 KB | Output is correct |
52 | Correct | 4 ms | 604 KB | Output is correct |
53 | Correct | 3 ms | 604 KB | Output is correct |
54 | Correct | 1 ms | 348 KB | Output is correct |
55 | Correct | 6 ms | 604 KB | Output is correct |
56 | Correct | 6 ms | 684 KB | Output is correct |
57 | Correct | 5 ms | 604 KB | Output is correct |
58 | Correct | 0 ms | 348 KB | Output is correct |
59 | Correct | 0 ms | 440 KB | Output is correct |
60 | Correct | 1 ms | 348 KB | Output is correct |
61 | Correct | 3 ms | 604 KB | Output is correct |
62 | Correct | 1 ms | 348 KB | Output is correct |
63 | Correct | 1 ms | 344 KB | Output is correct |
64 | Correct | 0 ms | 440 KB | Output is correct |
65 | Correct | 3 ms | 604 KB | Output is correct |
66 | Correct | 1 ms | 344 KB | Output is correct |
67 | Correct | 1 ms | 348 KB | Output is correct |
68 | Correct | 0 ms | 344 KB | Output is correct |
69 | Correct | 0 ms | 344 KB | Output is correct |
70 | Correct | 1 ms | 348 KB | Output is correct |
71 | Correct | 860 ms | 18644 KB | Output is correct |
72 | Correct | 499 ms | 14272 KB | Output is correct |
73 | Correct | 909 ms | 16732 KB | Output is correct |
74 | Correct | 368 ms | 11092 KB | Output is correct |
75 | Correct | 493 ms | 12112 KB | Output is correct |
76 | Correct | 1814 ms | 25072 KB | Output is correct |
77 | Correct | 1949 ms | 22232 KB | Output is correct |
78 | Correct | 1365 ms | 20632 KB | Output is correct |
79 | Correct | 1472 ms | 20468 KB | Output is correct |
80 | Correct | 0 ms | 348 KB | Output is correct |
81 | Correct | 0 ms | 348 KB | Output is correct |
82 | Correct | 10 ms | 604 KB | Output is correct |
83 | Correct | 181 ms | 3652 KB | Output is correct |
84 | Correct | 160 ms | 4436 KB | Output is correct |
85 | Correct | 33 ms | 1628 KB | Output is correct |
86 | Correct | 1 ms | 348 KB | Output is correct |
87 | Correct | 196 ms | 5084 KB | Output is correct |
88 | Correct | 1 ms | 344 KB | Output is correct |
89 | Correct | 0 ms | 348 KB | Output is correct |
90 | Correct | 1 ms | 348 KB | Output is correct |
91 | Correct | 26 ms | 2224 KB | Output is correct |
92 | Correct | 125 ms | 6484 KB | Output is correct |
93 | Execution timed out | 5062 ms | 68048 KB | Time limit exceeded |
94 | Halted | 0 ms | 0 KB | - |