hiho week 156 register

Ended

Participants:264

Verdict:Accepted
Score:100 / 100
Submitted:2017-06-26 20:51:58

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f
const int N = 55;
char mapp[N][N];
bool isvis[N][N];
vector<int>G[N*N];
int minn[N*N];
int n,m;
int ind;
const int mv[4][2]={{-1,0},{1,0},{0,-1},{0,1}};
void dfs(int x,int y)
{
    isvis[x][y]=true;
    G[ind].push_back(x*n+y);
    minn[ind]=min(minn[ind],x*n+y);
    for(int i=0;i<4;i++)
    {
        int xi=x+mv[i][0];
        int yi=y+mv[i][1];
        if(xi<0||xi>=n||yi<0||yi>=m||isvis[xi][yi])continue;
        dfs(xi,yi);
    }
}
void solve()
{
    for(int i=0;i<n;i++)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX