hiho Week 10 register

Ended

Participants:639

Verdict:Accepted
Score:100 / 100
Submitted:2014-09-07 03:39:08

Lang:Java

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
import java.io.*;
import java.util.*;
public class Main{
    static char[] pre;
    static char[] mid;
    static BitTree tree;
    static HashMap<CharacterInteger> map = new HashMap<>();
    public static void main(String[] argsthrows Exception{
        Scanner cin = null;
        cin = new Scanner(System.in);
    //  cin = new Scanner(new FileInputStream(new File("in")));
        String str = cin.next();
        pre = str.toCharArray();
        str = cin.next();
        mid = str.toCharArray();
        init();
        BitTree root = rebuildTree(0pre.length0pre.length);
        postTrace(root);
        System.out.println();
    }
    private static void init(){
        map.clear();
        for(int i = 0i < mid.length++i){
            map.put(mid[i], i); 
        }
    }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX