hiho week 161 register

Ended

Participants:317

Verdict:Accepted
Score:100 / 100
Submitted:2017-07-30 18:07:27

Lang:C#

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
using System;
using System.Collections.Generic;
class Program
{
    public class Graph
    {
        private int[] _node;
        private int[] _next;
        private int[] _value;
        private int _count;
        public int N { get; set; }
        public int M { get; set; }
        public Graph(int n, int m)
        {
            N = n;
            M = m;
            _node = new int[n + 1];
            _next = new int[m * 2 + 1];
            _value = new int[m * 2 + 1];
        }
        public void addEdge(int u, int v)
        {
            _value[++_count] = v;
            _next[_count] = _node[u];
            _node[u] = _count;
            _value[++_count] = u;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX