题目链接:
题目大意:有一个 3*n 的矩阵,每个格子里有一个数,你可以选择相邻的两个格子合并成一个,并且权值变为两数乘积,若一个数未合并,权值变为0,求最后权值总和最大值。
题目思路:以 2^3 状态压缩。
#include#include #include #include #include #include #include #include #include #include #include #include #include
本文共 881 字,大约阅读时间需要 2 分钟。
题目链接:
题目大意:有一个 3*n 的矩阵,每个格子里有一个数,你可以选择相邻的两个格子合并成一个,并且权值变为两数乘积,若一个数未合并,权值变为0,求最后权值总和最大值。
题目思路:以 2^3 状态压缩。
#include#include #include #include #include #include #include #include #include #include #include #include #include
转载于:https://www.cnblogs.com/Kurokey/p/5877391.html