답안 #225918

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
225918 2020-04-22T03:15:16 Z kshitij_sodani Toys (CEOI18_toy) C++17
100 / 100
2829 ms 91384 KB
#include <iostream>
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;

#define pb push_back
#define a first
#define b second
typedef long long llo;
set<llo> fin;
set<llo> fac2[100000];
/*llo rec(llo nn,llo su=0,llo ma=0){
	if(kk[{nn,su}]==0){
		kk[{nn,su}]=1;
		if(nn==1){
			fin.insert(su);
		}
		else{
			for(llo kk=fac2[ss[nn]].size()-1;kk>=0;kk--){
				llo jj=fac2[ss[nn]][kk];
				if(jj==1){
					continue;
				}
					rec(nn/jj,su+jj-1);
			
			}
		}
	}
}*/
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	llo n;
	cin>>n;
	vector<llo> fac;
	fac.clear();
	llo i=1;
	while(i*i<=n){
		if(n%i==0){
			fac.pb(i);
			if(i*i<n){
				fac.pb(n/i);
			}
		//	cout<<n<<" "<<i<<endl;
		}
		i+=1;
	}
	
	llo k=-1;
	sort(fac.begin(),fac.end());

	
	//n^(2/3) finding factors
	fac2[0].insert(0);
	for(llo kk=0;kk<fac.size();kk++){
		for(llo ll=0;ll<kk;ll++){

			if(fac[kk]%fac[ll]>0){
				continue;
			}
			llo add=fac[kk]/fac[ll]-1;
			for(auto jj:fac2[ll]){
				fac2[kk].insert(jj+add);
			}
		}
	
		i+=1;
	}


	cout<<fac2[fac.size()-1].size()<<endl;

	for(auto ans2:fac2[fac.size()-1]){	
		cout<<ans2<<" ";
	}
	cout<<endl;;


	return 0;
}

Compilation message

toy.cpp: In function 'int main()':
toy.cpp:56:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(llo kk=0;kk<fac.size();kk++){
               ~~^~~~~~~~~~~
toy.cpp:50:6: warning: unused variable 'k' [-Wunused-variable]
  llo k=-1;
      ^
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 4992 KB Output is correct
2 Correct 7 ms 4992 KB Output is correct
3 Correct 8 ms 4992 KB Output is correct
4 Correct 8 ms 4992 KB Output is correct
5 Correct 7 ms 5120 KB Output is correct
6 Correct 7 ms 4992 KB Output is correct
7 Correct 7 ms 4992 KB Output is correct
8 Correct 7 ms 5120 KB Output is correct
9 Correct 8 ms 5120 KB Output is correct
10 Correct 7 ms 5120 KB Output is correct
11 Correct 8 ms 5120 KB Output is correct
12 Correct 7 ms 5120 KB Output is correct
13 Correct 7 ms 5120 KB Output is correct
14 Correct 7 ms 4992 KB Output is correct
15 Correct 8 ms 5120 KB Output is correct
16 Correct 7 ms 4992 KB Output is correct
17 Correct 7 ms 4992 KB Output is correct
18 Correct 7 ms 5120 KB Output is correct
19 Correct 8 ms 4992 KB Output is correct
20 Correct 7 ms 4992 KB Output is correct
21 Correct 7 ms 4992 KB Output is correct
22 Correct 7 ms 4992 KB Output is correct
23 Correct 7 ms 4992 KB Output is correct
24 Correct 8 ms 4992 KB Output is correct
25 Correct 8 ms 5120 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 4992 KB Output is correct
2 Correct 7 ms 4992 KB Output is correct
3 Correct 8 ms 4992 KB Output is correct
4 Correct 8 ms 4992 KB Output is correct
5 Correct 7 ms 5120 KB Output is correct
6 Correct 7 ms 4992 KB Output is correct
7 Correct 7 ms 4992 KB Output is correct
8 Correct 7 ms 5120 KB Output is correct
9 Correct 8 ms 5120 KB Output is correct
10 Correct 7 ms 5120 KB Output is correct
11 Correct 8 ms 5120 KB Output is correct
12 Correct 7 ms 5120 KB Output is correct
13 Correct 7 ms 5120 KB Output is correct
14 Correct 7 ms 4992 KB Output is correct
15 Correct 8 ms 5120 KB Output is correct
16 Correct 7 ms 4992 KB Output is correct
17 Correct 7 ms 4992 KB Output is correct
18 Correct 7 ms 5120 KB Output is correct
19 Correct 8 ms 4992 KB Output is correct
20 Correct 7 ms 4992 KB Output is correct
21 Correct 7 ms 4992 KB Output is correct
22 Correct 7 ms 4992 KB Output is correct
23 Correct 7 ms 4992 KB Output is correct
24 Correct 8 ms 4992 KB Output is correct
25 Correct 8 ms 5120 KB Output is correct
26 Correct 8 ms 4992 KB Output is correct
27 Correct 7 ms 5120 KB Output is correct
28 Correct 7 ms 5120 KB Output is correct
29 Correct 7 ms 4992 KB Output is correct
30 Correct 7 ms 4992 KB Output is correct
31 Correct 8 ms 5120 KB Output is correct
32 Correct 8 ms 5120 KB Output is correct
33 Correct 8 ms 5120 KB Output is correct
34 Correct 9 ms 5120 KB Output is correct
35 Correct 7 ms 4992 KB Output is correct
36 Correct 7 ms 4992 KB Output is correct
37 Correct 7 ms 5120 KB Output is correct
38 Correct 7 ms 4992 KB Output is correct
39 Correct 7 ms 4992 KB Output is correct
40 Correct 8 ms 5120 KB Output is correct
41 Correct 8 ms 4992 KB Output is correct
42 Correct 7 ms 4992 KB Output is correct
43 Correct 8 ms 4992 KB Output is correct
44 Correct 8 ms 5120 KB Output is correct
45 Correct 8 ms 4992 KB Output is correct
46 Correct 7 ms 4992 KB Output is correct
47 Correct 9 ms 5120 KB Output is correct
48 Correct 8 ms 4992 KB Output is correct
49 Correct 8 ms 4992 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 4992 KB Output is correct
2 Correct 7 ms 4992 KB Output is correct
3 Correct 8 ms 4992 KB Output is correct
4 Correct 8 ms 4992 KB Output is correct
5 Correct 7 ms 5120 KB Output is correct
6 Correct 7 ms 4992 KB Output is correct
7 Correct 7 ms 4992 KB Output is correct
8 Correct 7 ms 5120 KB Output is correct
9 Correct 8 ms 5120 KB Output is correct
10 Correct 7 ms 5120 KB Output is correct
11 Correct 8 ms 5120 KB Output is correct
12 Correct 7 ms 5120 KB Output is correct
13 Correct 7 ms 5120 KB Output is correct
14 Correct 7 ms 4992 KB Output is correct
15 Correct 8 ms 5120 KB Output is correct
16 Correct 7 ms 4992 KB Output is correct
17 Correct 7 ms 4992 KB Output is correct
18 Correct 7 ms 5120 KB Output is correct
19 Correct 8 ms 4992 KB Output is correct
20 Correct 7 ms 4992 KB Output is correct
21 Correct 7 ms 4992 KB Output is correct
22 Correct 7 ms 4992 KB Output is correct
23 Correct 7 ms 4992 KB Output is correct
24 Correct 8 ms 4992 KB Output is correct
25 Correct 8 ms 5120 KB Output is correct
26 Correct 8 ms 4992 KB Output is correct
27 Correct 7 ms 5120 KB Output is correct
28 Correct 7 ms 5120 KB Output is correct
29 Correct 7 ms 4992 KB Output is correct
30 Correct 7 ms 4992 KB Output is correct
31 Correct 8 ms 5120 KB Output is correct
32 Correct 8 ms 5120 KB Output is correct
33 Correct 8 ms 5120 KB Output is correct
34 Correct 9 ms 5120 KB Output is correct
35 Correct 7 ms 4992 KB Output is correct
36 Correct 7 ms 4992 KB Output is correct
37 Correct 7 ms 5120 KB Output is correct
38 Correct 7 ms 4992 KB Output is correct
39 Correct 7 ms 4992 KB Output is correct
40 Correct 8 ms 5120 KB Output is correct
41 Correct 8 ms 4992 KB Output is correct
42 Correct 7 ms 4992 KB Output is correct
43 Correct 8 ms 4992 KB Output is correct
44 Correct 8 ms 5120 KB Output is correct
45 Correct 8 ms 4992 KB Output is correct
46 Correct 7 ms 4992 KB Output is correct
47 Correct 9 ms 5120 KB Output is correct
48 Correct 8 ms 4992 KB Output is correct
49 Correct 8 ms 4992 KB Output is correct
50 Correct 11 ms 5376 KB Output is correct
51 Correct 9 ms 5248 KB Output is correct
52 Correct 11 ms 5376 KB Output is correct
53 Correct 9 ms 5248 KB Output is correct
54 Correct 8 ms 5248 KB Output is correct
55 Correct 11 ms 5376 KB Output is correct
56 Correct 11 ms 5376 KB Output is correct
57 Correct 10 ms 5316 KB Output is correct
58 Correct 7 ms 4992 KB Output is correct
59 Correct 7 ms 4992 KB Output is correct
60 Correct 7 ms 5120 KB Output is correct
61 Correct 9 ms 5248 KB Output is correct
62 Correct 8 ms 5120 KB Output is correct
63 Correct 7 ms 5120 KB Output is correct
64 Correct 7 ms 4992 KB Output is correct
65 Correct 9 ms 5248 KB Output is correct
66 Correct 8 ms 4992 KB Output is correct
67 Correct 8 ms 4992 KB Output is correct
68 Correct 7 ms 4992 KB Output is correct
69 Correct 7 ms 5120 KB Output is correct
70 Correct 9 ms 5120 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 4992 KB Output is correct
2 Correct 7 ms 4992 KB Output is correct
3 Correct 8 ms 4992 KB Output is correct
4 Correct 8 ms 4992 KB Output is correct
5 Correct 7 ms 5120 KB Output is correct
6 Correct 7 ms 4992 KB Output is correct
7 Correct 7 ms 4992 KB Output is correct
8 Correct 7 ms 5120 KB Output is correct
9 Correct 8 ms 5120 KB Output is correct
10 Correct 7 ms 5120 KB Output is correct
11 Correct 8 ms 5120 KB Output is correct
12 Correct 7 ms 5120 KB Output is correct
13 Correct 7 ms 5120 KB Output is correct
14 Correct 7 ms 4992 KB Output is correct
15 Correct 8 ms 5120 KB Output is correct
16 Correct 7 ms 4992 KB Output is correct
17 Correct 7 ms 4992 KB Output is correct
18 Correct 7 ms 5120 KB Output is correct
19 Correct 8 ms 4992 KB Output is correct
20 Correct 7 ms 4992 KB Output is correct
21 Correct 7 ms 4992 KB Output is correct
22 Correct 7 ms 4992 KB Output is correct
23 Correct 7 ms 4992 KB Output is correct
24 Correct 8 ms 4992 KB Output is correct
25 Correct 8 ms 5120 KB Output is correct
26 Correct 8 ms 4992 KB Output is correct
27 Correct 7 ms 5120 KB Output is correct
28 Correct 7 ms 5120 KB Output is correct
29 Correct 7 ms 4992 KB Output is correct
30 Correct 7 ms 4992 KB Output is correct
31 Correct 8 ms 5120 KB Output is correct
32 Correct 8 ms 5120 KB Output is correct
33 Correct 8 ms 5120 KB Output is correct
34 Correct 9 ms 5120 KB Output is correct
35 Correct 7 ms 4992 KB Output is correct
36 Correct 7 ms 4992 KB Output is correct
37 Correct 7 ms 5120 KB Output is correct
38 Correct 7 ms 4992 KB Output is correct
39 Correct 7 ms 4992 KB Output is correct
40 Correct 8 ms 5120 KB Output is correct
41 Correct 8 ms 4992 KB Output is correct
42 Correct 7 ms 4992 KB Output is correct
43 Correct 8 ms 4992 KB Output is correct
44 Correct 8 ms 5120 KB Output is correct
45 Correct 8 ms 4992 KB Output is correct
46 Correct 7 ms 4992 KB Output is correct
47 Correct 9 ms 5120 KB Output is correct
48 Correct 8 ms 4992 KB Output is correct
49 Correct 8 ms 4992 KB Output is correct
50 Correct 11 ms 5376 KB Output is correct
51 Correct 9 ms 5248 KB Output is correct
52 Correct 11 ms 5376 KB Output is correct
53 Correct 9 ms 5248 KB Output is correct
54 Correct 8 ms 5248 KB Output is correct
55 Correct 11 ms 5376 KB Output is correct
56 Correct 11 ms 5376 KB Output is correct
57 Correct 10 ms 5316 KB Output is correct
58 Correct 7 ms 4992 KB Output is correct
59 Correct 7 ms 4992 KB Output is correct
60 Correct 7 ms 5120 KB Output is correct
61 Correct 9 ms 5248 KB Output is correct
62 Correct 8 ms 5120 KB Output is correct
63 Correct 7 ms 5120 KB Output is correct
64 Correct 7 ms 4992 KB Output is correct
65 Correct 9 ms 5248 KB Output is correct
66 Correct 8 ms 4992 KB Output is correct
67 Correct 8 ms 4992 KB Output is correct
68 Correct 7 ms 4992 KB Output is correct
69 Correct 7 ms 5120 KB Output is correct
70 Correct 9 ms 5120 KB Output is correct
71 Correct 412 ms 23416 KB Output is correct
72 Correct 277 ms 18748 KB Output is correct
73 Correct 409 ms 21112 KB Output is correct
74 Correct 215 ms 15852 KB Output is correct
75 Correct 258 ms 16548 KB Output is correct
76 Correct 646 ms 29820 KB Output is correct
77 Correct 585 ms 26748 KB Output is correct
78 Correct 540 ms 25336 KB Output is correct
79 Correct 495 ms 24696 KB Output is correct
80 Correct 7 ms 5120 KB Output is correct
81 Correct 7 ms 4992 KB Output is correct
82 Correct 12 ms 5504 KB Output is correct
83 Correct 60 ms 8312 KB Output is correct
84 Correct 74 ms 9080 KB Output is correct
85 Correct 21 ms 6272 KB Output is correct
86 Correct 7 ms 4992 KB Output is correct
87 Correct 92 ms 9720 KB Output is correct
88 Correct 8 ms 4992 KB Output is correct
89 Correct 7 ms 4992 KB Output is correct
90 Correct 8 ms 5120 KB Output is correct
91 Correct 26 ms 6784 KB Output is correct
92 Correct 95 ms 11256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 4992 KB Output is correct
2 Correct 7 ms 4992 KB Output is correct
3 Correct 8 ms 4992 KB Output is correct
4 Correct 8 ms 4992 KB Output is correct
5 Correct 7 ms 5120 KB Output is correct
6 Correct 7 ms 4992 KB Output is correct
7 Correct 7 ms 4992 KB Output is correct
8 Correct 7 ms 5120 KB Output is correct
9 Correct 8 ms 5120 KB Output is correct
10 Correct 7 ms 5120 KB Output is correct
11 Correct 8 ms 5120 KB Output is correct
12 Correct 7 ms 5120 KB Output is correct
13 Correct 7 ms 5120 KB Output is correct
14 Correct 7 ms 4992 KB Output is correct
15 Correct 8 ms 5120 KB Output is correct
16 Correct 7 ms 4992 KB Output is correct
17 Correct 7 ms 4992 KB Output is correct
18 Correct 7 ms 5120 KB Output is correct
19 Correct 8 ms 4992 KB Output is correct
20 Correct 7 ms 4992 KB Output is correct
21 Correct 7 ms 4992 KB Output is correct
22 Correct 7 ms 4992 KB Output is correct
23 Correct 7 ms 4992 KB Output is correct
24 Correct 8 ms 4992 KB Output is correct
25 Correct 8 ms 5120 KB Output is correct
26 Correct 8 ms 4992 KB Output is correct
27 Correct 7 ms 5120 KB Output is correct
28 Correct 7 ms 5120 KB Output is correct
29 Correct 7 ms 4992 KB Output is correct
30 Correct 7 ms 4992 KB Output is correct
31 Correct 8 ms 5120 KB Output is correct
32 Correct 8 ms 5120 KB Output is correct
33 Correct 8 ms 5120 KB Output is correct
34 Correct 9 ms 5120 KB Output is correct
35 Correct 7 ms 4992 KB Output is correct
36 Correct 7 ms 4992 KB Output is correct
37 Correct 7 ms 5120 KB Output is correct
38 Correct 7 ms 4992 KB Output is correct
39 Correct 7 ms 4992 KB Output is correct
40 Correct 8 ms 5120 KB Output is correct
41 Correct 8 ms 4992 KB Output is correct
42 Correct 7 ms 4992 KB Output is correct
43 Correct 8 ms 4992 KB Output is correct
44 Correct 8 ms 5120 KB Output is correct
45 Correct 8 ms 4992 KB Output is correct
46 Correct 7 ms 4992 KB Output is correct
47 Correct 9 ms 5120 KB Output is correct
48 Correct 8 ms 4992 KB Output is correct
49 Correct 8 ms 4992 KB Output is correct
50 Correct 11 ms 5376 KB Output is correct
51 Correct 9 ms 5248 KB Output is correct
52 Correct 11 ms 5376 KB Output is correct
53 Correct 9 ms 5248 KB Output is correct
54 Correct 8 ms 5248 KB Output is correct
55 Correct 11 ms 5376 KB Output is correct
56 Correct 11 ms 5376 KB Output is correct
57 Correct 10 ms 5316 KB Output is correct
58 Correct 7 ms 4992 KB Output is correct
59 Correct 7 ms 4992 KB Output is correct
60 Correct 7 ms 5120 KB Output is correct
61 Correct 9 ms 5248 KB Output is correct
62 Correct 8 ms 5120 KB Output is correct
63 Correct 7 ms 5120 KB Output is correct
64 Correct 7 ms 4992 KB Output is correct
65 Correct 9 ms 5248 KB Output is correct
66 Correct 8 ms 4992 KB Output is correct
67 Correct 8 ms 4992 KB Output is correct
68 Correct 7 ms 4992 KB Output is correct
69 Correct 7 ms 5120 KB Output is correct
70 Correct 9 ms 5120 KB Output is correct
71 Correct 412 ms 23416 KB Output is correct
72 Correct 277 ms 18748 KB Output is correct
73 Correct 409 ms 21112 KB Output is correct
74 Correct 215 ms 15852 KB Output is correct
75 Correct 258 ms 16548 KB Output is correct
76 Correct 646 ms 29820 KB Output is correct
77 Correct 585 ms 26748 KB Output is correct
78 Correct 540 ms 25336 KB Output is correct
79 Correct 495 ms 24696 KB Output is correct
80 Correct 7 ms 5120 KB Output is correct
81 Correct 7 ms 4992 KB Output is correct
82 Correct 12 ms 5504 KB Output is correct
83 Correct 60 ms 8312 KB Output is correct
84 Correct 74 ms 9080 KB Output is correct
85 Correct 21 ms 6272 KB Output is correct
86 Correct 7 ms 4992 KB Output is correct
87 Correct 92 ms 9720 KB Output is correct
88 Correct 8 ms 4992 KB Output is correct
89 Correct 7 ms 4992 KB Output is correct
90 Correct 8 ms 5120 KB Output is correct
91 Correct 26 ms 6784 KB Output is correct
92 Correct 95 ms 11256 KB Output is correct
93 Correct 2389 ms 82040 KB Output is correct
94 Correct 1357 ms 56756 KB Output is correct
95 Correct 1512 ms 59384 KB Output is correct
96 Correct 1363 ms 53624 KB Output is correct
97 Correct 1227 ms 49272 KB Output is correct
98 Correct 2747 ms 90232 KB Output is correct
99 Correct 2829 ms 91384 KB Output is correct
100 Correct 2689 ms 88188 KB Output is correct
101 Correct 2568 ms 82096 KB Output is correct
102 Correct 2219 ms 74104 KB Output is correct
103 Correct 1751 ms 67064 KB Output is correct
104 Correct 7 ms 4992 KB Output is correct
105 Correct 7 ms 4992 KB Output is correct
106 Correct 13 ms 5632 KB Output is correct
107 Correct 184 ms 14060 KB Output is correct
108 Correct 466 ms 25156 KB Output is correct
109 Correct 45 ms 7928 KB Output is correct
110 Correct 7 ms 4992 KB Output is correct
111 Correct 233 ms 16888 KB Output is correct
112 Correct 7 ms 4992 KB Output is correct
113 Correct 7 ms 4992 KB Output is correct
114 Correct 12 ms 5632 KB Output is correct
115 Correct 7 ms 4992 KB Output is correct
116 Correct 20 ms 6400 KB Output is correct
117 Correct 452 ms 29304 KB Output is correct