MSBOP 2015 Round3 register

Ended

Participants:978

Verdict:AC | AC
Submitted:2015-05-09 15:13:01

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 <cstring>
#include <vector>
#include <algorithm>
using namespace std;
const int maxn = 200010;
struct edge{
    int adj, next;
} r[maxn];
int g[maxn], tot;
void ins(int a, int b)
{
     r[++tot].adj = b;
     r[tot].next = g[a];
     g[a] = tot;
}
int n, s;
int d[maxn];
void init()
{
    scanf("%d%d", &n, &s);
    memset(g, 255, sizeof(g));
    tot = -1;
    for (int i = 1; i < n; ++i)
    {
        int a, b;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX