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

Skip to content

Commit 79d4483

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

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Appendix C/1497.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// http://boj.kr/2532d97629b04d7c86f15db6bee08772
1+
// http://boj.kr/8b88c60fcf17452a9e602ef1bc17adde
22
#include <bits/stdc++.h>
33
using namespace std;
44

@@ -7,7 +7,7 @@ long long state[10];
77

88
int bit_cnt(long long x){
99
int ret = 0;
10-
for(int i = 0; i < m; i++){
10+
for(int i = 0; i < max(n, m); i++){
1111
ret += (x >> i) & 1;
1212
}
1313
return ret;
@@ -29,7 +29,7 @@ int main(){
2929
pair<int, int> ans = {0, -1}; // {연주할 수 있는 곡의 수, 필요한 기타의 수}
3030
for(int tmp = 0; tmp < (1 << n); tmp++){
3131
long long comb = 0; // 조합한 결과
32-
for(int i = 0; i < m; i++){
32+
for(int i = 0; i < n; i++){
3333
if((tmp & (1LL << i)) == 0)
3434
continue;
3535
comb |= state[i];

0 commit comments

Comments
 (0)
0