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 x;
void g(int p1, int q1, int p2, int q2, int p, int q, int py, int px) {
int t;
while (p >= p1 && p <= p2 && q >= q1 && q <= q2) {
t = Measure(p, q);
if (t == x) Pinpoint(p, q);
if (t < x) q += px;
else p += py;
}
}
void Rescue(int R, int C, int RS, int CS, int X) {
x = X;
g(1, 1, RS, CS, RS, 1, -1, 1);
g(1, CS, RS, C, RS, C, -1, -1);
g(RS, 1, R, CS, RS, 1, 1, 1);
g(RS, CS, R, C, RS, C, 1, -1);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |