随笔分类 -  状压dp

摘要:You are given a grid consisting of n rows each of which is dived into n columns. The rows are numbered from 1 to n from top to bottom, and the columns 阅读全文
posted @ 2020-04-14 12:24 AlexLIN· 阅读(171) 评论(0) 推荐(0)
摘要:给你一个n*n的格子的棋盘,每个格子里面有一个非负数。 从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取的数所在的2个格子不能相邻,并且取出的数的和最大。 Input包括多个测试实例,每个测试实例包括一个整数n 和n*n个非负数(n<=20)Output对于每个测试实例,输出可能取 阅读全文
posted @ 2020-04-14 12:03 AlexLIN· 阅读(185) 评论(0) 推荐(0)
摘要:Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn 阅读全文
posted @ 2020-04-14 10:23 AlexLIN· 阅读(130) 评论(0) 推荐(0)