Submission #39433

#TimeUsernameProblemLanguageResultExecution timeMemory
3943314kg산악 구조대 (JOI13_mountain)C++11
0 / 100
12 ms896 KiB
#include "grader.h" int y_len, x_len, H; int get_H(int y, int x) { if (y <= 0 || y > y_len || x <= 0 || x > x_len) return 0; 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) { get_H(sx, sy); while (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, 1, xS); Find(yS - 1, x_len, -1, -1, 1, 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...