8000 Update 1497.cpp · devCharlotte/basic-algo-lecture@e18c681 · GitHub
[go: up one dir, main page]

Skip to content

Commit e18c681

Browse files
Update 1497.cpp
1 parent 79d4483 commit e18c681

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Appendix C/solutions/1497.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Authored by : BaaaaaaaaaaarkingDog
22
// Co-authored by : -
3-
// http://boj.kr/2532d97629b04d7c86f15db6bee08772
3+
// http://boj.kr/8b88c60fcf17452a9e602ef1bc17adde
44
#include <bits/stdc++.h>
55
using namespace std;
66

@@ -9,7 +9,7 @@ long long state[10];
99

1010
int bit_cnt(long long x){
1111
int ret = 0;
12-
for(int i = 0; i < m; i++){
12+
for(int i = 0; i < max(n, m); i++){
1313
ret += (x >> i) & 1;
1414
}
1515
return ret;
@@ -31,7 +31,7 @@ int main(){
3131
pair<int, int> ans = {0, -1}; // {연주할 수 있는 곡의 수, 필요한 기타의 수}
3232
for(int tmp = 0; tmp < (1 << n); tmp++){
3333
long long comb = 0; // 조합한 결과
34-
for(int i = 0; i < m; i++){
34+
for(int i = 0; i < n; i++){
3535
if((tmp & (1LL << i)) == 0)
3636
continue;
3737
comb |= state[i];

0 commit comments

Comments
 (0)
0