hiho Week 17 register

Ended

Participants:394

Verdict:Accepted
Score:100 / 100
Submitted:2014-10-29 20:23:20

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 <string>
#include <map>
using namespace std;
#define N 10010
#define M 1000
int parent[N];
map<string, int> strToInt;
int strToIntCnt = 1;
string name[N];
int getData()
{
    string a;
    cin >> a;
    if(strToInt.count(a) == 0) {
        strToInt[a] = strToIntCnt;
        name[strToIntCnt] = a;
        strToIntCnt++;
        return strToIntCnt - 1;
    }
    else {
        return strToInt[a];
    }
}
int main()
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX