任意门:http://poj.org/problem?id=1681 Painter's Problem Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 7667 Accepted: 3624 Description There is a square wall which is made of n*n small square bricks. Some bricks are white while some bric…
Painter's Problem 题意:给一个n*n(1 <= n <= 15)具有初始颜色(颜色只有yellow&white两种,即01矩阵)的square染色,每次对一个方格染成黄色时,同时会把周围的方格也染成黄色.(这和1222的开关一样的关联关系)问最后可以将square全部染成黄色的最小染色方格数? 思路: 1.直接预处理出增广矩阵,和1222不同的是里面有最优解的条件,贪心的思想是把自由变元看成是没染色的,但是其他非自由变元(除去自由维度之外的变量)是可以通过自由变元的取…
任意门:http://poj.org/problem?id=3185 The Water Bowls Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7676 Accepted: 3036 Description The cows have a line of 20 water bowls from which they drink. The bowls can be either right-side-up (pro…