This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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... |