# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
953734 | Kakarot | Tracks in the Snow (BOI13_tracks) | C++98 | 80 ms | 159268 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 int int64_t
using namespace std;
void setIO() {
cin.tie(0)->sync_with_stdio(0);
}
bool inside(int x, int y, int n, int m, vector<string> &grid) {
return (x > -1 && x < n && y > -1 && y < m && grid[x][y] != '.');
}
void solve() {
//cout << "zco";
int n, m;
cin >> n >> m;
vector<string> grid(n);
for(auto &x : grid) cin >> x;
deque<pair<int, int>> dq;
dq.push_back({0, 0});
vector<vector<int>> depth(n, vector<int>(n, 1e18));
depth[0][0] = 0;
vector<int> di { -1, 0, 1, 0} , dj { 0, 1, 0, -1};
//auto inside = [](int x, int y, int &n, int &m) { return (x > -1 && x < n && y > -1 && y < m); };
int ans = 1;
while(!dq.empty()) {
auto u = dq.front();
dq.pop_front();
ans = max(ans, depth[u.first][u.second]);
for(int i = 0; i < 4; i++) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |