# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
344799 | JovanK26 | Tracks in the Snow (BOI13_tracks) | C++14 | 893 ms | 1048576 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;
int n,m;
string mat[4001];
int addx[4]={1,0,-1,0};
int addy[4]={0,1,0,-1};
vector< array<int,2> > pt[2];
int rez=0;
bool check(int i,int j)
{
if(i<0 || i>=n || j<0 || j>=m || mat[i][j]=='.')return 0;
return 1;
}
void dfs(int x,int y)
{
char cur=mat[x][y];
mat[x][y]='.';
for(int i=0;i<4;i++)
{
int c1=x+addx[i];
int c2=y+addy[i];
if(!check(c1,c2))
{
continue;
}
if(mat[c1][c2]==cur)
{
dfs(c1,c2);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |