hiho week 183 register

Ended

Participants:162

Verdict:Accepted
Score:100 / 100
Submitted:2018-01-02 14:02:40

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 <cstdio>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
//#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <climits>
#include <string>
#include <string.h>
#include <list>
#include <queue>
using namespace std;
#define ENCODE(r,c) (((r) << 10) + (c)) 
int par[1025 * 1025];
bool mat[1024][1024];
int get(int s) {
    if (par[s] == s || par[s] < 0) {
        return s;
    }
    return (par[s] = get(par[s]));
}
bool set(int s, int p) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX