# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
28094 | 외않된데? (#71) | The City and The Bitcoin (FXCUP2_city) | C++14 | 296 ms | 65536 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <queue>
using namespace std;
typedef pair<int, int> p;
// city[y][x]; N==x�� ����, M==y�� ����
int city[333][333];
int main()
{
int N, M;
scanf("%d %d", &N, &M);
for (int i = 1; i <= M; ++i)
{
for (int j = 1; j <= N; ++j)
{
scanf("%d", &city[i][j]);
}
}
queue<p> q;
q.push(p(1, 1));
while (!q.empty())
{
p n = q.front();
q.pop();
if (n.first == M && n.second == N)
{
printf("Yes");
return 0;
}
if (n.first + 1 <= M && city[n.first + 1][n.second] == 1)
q.push(p(n.first + 1, n.second));
if (n.second + 1 <= N && city[n.first][n.second + 1] == 1)
q.push(p(n.first, n.second + 1));
}
printf("No");
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |