File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
// Authored by : BaaaaaaaaaaarkingDog
2
2
// Co-authored by : -
3
- // http://boj.kr/2532d97629b04d7c86f15db6bee08772
3
+ // http://boj.kr/8b88c60fcf17452a9e602ef1bc17adde
4
4
#include < bits/stdc++.h>
5
5
using namespace std ;
6
6
@@ -9,7 +9,7 @@ long long state[10];
9
9
10
10
int bit_cnt (long long x){
11
11
int ret = 0 ;
12
- for (int i = 0 ; i < m ; i++){
12
+ for (int i = 0 ; i < max (n, m) ; i++){
13
13
ret += (x >> i) & 1 ;
14
14
}
15
15
return ret;
@@ -31,7 +31,7 @@ int main(){
31
31
pair<int , int > ans = {0 , -1 }; // {연주할 수 있는 곡의 수, 필요한 기타의 수}
32
32
for (int tmp = 0 ; tmp < (1 << n); tmp++){
33
33
long long comb = 0 ; // 조합한 결과
34
- for (int i = 0 ; i < m ; i++){
34
+ for (int i = 0 ; i < n ; i++){
35
35
if ((tmp & (1LL << i)) == 0 )
36
36
continue ;
37
37
comb |= state[i];
You can’t perform that action at this time.
0 commit comments