Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Algorithm 普拉普-奖励预算削减解决方案_Algorithm_Data Structures - Fatal编程技术网

Algorithm 普拉普-奖励预算削减解决方案

Algorithm 普拉普-奖励预算削减解决方案,algorithm,data-structures,Algorithm,Data Structures,我很难理解Pramp针对这个问题给出的解决方案: 奖励预算削减 对于他们在解决方案中所做的事情,我似乎找不到其他解释 我有点理解其他用户建议的其他解决方法: 但我正试图理解以下原因: surplus1 = surplus0 - 1*(grantsArray[0]-grantsArray[1]) surplus2 = surplus1 - 2*(grantsArray[1]-grantsArray[2]) surplus3 = surplus2 - 3*(grantsArray[2]-gran

我很难理解Pramp针对这个问题给出的解决方案:

奖励预算削减

对于他们在解决方案中所做的事情,我似乎找不到其他解释

我有点理解其他用户建议的其他解决方法:

但我正试图理解以下原因:

surplus1 = surplus0 - 1*(grantsArray[0]-grantsArray[1])
surplus2 = surplus1 - 2*(grantsArray[1]-grantsArray[2])
surplus3 = surplus2 - 3*(grantsArray[2]-grantsArray[3])
真的不明白那部分