# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
24911 | dotorya | 산악 구조대 (JOI13_mountain) | C++14 | 24 ms | 992 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "grader.h"
void Rescue(int R, int C, int RS, int CS, int X) {
int i, j, k;
int ax = -1, ay = -1;
int x = RS, y = 1;
while (x >= 1 && x <= R && y >= 1 && y <= C && y <= CS) {
int t = Measure(x, y);
if (t == X) ax = x, ay = y;
if (t >= X) x--;
else y++;
}
x = RS, y = C;
while (x >= 1 && x <= R && y >= 1 && y <= C && y >= CS) {
int t = Measure(x, y);
if (t == X) ax = x, ay = y;
if (t >= X) x--;
else y--;
}
x = RS, y = 1;
while (x >= 1 && x <= R && y >= 1 && y <= C && y <= CS) {
int t = Measure(x, y);
if (t == X) ax = x, ay = y;
if (t >= X) x++;
else y++;
}
x = RS, y = C;
while (x >= 1 && x <= R && y >= 1 && y <= C && y >= CS) {
int t = Measure(x, y);
if (t == X) ax = x, ay = y;
if (t >= X) x++;
else y--;
}
Pinpoint(ax, ay);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |