Code: Select all
Case #1:
2
Case #2:
2
Case #3:
1
Case #4:
2
Case #5:
2
Case #6:
5
Moderator: Board moderators
Code: Select all
Case #1:
2
Case #2:
2
Case #3:
1
Case #4:
2
Case #5:
2
Case #6:
5
Thanks for your kind reply, Abednego, Destination Goa !Abednego wrote:I think you misunderstood the problem. How could your print 1 for the first test case?
Code: Select all
++

 2 > 1
  
  
  v
 > 0

++
Code: Select all
3 3
2 1
1 0
2 0
Code: Select all
6
6 7
0 2
0 4
3 2
5 1
3 4
3 5
4 5
6 7
0 1
0 3
0 4
1 2
2 3
2 5
3 4
5 5
0 1
1 2
2 3
3 4
4 0
5 6
0 1
0 2
1 2
2 3
3 4
4 0
5 5
0 2
0 4
1 4
2 3
3 4
5 7
0 2
0 4
1 2
1 4
2 3
2 4
3 4
Code: Select all
Case #1:
4
Case #2:
4
Case #3:
4
Case #4:
3
Case #5:
3
Case #6:
2
Code: Select all
6 7
0 1
0 3
0 4
1 2
2 3
2 5
3 4
Code: Select all
before action
0
/  \
/  1
/  
4  3  2  5
after destroy the trails
0

 1
 
4  3  2  5