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"
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;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |