Submission #39434

#TimeUsernameProblemLanguageResultExecution timeMemory
3943414kg산악 구조대 (JOI13_mountain)C++11
100 / 100
20 ms916 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) { while (get_H(sy + py, sx) > 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...