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 f(int rs, int re, int cs, int ce, int r, int c, int dr, int dc, int X) {
int ht;
while(rs<=r && r<=re && cs<=c && c<=ce) {
ht = Measure(r, c);
if(ht == X) {Pinpoint(r, c); return;}
ht<X ? c += dc : r += dr;
}
}
void Rescue(int R, int C, int RS, int CS, int X) {
f(1, RS, 1, CS, RS, 1, -1, 1, X);
f(RS, R, 1, CS, RS, 1, 1, 1, X);
f(1, RS, CS, C, RS, C, -1, -1, X);
f(RS, R, CS, C, RS, C, 1, -1, X);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |