# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
67039 | RezwanArefin01 | Tracks in the Snow (BOI13_tracks) | C++17 | 958 ms | 297244 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
///usr/bin/g++ -O2 $0 -o ${0%.cpp} && echo "----------" && ./${0%.cpp}; exit;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
const int N = 4010;
char g[N][N];
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int d[N][N], n, m;
int main() {
scanf("%d %d", &n, &m);
for(int i = 0; i < n; i++)
scanf(" %s", g[i]);
deque<ii> q;
memset(d, 63, sizeof d);
q.push_back({0, 0});
d[0][0] = 1 ;
while(!q.empty()) {
ii u = q.front(); q.pop_front();
int x = u.first, y = u.second;
for(int i = 0; i < 4; i++) {
int xx = x + dx[i], yy = y + dy[i];
if(xx >= 0 && xx < n && yy >= 0 && yy < m && g[xx][yy] != '.') {
int c = g[x][y] != g[xx][yy];
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |