hiho week 159 register

Ended

Participants:533

Verdict:Accepted
Score:100 / 100
Submitted:2017-07-18 15:10:16

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 <string>
#include <cstring>
#include <fstream>
#include <functional>
#include <algorithm>
#include <ctime>
#include <cmath>
#include <vector>
#include <queue>
#include <map>
#include <sstream>
#include <unordered_set>
#include <unordered_map>
#include <sstream>
#include <set>
using namespace std;
int mmp[110][110], N, M, X , Y;
bool vis[110][110];
int dirs[4][2] = { 1, 0, 0, 1, -1, 0, 0, -1 };
vector<pair<int, int> > all;
bool IN(int x,int y){
    return x >= 0 && x < N&&y >= 0 && y < M;
}
void dfs(int x,int y){
    
    if (IN(x, y) && mmp[x][y] == mmp[X][Y] && !vis[x][y] ){
        vis[x][y] = 1;
        all.push_back(make_pair(x, y));
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX