hiho week 50 register

Ended

Participants:436

Verdict:Accepted
Score:100 / 100
Submitted:2015-06-16 15:35:21

Lang:GCC

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
int M[1002][1002],N,n,m,u,v;
void D(int i)
{
    while(*M[i]){
        v=N;
        while(!M[i][v--]);
        M[i][++v]--;M[v][i]--;
        M[i][0]--;M[v][0]--;
        D(v);
    }
    printf("%d ",i);
}
main()
{
    for(scanf("%d%d",&N,&m),n=N;m--;) {
        scanf("%d%d",&u,&v);
        M[v][u]++;M[u][v]++;
        M[u][0]++;M[v][0]++;
    }
    while(!(*M[n]%2)&&--n);
    D(n?n:1);
    puts("");
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX