hiho week 49 register

Ended

Participants:509

Verdict:Accepted
Score:100 / 100
Submitted:2015-06-06 21:07:26

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;
const int mxn = 10001;
int n, m;
vector<int> e[mxn];
int deg[mxn], vis[mxn], visCnt;
int oddCnt(){
    int ans = 0;
    for(int i = 1; i <= n; ++i)
        if(deg[i]&1) ++ans;
    return ans;
}
void dfs(int f, int x){
    vis[x] = 1;
    ++visCnt;
    for(int i = 0; i < e[x].size(); ++i){
        int &c = e[x][i];
        if(c == f) continue;
        if(!vis[c]) dfs(x, c);
    }
}
bool connected(){
    dfs(0, 1);
    if(visCnt == n) return true;
    else return false;
}
int main(){
    scanf("%d%d", &n, &m);
    int u, v;
    while(m--){
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX