Distinct Paths
Time Limit: 2000MS Memory Limit: 262144KB
Description
You have a rectangular n × m-cell board. Some cells are already painted some of k colors. You need to paint each uncolored cell one of the k colors so that any path from the upper left square to the lower right one doesn’t contain any two cells of the same color. The path can go only along side-adjacent cells and can only go down or right.
Print the number of possible paintings modulo 1000000007 ( 109 + 7).Input
The first line contains three integers n, m, k (1 ≤ n, m ≤ 1000, 1 ≤ k ≤ 10). The next n lines contain m integers each — the board.
【CodeForces 293B】Distinct Paths 搜索与剪枝
最新推荐文章于 2019-07-21 21:50:05 发布