hiho Week 13 register

Ended

Participants:460

Verdict:Accepted
Score:100 / 100
Submitted:2014-10-03 16:48:57

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<cstdio>
#include<cstring>
#include<string>
#include<map>
using namespace std;
const int MAX = 100;
struct Person{
    string name;
    Person * father;
    int flag;
    Person(char* s) :name(s), father(NULL), flag(0){}
    void insertFather(Person* aFather) {
        father = aFather;
    }
    
    void markFlag(int val) {flag = val;}
};
void buildTree();
Person* createLink(char *name);
void searchTree();
void markFathers(Person*, int);
Person* findCommonFather(Person*);
typedef map<string, Person*> Persons;
Persons allPersons;
int main() {
    buildTree();
    int n;
    scanf("%d", &n);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX