hiho week 85 register

Ended

Participants:236

Verdict:Accepted
Score:100 / 100
Submitted:2016-02-19 19:54:25

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.util.Scanner;
public class Main {
    
    static int way[][] = {
        {1,0,0,0,0,0,0,0,0,0},
        {1,1,1,1,1,1,1,1,1,1},
        {1,0,1,1,0,1,1,0,1,1},
        {0,0,0,1,0,0,1,0,0,1},
        {1,0,0,0,1,1,1,1,1,1},
        {1,0,0,0,0,1,1,0,1,1},
        {0,0,0,0,0,0,1,0,0,1},
        {1,0,0,0,0,0,0,1,1,1},
        {1,0,0,0,0,0,0,0,1,1},
        {0,0,0,0,0,0,0,0,0,1}};
    static String result = "";
    
    static boolean find(String str,int up)
    {
        if(str.length()==0)
        {
            return true;
        }
        char[] c = str.toCharArray();
        int a = c[0]-'0';
        for(int i=a;i>=0;i--)
        {
            if(way[up][i]==1 && i==a)
            {
                String str1 = String.valueOf(c,1,c.length-1);
                if(find(str1,a))
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX