hiho Week 13 register

Ended

Participants:460

Verdict:Accepted
Score:100 / 100
Submitted:2014-09-28 09:07:05

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 <stdio.h>
#include <string.h>
#include <string>
#include <map>
using namespace std;
int n, m, fa[101];
char s[1000], t[1000];
int find(int x, int &h)
{
    h = 0;
    while(fa[x] != -1)
    {
        ++h;
        x =fa[x];
    }
    return x;
}
int main()
{
    scanf("%d", &n);
    map<string, int> mp;
    map<int, string> p;
    int k = 0;
    memset(fa, -1, sizeof(fa));
    for(int i=0; i<n; ++i)
    {
        scanf("%s%s", s, t);
        if(mp.find(s) == mp.end())
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX