Skip to content

Commit

Permalink
[이분탐색/질문추가] - 먹을 것인가 먹힐 것인가
Browse files Browse the repository at this point in the history
  • Loading branch information
sanhee committed Sep 17, 2021
1 parent c430022 commit 5169b12
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions BOJ/이분탐색/먹을것인가먹힐것인가/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public class Main {
public static void main(String[] args) {
int numOfTestCase = scan.nextInt();
for (int test = 0; test < numOfTestCase; test++) {
int answer = 0;
input();
// 이분탐색을 위해 오름차순 정렬
Arrays.sort(B);

int answer = 0;
for (int i = 0; i < N; i++) {
answer += lowerBound(0, M-1, A[i]);
}
Expand All @@ -61,7 +61,7 @@ public class Main {

if (B[middle] < target) {
left = middle+1;
result = middle;
result = middle+1; // 왜 +1 해야하지 ?
}else{
right = middle-1;
}
Expand Down Expand Up @@ -117,4 +117,5 @@ public class Main {
}
}


```

0 comments on commit 5169b12

Please sign in to comment.