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 <bits/stdc++.h>
#include "grader.h"
using namespace std;
void SubRescue(int r, int c, int x, int y, int expecH, int dx1, int dy1, int dx2, int dy2){
while (1 <= x && x <= r && 1 <= y && y <= c){
int h = Measure(x, y);
if (h == expecH)
Pinpoint(x, y);
else if (h > expecH)
x += dx1, y += dy1;
else
x += dx2, y += dy2;
}
}
void Rescue(int r, int c, int rs, int cs, int expecH){
SubRescue(r, c, 1, cs, expecH, 0, -1, 1, 0);
SubRescue(r, c, rs, c, expecH, -1, 0, 0, -1);
SubRescue(r, c, r, cs, expecH, 0, 1, -1, 0);
SubRescue(r, c, rs, 1, expecH, 1, 0, 0, 1);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |