MSBOP 2015 Round3 register

Ended

Participants:978

Verdict:AC | AC
Submitted:2015-05-09 14:36:30

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<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
int first[110000];
int nnext[220000],tail[220000];
long long f[110000],s[110000];
long long a[110000];
int n,m,x,y,z,p,cas,ca,i,j,k;
long long ans;
void Make(int x,int y){
  nnext[++p]=first[x];;
  first[x]=p;
  tail[p]=y;
  nnext[++p]=first[y];
  first[y]=p;
  tail[p]=x;
}
void Dfs(int u,int fa){
int v,x;
  x=first[u];
  while(x){
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX