이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |