이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "grader.h"
using namespace std;
void Rescue(int R, int C, int RS, int CS, int X) {
for(int r = 1; r <= R; r++) {
int left = 1;
int right = C;
while (left <= right) {
int mid = (left + right) / 2;
int ht = Measure(r, mid);
if (ht == X) {
Pinpoint(r, mid);
return;
} else if (ht < X) {
// 왼쪽이 낮고 오른쪽이 높기 때문에, ht가 X보다 작다면 오른쪽으로 이동
left = mid + 1;
} else {
// ht가 X보다 크다면 왼쪽으로 이동
right = mid - 1;
}
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |