hiho week 161 register

Ended

Participants:317

Verdict:Accepted
Score:100 / 100
Submitted:2017-07-30 11:07:56

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<cstdio>
#include<vector>
using namespace std;
int T,n,m;
const int bign = 500;
vector<int> edgelist[bign+33];
int vst[bign+33];
int cnt;
void dfs(int u)
{
    cnt++;
    vst[u] = 1;
    for(int i=0; i<edgelist[u].size(); i++)
    {
        int v = edgelist[u][i];
        if(!vst[v])
        {
            dfs(v);
        }
    }
}
int main()
{
    scanf("%d",&T);
    while(T--)
    {
        scanf("%d%d", &n, &m);
        for(int i=0; i<n; i++)
        {
            edgelist[i].clear();
            vst[i] = 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX