0 人解决,6 人已尝试。
0 份提交通过,共有 12 份提交。
9.9 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
Suppose you had an n by n chess board and a super piece called a kingknight. Using only one move the kingknight denoted ‘K’ below can reach any of the spaces denoted ‘X’ or ‘L’ below:
.......
..L.L..
.LXXXL.
..XKX..
.LXXXL.
..L.L..
.......
In other words, the kingknight can move either one space in any direction (vertical, horizontal or diagonally) or can make an ‘L’ shaped move. An ‘L’ shaped move involves moving 2 spaces horizontally then 1 space vertically or 2 spaces vertically then 1 space horizontally. In the drawing above, the ‘L’ shaped moves are marked with ‘L’s whereas the one space moves are marked with ‘X’s. In addition, a kingknight may never jump off the board. Given the size of the board, the start position of the kingknight and the end position of the kingknight, your method will return how many possible ways there are of getting from start to end in exactly numMoves moves. start and finish are vector
upper bound for a __int64).
First a integer stands for the size of the board,next two lines stand for the start position and the end position,and then a integer is numbers of the moves!
-size will be between 3 and 100 inclusive
-start will contain exactly 2 elements
-finish will contain exactly 2 elements
-Each element of start and finish will be between 1 and size-1 inclusive
-numMoves will be between 1 and 50 inclusive
-The total number of paths will be at most 2^63-1.
your will output how many possible ways there are of getting from start to end in exactly numMoves moves.
3 0 0 1 0 1 /* 3 0 0 2 2 1 */
1 Only 1 way to get to an adjacent square in 1 move /* 0 Too far for a single move */
0 人解决,6 人已尝试。
0 份提交通过,共有 12 份提交。
9.9 EMB 奖励。