【发布时间】:2020-10-27 02:31:18
【问题描述】:
$width = 10; //width
$length = 10; //Length
$door = 2; // Door area
$square = $width * $length - $door; //Total area to be painted
$perMeter = 1; //Where $w is the amount of paint to paint 1m2
$total = $square * $perMeter; //The total amount of paint is sufficient for painting.
$containers = array(5,12,18,4,8,1); //The values for the number of containers are in liters.
需要多少桶 5,12,18,4,8,1(会逐渐从最大的部分到最小的部分)
【问题讨论】:
-
至少你得知道公式。
-
以最大容器对目标体积取模,然后对体积余数和更小的容器进行取模,直到只能减去 1s。 (甚至不需要背包算法。)
标签: php calculator