Codeforces#498F. Xor-Paths(折半搜索)
time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output There is a rectangular grid of size n × m n×m. Each cell has a number written on it; the number on the cell ( i , j i,j) is a i , j ai,j. Your task is to calculate the number of paths from the upper-left cell ( 1 , 1 1,1) to the bottom-right cell ( n , m n,m) meeting the following constraints: You can move to the right or to the bottom only. Formally, from the cell ( i , j i,j) you may move to the cell ( i , j + 1 i,j+1) or to the cell ( i + 1 , j i+1,j). The target cell can‘t be