hiho week 49 register

Ended

Participants:509

Verdict:Accepted
Score:100 / 100
Submitted:2015-06-07 11:42:38

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 <stdio.h>
#define MAXN 10000
#define MAXM 50000
using namespace std;
int head[MAXN + 1] = { 0 }; // 0
int p[MAXM + 1];        // 
int Next[MAXM + 1] = { 0 };     // 0
int edgecnt;            // 
int deg[MAXN + 1] = { 0 };
void addedge(int u, int v) {    // (u,v)
    ++edgecnt;
    p[edgecnt] = v;
    Next[edgecnt] = head[u];
    head[u] = edgecnt;
}
int main()
{
    int u, v;
    int N, M;
    int K=0;
    //scanf_s("%d", &T);
    cin >> N >> M;
    //scanf_s("%d%d", &N,&M);
    edgecnt = 0;
    for (int i = 1; i <= M; i++){
        cin >> u >> v;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX