完全背包问题是 01 背包问题的进阶问题,解题思路也十分经典,值得仔细研究。 问题概述有 n 种物品和一个容量为 V 的背包,每种物品都有无限件可用。放入第
背包问题是动态规划问题中的经典问题,也是 OJ 题目中的常客,而 01 背包问题则是最简单的背包问题。 问题概述01 背包问题可以使用通用的形式描述为有一个
本题考查了排序算法的灵活运用,尤其是如何减少低效排序算法核心操作数量级。 题目描述 题目大意有 n 个不同的整数组成的数组,对它的唯一合法操作方法就
本题考察扩展欧几里得算法,几乎无需做任何变形,但最重要的是明白扩展欧几里得算法的实现和原理 知识点解析扩展欧几里得算法的目标是求解 a、b 已知的
本题为经典约瑟夫问题的变形问题,思路类似,但解法并不相同,考察对递推状态和相应算法的掌握程度。 题目描述 题目大意假设有 k 个好人和 k 个坏人站成一