hiho Week 12 register

Ended

Participants:337

Verdict:Accepted
Score:100 / 100
Submitted:2014-09-24 16:49:35

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 <algorithm>
#include <set>
using namespace std;
int n, m;
const int MAX = 1000000;
struct node{
  int id;
  int value;
  node *parent;
  set<node *> children;
};
void print(int rid, int **array){
  cout << "id=" << rid << "\t";
  for(int i=0; i<n-m+1; ++i){
    cout << array[rid][i] << "\t";
  }
  cout << endl;
}
void f(node *root, int **array){
  int rid = root->id;
  if(root->children.empty()){
    array[rid][1] = root->value;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX