hiho week 50 register

Ended

Participants:436

Verdict:Accepted
Score:100 / 100
Submitted:2015-06-18 10:21:09

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>
using namespace std;
const int kMaxN = 1005,kMaxM=5005;
int n, m,path_size=0;
int path[kMaxM];//kMaxMkMaxN
int edge[kMaxN][kMaxN];
void dfs(int p)
{
    for (int i = 1; i <= n; i++)
    {
        if (edge[p][i]>0)
        {
            edge[p][i]--;
            edge[i][p]--;
            dfs(i);
        }
    }
    path[path_size++] = p;
}
int main()
{
    //freopen("input.txt", "r", stdin);
    scanf("%d %d", &n, &m);
    int u, v;
    for (int i = 0; i < m; i++)
    {
        scanf("%d %d", &u, &v);
        edge[u][v]++;//
        edge[v][u]++;
    }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX