#include "grader.h"
int measure(int r, int c, int x) {
int ret = Measure(r, c);
if(ret == x) Pinpoint(r, c);
return ret;
}
void Rescue(int R, int C, int RS, int CS, int x) {
for(int r=1; r<=R; r++) {
int h = measure(r, CS, x);
if(h < x) continue;
int lt = 0, rt = CS;
while(rt - lt > 1) {
int md = (lt + rt) / 2;
if(measure(r, md, x) < x) lt = md;
else rt = md;
}
lt = CS, rt = C;
while(rt - lt > 1) {
int md = (lt + rt) / 2;
if(measure(r, md, x) < x) rt = md;
else lt = md;
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 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 |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
568 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
348 KB |
Output is correct |
5 |
Incorrect |
3 ms |
348 KB |
Wrong Answer [2] |
6 |
Halted |
0 ms |
0 KB |
- |