#include "grader.h"
int y_len, x_len, H;
int get_H(int y, int x) {
int h = Measure(y, x);
if (h == H) Pinpoint(y, x);
return h;
}
void Find(int sy, int sx, int py, int px, int ey, int ex) {
while (sx != ex && get_H(sy, sx) < H) sx += px;
while (sx != ex) {
while (sy != ey && get_H(sx, sy + py) > H) sy += py;
sx += px;
}
}
void Rescue(int in_y, int in_x, int yS, int xS, int _H) {
y_len = in_y, x_len = in_x, H = _H;
Find(yS - 1, 1, -1, 1, 0, xS);
Find(yS - 1, x_len, -1, -1, 0, xS);
Find(yS + 1, 1, 1, 1, y_len, xS);
Find(yS + 1, x_len, 1, -1, y_len, xS);
for (int i = 1; i <= y_len; i++) get_H(i, xS);
for (int i = 1; i <= x_len; i++) get_H(yS, i);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
6 ms |
384 KB |
Output is correct |
3 |
Incorrect |
5 ms |
384 KB |
Wrong Answer [1] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
13 ms |
384 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |