# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
495680 | chenwz | Mecho (IOI09_mecho) | C++14 | 229 ms | 22436 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int NN = 2000 + 4, DX[4] = {1, -1, 0, 0}, DY[4] = {0, 0, 1, -1};
#define _for(i, a, b) for (int i = (a); i < (int)(b); ++i)
char G[NN][NN];
int N, S, B[NN][NN];
bool Vis[NN][NN];
struct Point {
int x, y;
};
bool check(const Point& st, int delay) {
if (delay * S >= B[st.x][st.y]) return false;
memset(Vis, 0, sizeof(Vis));
queue<pair<int, Point> > Q;
Q.push({delay * S, st}), Vis[st.x][st.y] = true;
while (!Q.empty()) {
auto p = Q.front();
Q.pop();
int d = p.first, x = p.second.x, y = p.second.y;
if (G[x][y] == 'D') return true;
_for(i, 0, 4) {
int nx = x + DX[i], ny = y + DY[i];
if (nx < 0 || nx >= N || ny < 0 || ny >= N || G[nx][ny] == 'T' ||
(d + 1) >= B[nx][ny] || Vis[nx][ny])
continue;
Q.push({d + 1, {nx, ny}}), Vis[nx][ny] = true;
}
}
return false;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |