John and Brus are building towers using toy bricks. They have an unlimited supply of bricks of C different colors. Each brick is a 1x1x1 cube. A tower of height X is a 2x2xX rectangular prism, built using 4X bricks.
John and Brus want their towers to look nice. A tower is nice if it has the following two properties:
1.There are at most K pairs of neighboring bricks with the same color. (Two bricks are neighboring if they share a common side.)
Topcoder SRM554 Hard : TheBrickTower(矩阵快速幂)
最新推荐文章于 2018-06-01 10:05:56 发布