# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
446111 | JovanB | Tracks in the Snow (BOI13_tracks) | C++17 | 655 ms | 169724 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>
using namespace std;
typedef long long ll;
typedef long double ld;
int mat[4005][4005];
int n, m;
int mx = 0;
int dist[4005][4005];
void bfs(){
deque <pair <int, int>> q;
q.push_front({1, 1});
for(int i=0; i<=n+1; i++){
for(int j=0; j<=m+1; j++){
dist[i][j] = 1000000000;
if(mat[i][j] == 0) dist[i][j] = -500;
}
}
dist[1][1] = 0;
while(!q.empty()){
pair <int, int> p = q.front();
q.pop_front();
int i = p.first;
int j = p.second;
mx = max(mx, dist[i][j]);
if(mat[i-1][j] == mat[i][j]){
if(dist[i][j] < dist[i-1][j]){
dist[i-1][j] = dist[i][j];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |