Cuber QQ got a table of infinite size. He will consider the table rows numbered from top to bottom ∞-infty∞ through +∞+infty+∞, and the columns numbered from left to right ∞-infty∞ through +∞+infty+∞. Then he'll denote the cell in row x and column y as . Initially, there are n trucks at cell respectively. The goal is that each of the trucks have to go to one of the n destinations, located at cell (1,0),(2,0),,(n,0)(1,0),(2,0),cdots ,(n,0)(1,0),(2,0),,(n,0). Cuber QQ has to make sure that there are no two trucks at the same destination. In another word, any two paths of the trucks are non-intersecting . Each truck can go from cell to one of two cells and . And the truck can't have any chance of meeting any other trucks along the way. Now can you help Cuber QQ to find the number of ways that trucks can achieve this goal.
Cuber QQ got a table of infinite size. He will consider the table rows numbered from top to bottom −∞-infty−∞ through +∞+infty+∞, and the columns numbered from left to right −∞-infty−∞ through +∞+infty+∞. Then he'll denote the cell in row x and column y as (x, y). Initially, there are n trucks at cell (0,ai)(0, a_i)(0,ai) respectively. The goal is that each of the trucks have to go to one of the n destinations, located at cell (1,0),(2,0),⋯(n−1,0),(n,0)(1,0),(2,0),cdots (n-1,0),(n,0)(1,0),(2,0),⋯(n−1,0),(n,0). Cuber QQ has to make sure that there are no two trucks at the same destination. In another word, any two paths of the trucks are non-intersecting (no common points). Each truck can go from cell (x, y) to one of two cells (x + 1, y) and (x, y - 1). And the truck can't have any chance of meeting any other trucks along the way. Now can you help Cuber QQ to find the number of ways that trucks can achieve this goal.
标签: HBC225765Another DistiHBCt Values STL 搜索减枝 数据结构 搜索Cells题解