# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
372657 | two_sides | 산악 구조대 (JOI13_mountain) | C++17 | 7 ms | 492 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
void Rescue(int r, int c, int rs, int cs, int x) {
int lim = max({rs + cs - 2, rs - 1 + c - cs,
r - rs + cs - 1, r - rs + c - cs});
auto getRand = [&](int d) {
if (d < 0) return INT_MAX;
if (d > lim) return INT_MIN;
for (int i = 1; i <= r; i++)
for (int j = 1; j <= c; j++)
if (abs(i - rs) + abs(j - cs) == d)
return Measure(i, j);
};
int curd;
for (int d = 1; d <= lim; d++)
if (getRand(d - 1) > x && getRand(d + 1) < x) {
curd = d; break;
}
for (int i = 1; i <= r; i++)
for (int j = 1; j <= c; j++)
if (abs(i - rs) + abs(j - cs) == curd) {
if (Measure(i, j) == x) {
Pinpoint(i, j); return;
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |