#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) {
left = mid + 1; // 고도가 X보다 낮으면 오른쪽으로 이동
} else {
right = mid - 1; // 고도가 X보다 높으면 왼쪽으로 이동
}
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
424 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Incorrect |
0 ms |
348 KB |
Wrong Answer [5] |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
1116 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |