hiho Week 15 register

Ended

Participants:1653

Verdict:Accepted
Score:100 / 100
Submitted:2014-10-14 16:46:19

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 <cstdio>
#include <cstring>
#include <map>
using namespace std;
const int N = 100005;
const int M = 200005;
int n, m;
int tot, head[N], to[N], next[N];
int tot1, head1[N], to1[M], id[M], next1[M];
int fa[N], ans[N];
char name[100005][100], name1[100], name2[100];
bool visit[N];
map <string, int> ns;
void addEdge(const int& u, const int& v) {
    to[tot] = v;
    next[tot] = head[u];
    head[u] = tot++;
}
void addEdge1(const int& u, const int& v, const int& i) {
    to1[tot1] = v;
    id[tot1] = i;
    next1[tot1] = head1[u];
    head1[u] = tot1++;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX