# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
22674 | dried chocochip on Daegu asphalt (#40) | Young Zebra (KRIII5_YZ) | C++11 | 309 ms | 121060 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;
char mmap[400][400];
int cc[400][400], c_idx;
bool visited[400][400];
int cc_sz[400*400+2];
int di[4] = {-1, 0, 1, 0};
int dj[4] = {0, 1, 0, -1};
char mmap2[2000][2000];
int cc2[2000][2000], c_idx2;
bool visited2[2000][2000];
int cc_sz2[2000*2000+2];
void dfs2(int i, int j)
{
visited2[i][j] = true;
cc2[i][j] = c_idx2;
cc_sz2[c_idx]++;
for(int k = 0; k < 4; k++)
{
int ni = i+di[k], nj = j+dj[k];
if(ni < 0 || ni >= 5*n || nj < 0 || nj >= 5*m) continue;
if(!visited2[ni][nj] && mmap2[i][j] == mmap2[ni][nj])
dfs2(ni, nj);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |