hiho Week 17 register

Ended

Participants:394

Verdict:Accepted
Score:100 / 100
Submitted:2014-10-31 13:14:15

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<string>
#include<map>
#include<iostream>
using namespace std;
class Node
{
public:
    Node()
    {
        father=NULL;
    }
    Node *father;
    string name;
};
map<string,Node*> book;
int main()
{
    int num;
    int i=0;
    string fa,so;
    cin>>num;
    for(i=0;i<num;i++)
    {
        cin>>fa;
        cin>>so;
        map<string,Node* >::iterator l_it; 
        l_it=book.find(fa);
        if(l_it==book.end())
        {
            book[fa]=new Node();
            book[fa]->father=NULL;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX