제출 #39430

#제출 시각아이디문제언어결과실행 시간메모리
3943014kg산악 구조대 (JOI13_mountain)C++11
0 / 100
13 ms384 KiB
#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);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...