MSBOP 2015 Round2B register

Ended

Participants:6187

Verdict:AC | TLE
Submitted:2015-04-26 15:59:54

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 <algorithm>
#include <iostream>
#include <cstring>
using namespace std;
typedef long long LL;
const LL inf = 0x3f3f3f3f;
static const int N = 1000100;
int arr[N];
int par[N];
int edge[N];
int V[N];
int p[N];
int res[N];
int use[N];
int find(int x) {
    if (par[x] == x) {
        return x;
    }
    return par[x] = find(par[x]);
}
int main() {
    int t, icase = 1 , u1 , v1;
    cin >> t;
    while (t--)
    {
        int n, m, k;
        cin >> n >> m >> k;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX