# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
415659 | duyanh1704 | Tracks in the Snow (BOI13_tracks) | C++14 | 847 ms | 119044 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
typedef pair<int, int> ii;
const int maxN = 4000;
const int di[] = {1, -1, 0, 0};
const int dj[] = {0, 0, 1, -1};
int n, m;
char a[maxN + 5][maxN + 5];
int d[maxN + 5][maxN + 5];
bool isInside(int i, int j){
return (i >= 1 && j >= 1 && i <= n && j <= m && a[i][j] != '.');
}
int bfs(){
int ret = 0;
deque<ii> q;
q.push_back({1, 1});
d[1][1] = 1;
while (!q.empty()){
ii t = q.front();
q.pop_front();
ret = max(d[t.x][t.y], ret);
for (int k = 0; k < 4; ++k){
int u = t.x + di[k];
int v = t.y + dj[k];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |