Given an array of integers, return indices of the two numbers such that ...
有 N 件物品和一个容量为 V 的背包。第 i 件物品的费用是 c[i],价值是 w[i]。求解将哪些物品装入背包可使价值总和最大 f[i][v...
要求要求恰装满背包在初始化时除了 f[0]为 0 其它 f[1..V]均设为-∞,这样就可以保证最终得到的f[N]是一种恰好装满背包的最优解。可...
有 N 种物品和一个容量为 V 的背包,每种物品都有无限件可用。第 i 种物品的费用是 c[i],价值是 w[i]。求解将哪些物品装入背包可使这...
There is a fence with n posts, each post can be painted with one of the ...
Given a positive integer n, find the least number of perfect square numb...
Given an unsorted array of integers, find the length of longest increasi...
Given an integer array nums, find the sum of the elements between indice...
Given a 2D matrix matrix, find the sum of the elements inside the rectan...