859 - Chinese Checkers

All about problems in Volume 8. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
Shaman
New poster
Posts: 1
Joined: Tue Nov 08, 2005 1:53 pm
Contact:

859 - Chinese Checkers

Post by Shaman » Tue Nov 08, 2005 1:55 pm

hello All
Could someone post your test cases and results for this problem.
Tnanx

daveon
Experienced poster
Posts: 229
Joined: Tue Aug 31, 2004 2:41 am
Location: TORONTO, CANADA

Post by daveon » Tue Dec 26, 2006 5:38 am

I've also ran out of ideas. Keep on getting WA. What's the catch?

daveon
Experienced poster
Posts: 229
Joined: Tue Aug 31, 2004 2:41 am
Location: TORONTO, CANADA

Post by daveon » Sun Feb 04, 2007 2:44 am

Here's another try for help...

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 859 - Chinese Checkers

Post by brianfry713 » Fri Mar 30, 2012 2:58 am

No catch, I used a max of 100 by 100 for the board.
Last edited by brianfry713 on Thu Apr 09, 2015 12:00 am, edited 2 times in total.
Reason: Removed invalid I/O
Check input and AC output for thousands of problems on uDebug!

morris821028
New poster
Posts: 13
Joined: Thu Dec 06, 2012 4:07 pm

Re: 859 - Chinese Checkers

Post by morris821028 » Sat Jul 27, 2013 6:53 pm

but my AC output:

Code: Select all

12 19 1
11 18 1
11 20 1


97 18 1




5 7 1
4 6 1
4 8 1

40 1 1
39 2 1


I have confused about "6 9 1".
because (5, 8) not exist, "jump over one other piece" ?
?? Taiwan ! ??????????

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 859 - Chinese Checkers

Post by brianfry713 » Mon Jul 29, 2013 6:05 am

You're right, I edited my previous post.
Check input and AC output for thousands of problems on uDebug!

????????
New poster
Posts: 5
Joined: Mon Nov 11, 2013 7:00 pm

Re: 859 - Chinese Checkers

Post by ???????? » Fri Jan 10, 2014 9:27 pm

i am getting wa..can anyone pls help??it run successfully with the input posted in this thread

Code: Select all

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <map>
#include <sstream>
#include <cmath>
#include <bitset>
#include <utility>
#include <set>
#include <numeric>
#define pb push_back
#define loop(i,a,b) for(int i=a;i<=b;i++)
#define valid(x,y) x>=1&&x<=row && y>=1&&y<=col

using namespace std;
typedef long long       lli;
typedef vector<int>     vi;
typedef pair<int,int>   pi;
typedef vector<pi>      vii;
typedef map<string,int> msi;
typedef map<int,int>    mii;
typedef set<int>        si;
typedef queue<int>      qi;
typedef queue<pi>       qii;
typedef stack<int>      sti;

#define TRvi(c,it)\
    for (vi::iterator it=(c).begin();it!=(c).end();it++)
#define TRvii(c,it)\
    for (vii::iterator it=(c).begin();it!=(c).end();it++)

#define set_val(a,val) memset(a,val,sizeof(a))
#define in_1(a) scanf("%d",&a)
#define in_2(a,b) scanf("%d%d",&a,&b)
#define in_lli(a) scanf("%lld",&a)
#define in_dbl(a) scanf("%lf",&a)
#define in_str(a) scanf("%s",&a)
#define maxm 200

int piece=1,blank=0;

struct node
{
    int row,col,moves;
    node(int a,int b,int c)
    {
        row=a; col=b; moves=c;
    }
    bool operator < (const node& p) const
    {
        if (row==p.row) return col<p.col;
        return row>p.row;
    }
};

int main()
{
    int row,col;
    int step_x[]={0,0,1};
    int step_y[]={1,-1,0};

    int jump_x[]={1,1,1}; freopen("input.txt","r",stdin);
    int jump_y[]={-1,1,0}; bool b=false;

    while(in_2(row,col)==2)
    {
        int board[maxm][maxm];

        set_val(board,blank);

        loop(l,1,4*col)
        {
            int x,y;
            in_2(x,y);
            board[x][y]=piece;
        }
        int src_x,src_y;

        vector<node> destination;

        in_2(src_x,src_y);

        loop(l,0,2)
        {
            int u=src_x+step_x[l];
            int v=src_y+step_y[l];

            if (valid(u,v) && board[u][v]==blank) destination.pb(node(u,v,1));
        }

        qii q;
        q.push(make_pair(src_x,src_y));
        int dist[row+1][col+1],taken[row+2][col+2];
        dist[src_x][src_y]=0;

        set_val(taken,0);taken[src_x][src_y]=1;

        while(!q.empty())
        {
            int u=q.front().first; int v=q.front().second; q.pop();
            bool is_destination=true;

            loop(l,0,2)
            {
                int x=u+jump_x[l]; int y=v+jump_y[l];

                if (valid(x,y) && board[x][y]==piece)
                {
                    int m=x+jump_x[l]; int n=y+jump_y[l];
                    if(valid(m,n) && board[m][n]==blank && !taken[m][n])
                    {
                        dist[m][n]=dist[u][v]+1;
                        is_destination=false;
                        q.push(make_pair(m,n));
                        taken[m][n]=1;
                    }
                }
            }

            if (is_destination) destination.pb(node(u,v,dist[u][v]));
        }
        sort(destination.begin(),destination.end());

        if (b) puts("");
        else b=true;

        loop(l,0,destination.size()-1)
        {
            node top=destination[l];
            if (!top.moves) continue;

            printf("%d %d %d\n",top.row,top.col,top.moves);
        }

    }
    return 0;
}

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 859 - Chinese Checkers

Post by brianfry713 » Thu Jan 16, 2014 1:32 am

Don't read from a file.
Check input and AC output for thousands of problems on uDebug!

@li_kuet
New poster
Posts: 44
Joined: Fri May 25, 2012 6:22 pm
Location: Chittagong, Bangladesh

Re: 859 - Chinese Checkers

Post by @li_kuet » Sat Feb 01, 2014 2:18 pm

Can't find the reason of WA :(
what am i missing ??

Code: Select all

Accepted :)
Last edited by @li_kuet on Tue Feb 04, 2014 10:38 pm, edited 1 time in total.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 859 - Chinese Checkers

Post by brianfry713 » Mon Feb 03, 2014 11:22 pm

Input:

Code: Select all

15 5
1 1
3 2
1 3
1 4
1 5
2 1
2 2
2 3
2 4
2 5
14 1
14 2
14 3
14 4
14 5
15 1
15 2
15 3
15 4
15 5
1 4
AC output:

Code: Select all

3 4 1
1 2 1
Check input and AC output for thousands of problems on uDebug!

@li_kuet
New poster
Posts: 44
Joined: Fri May 25, 2012 6:22 pm
Location: Chittagong, Bangladesh

Re: 859 - Chinese Checkers

Post by @li_kuet » Tue Feb 04, 2014 10:37 pm

Thanks brianfry713 :)
Got AC :)

just_yousef
New poster
Posts: 50
Joined: Tue Dec 17, 2013 11:01 pm

Re: 859 - Chinese Checkers

Post by just_yousef » Sat Apr 05, 2014 7:48 pm

Edit: AC :D
hhhhhhhh you dont want to know what was my mistake >_<

Repon kumar Roy
Learning poster
Posts: 96
Joined: Tue Apr 23, 2013 12:54 pm

Re: 859 - Chinese Checkers

Post by Repon kumar Roy » Sat Sep 27, 2014 9:15 pm

For jumping the dir array is like

Code: Select all

int dir[][2]={{0,2},{0,-2},{2,0},{2,2},{2,-2}};
check it :D
Good Luck

jddantes
Learning poster
Posts: 73
Joined: Sat Mar 08, 2014 8:55 am

Re: 859 - Chinese Checkers

Post by jddantes » Sat Apr 04, 2015 2:35 pm

Why is the input like that? Board is 84 x 87 but there's a piece at (94, 36)?
brianfry713 wrote:No catch, Here's some random input, I used a max of 100 by 100 for the board:

Code: Select all

84 87
78 16
94 36
87 93
50 22
63 28
91 60
64 27
41 27
73 37
12 69
68 30
83 31
63 24
68 36
30 3
23 59
70 68
94 57
12 43
30 74
22 20
85 38
99 25
16 71
14 27
92 81
57 74
63 71
97 82
6 26
85 28
37 6
47 30
14 58
25 96
83 46
15 68
35 65
44 51
88 9
77 79
89 85
4 52
55 100
33 61
77 69
40 13
27 87
95 40
96 71
35 79
68 2
98 3
18 93
53 57
2 81
87 42
66 90
45 20
41 30
32 18
98 72
82 76
10 28
68 57
98 54
87 66
7 84
20 25
29 72
33 30
4 20
71 69
9 16
41 50
97 24
19 46
47 52
22 56
80 89
65 29
42 51
94 1
25 15
88 57
44 92
28 66
60 37
33 52
38 29
76 8
75 22
59 96
30 38
36 94
19 29
44 12
29 30
77 5
44 64
14 39
7 41
5 19
29 89
70 18
18 97
25 44
71 84
91 100
73 26
45 91
6 40
55 87
70 83
43 65
98 8
56 5
49 12
23 29
100 44
47 69
41 23
12 11
6 2
62 31
79 6
21 37
45 27
23 66
9 17
83 59
25 38
63 25
1 37
53 100
80 51
69 72
74 32
82 31
34 95
61 64
100 82
100 97
60 74
14 69
91 96
27 67
85 41
91 85
77 43
37 8
46 57
80 19
88 13
49 73
60 10
37 11
43 88
7 2
14 73
20 100
22 5
40 12
41 68
6 29
28 51
85 59
21 25
23 70
31 85
93 73
73 51
26 86
23 100
41 43
99 14
99 91
25 91
10 82
20 37
33 56
95 5
80 70
74 77
51 56
61 43
80 85
94 6
22 68
5 14
62 55
27 60
45 3
3 7
85 22
43 69
29 90
73 9
59 99
37 9
54 49
4 34
34 49
91 55
68 47
69 30
1 47
89 98
50 91
64 98
54 93
87 26
53 97
76 89
58 30
37 61
15 22
61 5
29 28
51 49
57 3
95 98
40 3
29 4
1 82
48 39
60 52
36 35
40 93
16 28
5 30
50 65
86 30
44 36
78 1
39 72
50 90
68 89
93 96
44 45
30 91
83 41
42 70
27 33
62 43
61 18
24 62
82 10
91 26
97 68
78 35
91 27
25 58
15 69
6 59
13 87
27 95
17 53
79 30
47 91
48 71
52 81
32 94
58 28
15 56
13 91
13 80
11 70
90 75
56 42
21 34
88 89
39 67
71 85
57 18
7 61
50 38
6 60
18 19
46 84
74 59
74 38
90 84
8 79
58 15
72 30
1 60
19 39
26 89
75 34
58 82
94 59
71 100
18 40
70 64
23 95
74 48
32 63
83 91
93 92
58 16
22 58
75 92
48 52
32 22
38 41
55 31
99 26
82 17
17 3
32 40
97 5
39 81
19 22
71 63
78 86
37 5
77 84
8 60
58 45
100 12
19 6
64 50
45 12
6 35
92 76
56 15
90 69
94 19
6 83
23 83
18 31
94 75
27 94
87 54
44 75
15 14
80 78
63 76
89 20
11 33
95 18
47 36
38 92
54 44
74 29
26 92
11 19
11 19
18 37
64 56
91 59
31 5
72 62
34 86
90 74
5 52
6 51
69 4
86 7
96 40
50 21
68 27
64 78
97 82
66 61
37 56
71 19
12 43
33 97
80 22
71 85
73 28
35 41
84 73
99 31
64 48
51 31
74 15
60 23
48 25
83 36
33 5
55 44
99 87
41 79
60 63
63 84
42 49
24 25
73 23
55 36
22 58
66 48
72 77
70 19
2 4
54 34
8 60
29 7
98 21
85 9
35 99
92 77
99 16
53 72
90 60
7 11
17 25
10 40
1 79
10 54
82 15
39 90
27 68
48 24
88 32
33 23
82 76
51 80
91 55
51 32
14 58
95 82
82 4
21 34
83 82
88 16
97 26
5 23
93 52
98 33
35 82
7 16
58 9
96 100
63 98
84 77
55 78
10 88
33 83
22 67
64 61
83 12
86 87
86 31
91 84
15 77
17 21
93 26
29 40
26 91
37 61
19 44
38 29
83 22
11 56
89 26
16 71
38 54
9 23
84 51
58 98
28 27
70 72
52 50
11 29
40 99
89 11
94 78
91 77
100 53
32 88
78 100
58 67
53 18
42 36
69 99
85 96
77 6
67 29
55 29
9 94
79 98
56 73
75 46
1 26
98 84
13 28
94 35
40 35
22 60
86 58
55 62
63 73
42 17
53 51
63 83
63 83
100 18
55 74
16 7
52 65
91 64
92 73
38 38
60 29
72 81
88 57
91 42
71 53
66 12
70 18
62 84
52 13
1 7
39 68
65 90
33 55
5 76
80 42
13 39
70 37
71 57
45 61
50 15
66 15
27 87
84 40
70 36
53 22
94 91
90 10
32 74
65 36
49 96
78 14
34 99
50 56
56 94
69 57
61 34
24 87
72 59
78 41
46 82
62 91
24 51
1 55
76 65
43 25
60 20
90 45
70 39
52 77
84 20
34 44
5 57
82 76
67 12
68 13
93 30
3 69
32 3
75 8
19 17
84 78
88 73
74 58
63 26
34 98
97 19
97 19
42 54
27 75
81 94
86 49
6 31
30 60
99 61
63 25
20 81
42 3
11 81
27 84
90 41
9 24
39 58
94 32
11 21
6 91
14 92
39 71
22 68
30 72
81 44
96 100
25 89
55 87
70 33
70 11
74 31
34 64
88 80
95 50
100 52
40 65
43 31
87 16
50 16
87 82
12 35
34 88
23 88
74 44
20 43
55 45
25 40
60 64
19 54
13 70
6 5
34 100
35 20
16 36
88 54
70 51
88 3
38 63
90 11
6 61
5 12
58 30
4 17
93 22
23 6
44 80
62 29
79 48
1 46
83 88
90 87
54 27
49 95
37 7
8 93
18 65
22 21
81 67
95 55
24 38
34 85
18 13
32 18
10 66
57 9
70 46
96 23
72 96
70 60
2 77
53 72
41 26
44 73
92 90
28 67
79 13
51 97
25 34
14 87
100 71
95 69
16 42
43 40
38 64
99 91
40 3
14 32
29 58
5 72
47 84
39 26
96 41
22 73
27 35
59 26
57 53
46 73
47 40
12 84
4 62
26 43
17 40
75 45
97 31
68 95
14 58
20 61
51 93
33 77
80 91
54 36
96 99
8 42
38 71
77 41
85 2
84 1
93 10
97 41
40 64
36 5
74 7
65 24
52 50
52 31
40 5
66 87
3 26
80 92
48 8
85 32
62 20
32 54
29 28
95 20
44 82
24 69
88 40
44 39
89 95
21 81
99 87
19 53
64 99
96 11
6 80
43 67
99 26
73 79
54 67
98 49
48 73
17 87
13 60
78 1
54 98
33 4
36 52
8 99
50 55
62 7
35 4
26 85
29 98
64 34
16 61
82 15
86 98
1 98
9 30
50 14
80 35
17 15
86 76
31 27
93 17
30 70
53 10
67 16
96 34
29 77
48 14
27 1
63 87
30 64
1 9
98 17
76 83
45 41
21 27
19 66
95 100
35 47
9 54
63 4
87 43
33 35
8 11
35 70
35 70
97 16
85 97
25 83
66 52
17 62
44 38
88 62
3 82
61 89
80 21
42 94
25 29
36 9
63 43
71 97
64 67
12 1
16 88
35 33
91 51
94 34
40 81
95 94
14 55
83 45
76 24
39 52
52 74
12 66
69 82
14 84
100 78
36 15
65 70
47 8
73 92
41 12
24 88
58 37
94 40
82 21
15 72
72 19
97 35
84 65
68 98
1 68
75 36
34 91
58 33
50 30
24 91
93 48
30 50
36 23
41 69
44 56
40 67
26 37
54 61
53 21
58 5
88 84
41 22
27 98
27 98
6 28
79 29
70 71
28 99
21 64
22 61
84 17
68 24
83 93
12 36
54 64
9 63
69 96
99 61
69 77
10 74
4 88
55 74
58 82
24 30
97 45
43 81
13 10
56 48
55 67
35 60
82 43
74 2
39 72
14 59
100 23
85 56
62 91
81 72
24 4
1 21
1 43
53 13
5 8
60 59
26 95
18 59
37 91
61 27
15 74
38 66
49 22
21 10
64 1
33 87
5 34
59 57
28 11
69 32
70 29
42 47
75 59
6 11
2 66
90 68
91 27
33 39
100 6
1 63
58 33
49 62
18 8
70 98
70 39
29 40
19 71
86 93
81 43
55 34
8 44
1 51
22 86
89 21
91 41
35 48
26 84
62 95
43 31
92 64
21 21
55 39
43 93
31 23
35 86
9 95
81 9
45 3
46 85
23 88
26 58
36 3
93 49
97 87
31 41
50 52
13 57
90 55
49 73
29 83
58 89
77 38
98 21
40 95
6 15
83 83
24 70
37 16
18 85
18 85
54 100
25 55
51 37
11 93
43 59
65 24
42 22
12 70
11 61
91 3
56 48
17 90
82 40
59 18
7 76
2 12
75 79
66 78
67 77
70 62
35 34
37 28
7 100
98 17
61 40
71 68
87 87
9 68
78 67
37 36
94 38
47 20
68 13
97 35
41 18
96 75
51 32
3 9
31 52
26 43
91 48
62 77
35 70
96 64
36 32
52 81
21 98
1 89
62 97
75 2
15 70
29 17
53 83
26 83
34 3
78 24
50 91
52 36
61 47
100 48
30 3
29 50
100 29
90 14
77 64
67 91
85 95
60 37
77 85
72 10
39 1
85 40
91 36
76 51
82 27
51 63
29 79
65 80
59 54
45 35
70 12
78 6
58 37
43 35
73 66
96 11
66 33
50 8
68 77
59 2
3 61
64 83
39 28
15 97
34 59
31 55
70 8
60 28
96 2
14 68
19 61
30 36
93 32
44 13
8 54
14 63
14 29
97 52
57 11
100 42
70 82
96 91
90 55
70 37
9 83
5 27
96 34
15 88
65 58
52 25
11 65
39 24
94 35
27 2
46 26
95 67
7 90
57 48
96 27
85 4
61 41
83 56
74 49
6 47
67 68
64 5
91 9
91 69
62 36
94 56
2 52
45 11
52 92
89 36
48 49
76 82
57 1
30 52
50 61
2 65
65 44
73 56
12 34
43 57
41 97
59 11
29 47
98 76
95 25
57 51
26 86
54 20
72 56
81 25
20 97
68 45
4 31
30 47
87 71
95 46
59 53
9 87
99 6
14 45
31 22
48 8
59 1
79 30
8 59
54 80
8 73
76 11
3 5
9 41
27 3
87 86
7 47
24 5
52 38
2 34
11 49
93 70
1 72
51 9
82 57
88 89
29 63
52 84
19 60
24 46
15 62
83 73
8 58
30 12
95 31
45 58
79 38
27 79
61 29
87 42
85 26
83 66
40 34
49 59
45 24
56 11
86 90
84 45
47 13
56 94
43 1
51 21
90 29
51 50
57 38
43 42
15 25
59 55
10 59
65 55
82 20
17 19
61 100
64 7
64 19
100 6
71 2
78 12
30 29
13 87
18 56
80 84
80 90
38 90
48 54
96 81
25 12
100 85
12 15
44 27
85 43
33 8
97 62
19 26
42 32
64 11
87 95
95 18
36 84
59 83
38 54
16 14
18 15
99 81
81 42
7 65
36 39
24 32
53 43
10 46
26 25
57 64
72 3
81 7
86 92
90 75
45 57
89 62
71 39
42 3
80 49
19 67
39 43
51 43
85 60
36 97
25 7
99 57
14 36
48 55
63 45
11 3
58 33
41 52
87 72
100 5
90 90
47 40
85 83
51 73
44 87
69 20
93 19
77 58
54 76
64 16
20 26
70 78
10 10
81 96
33 32
1 23
21 47
14 57
30 65
29 25
51 49
45 95
19 73
5 73
48 68
40 20
94 10
49 55
71 29
51 56
60 51
30 32
49 43
89 78
7 69
55 9
70 99
4 88
71 8
27 4
41 72
65 89
27 87
17 77
42 28
79 23
60 27
66 100
5 24
68 59
33 89
9 88
77 31
95 40
52 73
43 93
45 7
81 23
94 50
99 87
29 77
10 88
3 27
39 59
50 59
69 82
47 29
21 75
59 15
15 63
40 57
55 36
16 35
58 61
36 8
47 65
84 56
4 38
34 43
49 84
1 69
17 47
50 38
22 60
22 43
44 76
78 11
63 87
71 98
94 18
62 29
25 18
67 59
60 67
94 60
87 10
58 36
47 31
96 3
18 17
97 14
93 75
24 7
61 95
4 7
4 7
64 18
35 40
35 53
50 94
19 43
5 6
5 14
93 3
45 88
5 62
57 2
27 49
28 51
55 40
97 10
46 12
27 81
3 13
33 53
58 4
47 62
61 51
28 53
54 72
41 58
85 49
11 12
49 38
14 55
78 62
64 75
25 43
55 27
79 65
43 26
78 3
28 5
55 81
76 47
91 61
95 1
24 43
91 89
97 20
50 13
94 26
55 49
52 61
88 83
25 30
60 3
84 87
7 38
68 35
37 10
47 31
10 70
26 52
58 74
71 59
86 65
84 40
65 87
53 4
69 77
33 28
31 68
67 38
5 34
72 93
95 18
76 56
39 1
39 1
8 48
74 78
58 60
94 93
51 58
79 3
61 48
32 45
27 62
12 93
99 69
78 22
61 72
91 88
80 81
88 87
80 14
64 37
25 10
29 75
67 60
30 28
59 61
72 85
74 36
30 25
4 59
46 16
83 89
4 62
69 43
48 1
56 63
37 32
72 18
59 39
77 88
18 35
100 41
71 73
28 52
97 83
11 95
99 93
83 54
54 3
48 53
55 56
15 92
87 39
61 45
29 89
84 46
23 35
38 45
8 66
97 56
48 7
50 98
51 84
3 4
39 51
56 93
6 22
36 92
12 96
89 40
84 24
37 58
59 27
3 66
92 51
21 91
9 23
89 59
58 91
62 96
41 69
41 98
42 76
42 54
24 30
45 59
53 34
17 11
60 71
28 51
73 1
41 81
75 81
39 32
72 100
80 64
20 20
62 13
47 55
18 70
84 63
29 88
96 97
51 55
67 30
57 39
30 97
19 56
30 9
88 1
8 19
16 79
38 29
91 36
83 9
6 18
23 86
58 70
82 8
24 100
37 80
90 19
28 8
74 57
16 13
9 75
31 77
5 20
57 47
56 40
7 13
9 29
98 66
98 31
73 73
30 62
4 19
32 84
78 57
92 45
70 53
71 52
29 27
24 85
73 31
76 80
95 85
60 92
50 10
74 75
82 3
36 38
73 67
21 2
75 12
46 44
16 68
48 44
94 23
81 18
5 8
97 99
92 9
90 94
18 63
68 51
17 55
88 41
73 60
42 47
24 39
43 39
6 90
83 51
64 15
68 68
22 17
66 66
25 7
59 42
21 26
92 89
80 32
29 52
91 70
98 14
53 17
33 87
67 96
1 86
15 74
2 80
39 78
38 97
19 58
74 63
74 63
46 5
94 26
8 36
47 6
50 6
49 54
74 82
40 40
77 92
78 92
65 31
23 56
9 61
52 27
70 78
41 16
82 34
93 90
70 40
47 71
97 95
97 95
Output from my AC code:

Code: Select all

12 19 1
11 18 1
11 20 1


97 18 1




5 7 1
4 6 1
4 8 1

40 1 1
39 2 1


Here's my code, crashing because of that:

Code: Select all

15 5
1 1
3 2
1 3
1 4
1 5
2 1
2 2
2 3
2 4
2 5
14 1
14 2
14 3
14 4
14 5
15 1
15 2
15 3
15 4
15 5
1 4

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 859 - Chinese Checkers

Post by brianfry713 » Thu Apr 09, 2015 12:08 am

You're right, that I/O is invalid.
New random input:

Code: Select all

74 81
10 36
67 61
70 39
51 4
4 74
17 63
39 32
72 78
13 19
37 80
4 36
38 51
70 9
53 73
61 12
13 58
24 54
6 73
31 5
65 30
28 77
1 52
38 63
24 71
4 78
71 36
5 65
57 54
74 50
50 51
57 8
55 75
22 80
33 23
51 13
12 31
29 63
26 50
63 65
72 75
65 44
50 28
57 65
3 34
45 78
19 62
17 45
40 15
67 72
16 77
72 24
25 42
70 44
48 80
32 66
27 39
68 68
47 70
11 18
61 35
56 40
37 49
11 5
13 78
52 51
24 30
12 50
53 13
31 16
42 71
4 50
62 59
25 29
2 21
38 3
46 75
74 70
68 77
62 72
66 36
65 15
45 49
41 5
38 27
5 38
37 36
28 44
35 57
36 76
42 53
54 51
48 71
73 39
41 80
4 8
55 4
47 33
25 22
26 79
39 74
67 56
56 73
56 64
41 26
46 16
14 16
50 67
39 22
27 33
48 34
13 67
10 54
40 38
54 6
20 20
14 9
5 77
17 24
63 18
60 29
2 76
32 70
62 48
46 77
67 54
22 1
47 29
71 13
44 39
24 63
6 53
53 51
31 6
47 42
30 73
10 72
31 48
39 63
66 20
10 44
58 21
18 63
40 32
50 2
19 44
27 62
14 70
11 14
31 55
19 48
66 43
69 48
46 48
70 38
20 38
28 75
14 75
41 59
14 1
39 29
67 58
11 11
26 55
27 55
33 14
42 9
51 75
2 81
47 36
67 43
54 69
25 67
43 43
23 22
7 54
44 38
7 75
56 76
9 7
66 27
10 21
22 10
25 25
16 7
50 78
40 69
7 36
51 77
34 48
61 55
37 2
69 65
19 75
31 74
14 59
46 35
33 69
39 44
46 4
31 73
62 50
5 15
17 64
73 32
53 27
67 65
45 48
13 54
15 42
68 73
66 81
29 32
10 22
15 16
46 76
31 41
71 17
57 63
15 65
62 44
18 50
37 70
19 74
29 73
18 40
61 68
38 26
41 58
7 45
57 6
3 30
41 18
25 20
64 60
56 28
61 45
40 64
39 27
28 43
17 41
44 18
10 71
47 78
10 40
60 71
60 30
35 10
17 81
28 62
54 63
66 16
60 35
71 27
14 6
46 14
40 8
73 24
60 72
42 76
52 27
63 16
32 71
26 31
63 9
45 74
53 70
62 55
9 23
72 18
61 40
46 18
54 30
38 67
30 23
48 35
10 78
4 77
12 11
8 61
12 47
38 46
49 28
30 55
34 19
61 50
23 32
7 19
8 31
15 53
37 61
18 21
67 48
21 75
71 62
69 12
30 43
3 25
56 42
15 23
26 26
44 60
46 58
34 12
46 60
26 66
4 5
25 45
28 68
70 31
55 13
13 9
63 32
24 23
28 11
63 17
32 50
41 79
9 37
40 71
39 68
40 5
64 11
68 75
66 38
40 8
39 35
10 5
24 14
7 9
2 5
1 21
35 9
2 35
4 35
24 22
19 14
37 3
20 30
25 23
34 13
26 22
5 4
35 26
36 9
39 35
34 21
22 11
12 20
23 24
17 10
27 2
21 25
13 27
7 27
3 4
10 7
21 27
2 4
20 5
18 28
36 24
29 20
5 33
39 3
8 17
5 19
38 31
29 25
32 1
23 15
37 29
33 30
9 12
24 21
38 3
27 7
28 9
19 10
6 10
30 2
21 4
3 32
39 6
1 33
1 26
23 3
5 18
35 5
7 19
28 11
3 24
16 11
19 19
39 15
23 12
17 33
9 23
3 35
18 30
6 33
24 19
25 16
18 25
15 22
6 13
16 8
36 21
22 31
14 26
1 29
5 12
35 7
35 30
10 2
19 5
30 28
20 1
29 29
2 28
19 28
37 17
9 16
34 18
18 20
35 25
32 4
19 22
8 19
21 2
19 1
33 29
26 26
12 26
4 24
14 7
9 30
17 2
20 19
29 7
25 35
33 16
31 9
12 9
27 18
25 3
28 2
32 30
18 19
30 22
1 27
39 1
39 21
39 23
17 20
28 5
29 3
11 26
6 5
21 10
32 2
37 4
12 28
35 28
24 17
23 31
28 20
3 24
57 31
31 31
3 9
8 8
11 14
1 25
55 26
42 24
50 24
10 17
14 21
35 30
27 4
53 8
10 31
52 23
23 16
31 17
38 14
28 12
2 20
19 25
37 3
49 18
37 7
51 20
35 13
23 7
9 2
19 13
30 2
1 4
14 22
36 5
45 11
17 28
26 17
19 8
13 4
50 12
17 4
46 16
40 20
17 19
46 17
30 3
57 1
53 5
12 25
33 19
22 8
21 21
21 6
2 18
15 31
40 4
57 26
15 29
23 21
37 29
24 30
54 13
46 31
33 13
51 24
37 20
46 2
25 6
29 9
2 9
4 21
34 24
49 15
53 28
25 3
23 8
13 25
3 19
48 23
3 5
43 17
43 25
11 30
16 28
26 29
29 8
12 31
48 1
7 1
1 18
11 17
56 11
48 12
42 9
47 10
38 21
29 22
22 15
9 24
31 24
55 25
8 14
19 26
52 22
52 10
18 11
54 29
21 19
4 1
50 28
39 19
29 6
26 19
14 29
33 26
57 29
14 12
15 26
47 12
21 15
17 10
2 6
30 13
39 30
23 28
11 17
53 100
19 88
4 87
2 88
47 76
49 57
17 6
51 24
18 86
1 60
29 99
15 40
15 47
7 22
49 84
5 68
46 24
23 96
43 51
8 55
8 75
50 83
9 80
5 62
37 22
32 15
21 43
33 16
30 83
28 88
19 7
10 2
35 13
49 95
34 83
17 40
17 12
23 88
39 80
29 61
12 73
44 76
11 81
25 57
20 28
1 81
11 54
6 19
20 82
26 32
15 61
19 21
34 97
35 68
48 9
19 80
7 54
48 49
43 46
14 97
51 52
2 63
10 22
22 92
31 60
2 75
25 28
48 41
32 98
26 74
5 34
38 84
27 13
51 42
47 5
32 90
13 49
41 45
43 47
35 26
3 43
6 39
29 75
11 69
32 83
36 1
47 22
46 2
25 64
18 47
16 88
49 85
19 39
28 10
2 68
7 43
3 40
41 33
22 63
37 38
13 95
15 14
17 26
15 54
29 10
18 61
39 87
30 38
6 26
11 9
24 34
22 4
39 36
35 39
39 88
18 48
16 18
14 54
18 79
31 89
39 6
47 90
39 46
6 68
38 73
9 65
44 32
12 83
38 59
26 69
21 1
31 32
1 76
47 65
30 44
42 95
51 54
49 93
16 62
17 22
18 44
1 9
25 90
32 51
19 65
19 26
35 73
19 33
16 60
10 94
41 78
30 89
32 97
15 34
24 87
19 8
26 97
28 61
47 83
25 49
5 18
18 95
42 27
25 30
41 55
51 91
51 73
21 54
51 32
23 65
19 53
30 15
23 51
52 79
45 96
48 77
53 37
35 69
51 41
16 93
1 66
22 87
42 98
50 19
24 76
37 75
8 35
2 40
11 28
19 61
14 25
20 10
22 16
17 67
22 85
29 73
11 80
51 98
53 88
21 91
41 87
2 6
42 94
32 39
29 31
35 28
47 48
15 99
28 91
10 75
14 38
29 24
46 10
33 99
52 89
46 64
36 58
33 53
30 65
33 27
19 93
4 2
47 94
17 7
28 70
28 58
53 32
43 28
30 58
36 89
1 19
14 73
2 73
17 78
47 19
14 37
10 9
13 56
13 42
34 38
12 47
7 74
12 32
35 18
30 79
47 86
4 62
45 24
11 35
14 24
36 56
47 17
1 1
26 21
14 85
32 57
46 57
47 60
46 83
23 28
9 9
2 23
22 34
19 84
26 15
51 20
24 58
36 6
21 15
33 36
31 73
49 53
8 83
11 13
20 47
10 50
39 38
50 58
44 92
36 11
20 54
17 32
33 97
29 100
15 68
48 27
20 60
8 58
12 18
1 74
13 10
21 40
19 6
33 71
18 20
7 13
31 52
17 35
18 41
11 32
40 10
40 67
47 92
13 45
45 80
36 87
1 57
8 19
21 94
37 60
40 14
29 1
2 11
37 33
36 4
49 1
8 14
20 76
22 7
28 21
35 29
4 8
1 4
4 64
14 67
28 6
45 79
7 50
24 90
29 57
12 60
49 79
25 4
22 11
38 7
17 41
23 66
28 48
10 80
18 83
15 33
38 65
38 15
16 90
8 95
36 24
41 65
12 11
43 14
47 24
48 70
26 20
52 49
4 78
17 65
48 8
23 2
34 60
53 10
9 64
29 82
50 73
45 25
53 52
18 76
52 38
1 35
32 3
13 46
47 50
11 50
32 20
6 13
8 56
9 55
50 59
34 65
32 85
11 18
17 83
3 64
51 94
17 29
38 87
26 94
10 31
7 89
15 32
12 9
53 83
28 18
20 55
33 38
37 19
37 20
6 78
9 73
35 93
25 83
40 69
17 96
28 58
17 51
3 35
4 33
12 44
7 21
7 7
4 7
9 25
13 13
2 47
13 45
1 20
16 34
2 4
14 9
7 43
16 26
9 36
15 11
11 29
15 18
2 26
7 1
17 10
13 26
13 16
2 5
2 1
4 3
12 8
3 10
16 18
9 49
11 41
9 4
9 14
12 27
5 18
11 12
1 14
3 31
13 5
1 39
13 46
15 7
11 51
7 19
5 6
5 30
2 42
14 31
16 32
9 34
2 28
4 22
6 46
9 35
14 24
8 41
7 39
4 38
14 16
9 27
17 50
14 49
4 5
5 22
7 16
1 12
10 26
13 49
6 11
12 45
6 19
12 37
17 28
11 2
8 50
7 2
7 34
10 41
3 28
6 15
8 37
16 36
13 39
11 9
6 22
11 14
16 30
6 34
5 39
15 29
14 34
16 23
17 9
16 14
14 48
7 46
17 17
1 13
12 3
15 14
1 37
5 44
16 46
6 23
3 13
2 51
9 8
11 15
17 1
5 43
14 17
11 38
17 25
1 25
13 44
5 36
4 28
7 15
6 43
14 22
7 32
11 32
16 15
6 20
5 16
6 5
14 6
4 23
4 34
1 41
1 6
8 38
9 20
14 39
15 45
11 25
8 26
6 21
2 44
10 24
5 49
3 17
3 7
16 37
13 50
16 21
11 22
1 36
15 22
15 30
15 42
3 14
17 8
17 18
14 4
15 34
3 34
14 44
2 9
8 9
3 26
13 28
11 19
15 8
14 38
6 24
17 12
14 7
7 23
7 38
13 18
11 43
10 38
12 2
17 49
13 35
16 1
1 11
6 48
17 41
2 16
14 46
15 31
13 51
15 36
10 35
7 22
12 7
15 17
3 49
6 14
5 37
8 11
7 14
7 36
13 47
4 10
5 14
14 15
5 20
17 16
15 2
5 36
70 96
26 81
1 57
40 95
16 40
11 28
49 86
64 34
30 29
48 62
36 58
26 64
49 27
30 7
67 28
38 86
33 51
19 15
36 62
43 44
54 18
39 34
19 39
60 60
18 7
11 80
60 38
48 33
56 91
39 43
8 19
28 22
46 41
38 15
55 88
10 17
55 27
28 91
1 47
69 36
53 43
3 90
22 93
26 27
37 22
42 6
65 3
24 42
3 79
10 25
12 17
37 15
21 90
11 11
34 31
51 60
42 33
11 25
57 79
12 19
42 57
21 12
63 20
29 37
58 44
5 39
11 38
19 7
59 62
64 7
62 96
50 37
50 55
50 93
51 49
13 8
67 39
70 35
30 40
7 27
20 3
28 16
64 22
14 71
17 71
17 15
4 14
53 38
68 48
44 40
34 48
70 8
31 35
42 80
50 80
7 29
1 44
52 26
33 34
70 52
14 44
70 78
24 52
25 93
38 52
11 67
53 52
43 25
20 52
15 31
4 83
22 22
8 7
21 30
10 15
43 48
60 18
65 83
48 47
58 41
16 52
27 68
7 21
47 60
25 69
60 12
35 21
55 20
26 47
35 3
61 34
12 55
61 46
17 88
36 88
64 29
1 75
15 17
43 29
68 7
63 6
48 87
68 18
10 85
61 26
12 61
63 73
55 78
41 28
45 50
17 69
11 30
13 15
48 13
15 26
64 11
45 69
45 24
15 74
31 87
39 36
67 30
64 6
51 2
53 47
52 19
5 66
28 33
16 94
14 26
5 33
48 21
47 68
56 59
7 79
57 36
52 7
55 54
26 41
57 91
59 87
10 11
32 11
46 37
8 94
63 7
64 41
18 61
54 54
7 84
31 47
5 16
67 95
44 29
49 42
53 66
56 51
8 87
41 51
15 65
56 63
45 1
12 81
38 81
66 10
62 85
34 52
1 31
34 90
60 71
41 39
33 70
16 53
42 24
5 7
61 92
17 62
66 3
8 49
54 69
43 83
15 52
68 76
24 54
31 25
2 63
11 20
48 60
60 27
10 29
57 74
68 39
13 67
11 78
37 92
34 45
4 43
26 52
18 17
45 26
27 36
48 72
33 91
67 86
40 53
37 81
9 37
53 35
68 6
37 4
40 44
22 50
41 3
68 71
28 43
14 83
16 96
65 84
22 1
58 87
67 72
52 15
15 58
47 94
65 15
67 49
53 14
54 25
22 35
4 75
29 41
7 62
5 73
18 38
15 91
40 93
52 67
39 14
32 59
40 76
49 36
12 76
11 9
36 59
42 16
63 76
67 10
25 33
26 77
46 5
15 8
15 43
41 94
26 45
39 80
44 2
37 42
9 62
44 75
55 60
38 69
57 39
57 3
19 33
16 63
32 17
21 68
30 72
62 27
2 16
10 26
29 40
2 57
31 26
6 40
44 67
41 18
23 91
66 14
33 61
60 52
57 18
6 77
28 29
59 13
36 11
38 88
64 74
30 84
21 13
65 2
59 51
36 4
11 29
27 26
28 45
22 71
41 5
41 64
19 14
28 86
49 21
68 33
29 73
16 16
40 20
68 21
58 2
39 88
32 65
38 39
29 93
55 10
38 91
70 92
39 15
58 12
1 48
28 81
65 5
32 1
26 59
36 42
44 93
60 54
3 17
32 13
54 77
1 80
5 23
29 15
20 83
56 78
31 72
8 75
23 10
41 83
52 62
32 73
2 25
53 39
3 28
33 21
8 1
3 22
7 27
25 82
10 48
8 39
9 82
3 81
16 10
23 7
20 19
6 5
14 24
24 53
2 66
7 55
2 21
10 31
18 32
16 43
23 36
1 1
16 49
6 13
25 49
15 80
23 4
2 30
19 23
8 4
18 58
3 56
20 47
5 47
7 47
16 78
20 10
12 39
21 82
22 38
22 74
16 36
7 38
6 24
20 68
22 67
3 9
9 42
14 45
11 52
12 18
1 15
18 47
20 9
10 15
4 1
24 14
13 20
18 67
8 67
12 46
18 50
10 36
22 22
5 71
5 2
8 9
12 1
2 68
8 21
23 21
19 45
4 46
11 1
21 59
16 22
6 73
4 67
8 82
10 16
9 81
7 43
23 33
24 37
19 77
24 41
3 16
8 25
22 36
22 73
22 78
25 25
1 56
14 49
12 80
2 67
23 82
23 55
12 43
20 51
6 67
25 57
11 16
15 63
1 25
2 64
1 64
2 8
5 17
15 14
17 40
14 10
3 28
10 74
11 76
23 30
21 53
23 62
6 2
6 47
21 29
6 37
2 33
21 58
12 51
9 33
5 70
22 66
21 26
1 22
2 28
6 49
16 52
18 6
11 60
5 75
17 80
10 67
1 18
20 43
12 33
3 74
21 61
20 39
18 17
13 11
5 3
18 30
3 43
17 72
25 73
3 38
6 8
3 45
12 59
18 75
14 22
16 31
21 45
5 8
7 46
11 25
14 81
7 22
15 11
4 66
1 77
6 74
24 45
16 29
9 45
10 32
7 11
10 70
14 50
17 38
10 65
9 36
16 57
21 17
15 50
5 62
7 77
15 48
5 72
15 27
4 61
13 59
17 11
15 43
10 75
1 38
19 33
12 53
9 63
4 42
14 20
23 39
19 2
9 28
20 30
15 39
24 17
24 54
8 10
8 20
2 12
12 14
6 3
22 13
25 6
16 44
3 34
11 63
23 61
13 51
11 34
4 15
4 56
7 7
8 62
13 1
3 14
2 34
5 74
25 4
7 5
25 77
16 76
25 33
13 34
8 45
23 48
24 74
8 75
19 12
8 37
22 3
20 40
5 34
9 74
7 29
19 76
5 15
22 49
3 17
9 57
21 63
7 12
20 41
12 66
23 69
14 53
14 42
21 80
12 56
24 25
6 61
20 33
14 48
3 44
23 13
19 47
21 68
20 54
4 82
5 78
5 60
2 62
15 16
1 52
13 37
9 61
19 28
16 8
10 8
17 82
24 21
23 10
22 23
25 65
24 8
19 66
25 79
6 69
18 26
8 72
24 4
16 21
13 56
20 6
21 74
20 44
23 43
24 72
15 73
7 72
9 23
9 10
17 22
17 12
5 67
6 40
3 31
5 28
19 21
16 66
4 53
17 55
18 11
6 16
5 31
10 42
4 23
12 52
13 54
10 11
20 58
17 30
24 50
14 11
16 42
14 67
6 59
17 70
25 30
11 62
2 10
18 36
17 63
15 77
16 18
8 20
16 11
7 6
2 9
6 2
15 1
12 1
15 6
5 11
11 7
5 8
14 6
3 8
9 5
15 4
16 4
4 11
7 3
10 5
16 9
9 6
11 4
1 3
14 10
7 10
3 6
15 5
11 10
8 6
5 5
6 3
2 4
7 2
5 10
12 7
14 1
8 4
5 4
7 1
10 1
9 10
10 7
7 7
11 8
13 8
8 10
15 6
61 76
2 71
1 7
59 29
33 27
12 76
5 1
48 41
44 11
24 67
51 38
36 70
14 10
28 16
37 45
26 72
25 42
6 7
30 45
1 42
36 72
37 14
11 32
48 49
10 17
57 8
31 53
31 67
27 27
50 30
13 1
22 3
44 46
4 30
31 15
18 25
20 51
50 22
19 47
26 64
47 64
31 72
56 13
2 57
61 7
22 50
8 50
52 65
10 32
6 49
1 44
48 56
19 50
55 40
12 26
8 38
43 22
14 69
41 50
60 29
6 75
57 19
4 9
5 23
42 57
56 25
35 23
5 58
20 36
33 47
18 48
29 74
19 72
39 75
58 70
43 72
59 44
17 72
25 54
17 47
32 60
50 74
56 15
1 17
54 76
46 51
14 26
12 12
56 69
35 37
27 52
57 10
55 62
28 10
24 13
60 66
15 74
7 65
8 70
50 48
12 7
6 47
40 49
13 59
55 72
32 56
6 52
5 57
44 20
19 56
50 42
20 42
11 65
20 24
29 66
13 57
16 7
3 46
21 37
9 3
58 62
9 53
6 40
37 54
56 23
57 31
15 35
50 59
46 57
45 37
20 1
55 75
18 16
30 2
15 28
56 8
19 19
13 7
17 34
13 72
46 49
57 60
26 53
24 46
55 65
26 36
6 54
49 28
17 49
2 61
59 6
44 14
2 68
43 37
47 19
30 5
4 14
30 14
11 46
41 55
4 20
18 55
26 19
34 6
26 67
16 68
32 74
40 35
58 56
52 14
16 75
14 5
50 21
52 33
41 33
3 56
40 41
53 66
29 72
51 67
1 1
8 2
15 75
47 10
23 48
51 24
48 65
9 15
9 73
35 44
56 63
30 73
53 50
7 26
4 25
4 63
49 35
53 42
51 69
19 69
6 67
13 17
21 5
52 54
24 29
56 10
57 36
47 52
53 65
40 18
44 43
26 76
28 33
33 50
50 9
29 4
12 56
1 29
4 13
13 37
56 6
60 11
10 49
42 30
21 67
48 8
50 12
7 8
45 29
58 64
33 49
45 65
48 47
2 20
10 29
53 53
25 8
47 30
7 9
37 49
49 61
33 64
37 19
53 72
20 68
55 23
20 66
38 23
26 43
59 52
54 54
42 60
41 31
52 56
56 28
17 71
52 24
20 40
31 9
4 51
42 55
22 76
30 16
60 75
22 68
19 51
9 52
31 20
46 76
29 15
8 14
52 8
48 36
41 45
12 31
9 74
14 41
28 66
6 36
7 46
53 64
23 47
16 8
49 25
10 72
4 32
25 32
25 50
26 27
31 44
22 27
39 76
60 3
39 14
7 1
21 9
54 40
39 49
39 42
54 18
17 64
9 28
24 48
60 64
10 16
4 20
32 18
15 13
22 4
7 7
24 8
26 17
28 3
3 2
1 13
28 1
15 8
28 12
14 5
3 6
8 8
17 1
27 16
16 11
17 12
19 10
5 16
22 13
30 13
20 7
31 17
27 1
15 10
2 16
29 4
14 2
26 12
20 16
29 15
4 7
25 4
20 5
2 4
29 1
2 10
29 2
31 9
12 13
13 9
8 13
16 9
12 1
19 13
29 7
2 2
22 9
22 5
24 11
21 3
2 8
24 6
8 3
12 14
8 17
7 12
6 11
9 15
3 12
32 14
18 3
14 8
7 18
2 13
19 14
8 1
28 16
14 3
7 2
9 16
27 16
AC output:

Code: Select all

41 8 1
40 7 1
40 9 1

5 24 1
3 23 1
3 25 1

12 17 1
11 16 1
11 18 1

30 56 1
29 58 1
28 57 1
28 59 1

6 36 1
5 35 1
5 38 1
5 40 2

8 27 1
7 26 1
7 28 1

12 26 3
10 24 2
9 20 1
8 19 1
8 22 1

16 6 1
15 7 1

5 20 1
4 19 1
4 21 1

31 12 3
29 14 2
29 16 1
27 15 1
27 17 1
Check input and AC output for thousands of problems on uDebug!

Post Reply

Return to “Volume 8 (800-899)”