| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 28198 | lyzqm123 (#71) | 도시와 비트코인 (FXCUP2_city) | C++98 | 9 ms | 2640 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <queue>
using namespace std;
int N, M;
int map[301][301];
int go[301][301];
int main() {
scanf("%d%d", &M, &N);
for (int n = 0;n < N;n++)
for (int m = 0;m < M;m++)
scanf("%d", &map[n][m]);
go[0][0] = 1;
queue<int> q;
q.push(0);
while (!q.empty()) {
int y = q.front() / M, x = q.front() % M;
q.pop();
if (y + 1 < N && map[y + 1][x] && !go[y + 1][x]) {
go[y + 1][x] = 1;
q.push((y + 1)*M + x);
}
if (x + 1 < M && map[y][x + 1] && !go[y][x + 1]) {
go[y][x + 1] = 1;
q.push(y*M + x + 1);
}
}
if (go[N - 1][M - 1])
printf("Yes\n");
else
printf("No\n");
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
