# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
953583 | roshanVerma | Tracks in the Snow (BOI13_tracks) | C++17 | 2062 ms | 923192 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;
const int N = 4020;
int foxVis[N][N], rabbitVis[N][N];
int h,w,fox;
string forest[N];
void dfs( int x, int y ){
if( x < 0 || x >= h || y < 0 || y >= w || forest[h][w] == '.' ) return;
if( fox ){
if( foxVis[x][y] == 1 ) return;
foxVis[x][y] = 1;
}else{
if( rabbitVis[x][y] == 1 ) return;
rabbitVis[x][y] = 1;
}
dfs(x+1,y);
dfs(x-1,y);
dfs(x,y+1);
dfs(x,y-1);
}
int main(){
cin >> h >> w;
for( int i = 0 ; i < h ; i++ ) cin >> forest[i];
int f = 0, r = 0;
for( int i = 0 ; i < h ; i++ ){
for( int j = 0 ; j < w ; j++ ){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |