我不想偷其他人的点数,因此这里是我得到解决方案的链接。
I do not wish to steal other people's credits so here is the link where I got the solution from.
通过简化问题,我认识到,把问题分解得越细,越同意得到解决方案。
By simplifying, I realized that the more I broke a problem down, the easier it was to work towards an answer.
一个适当的图形会使题目中的各种关系变得清晰并由此得到解决方案。
A picture or diagram of the situation can often clarify the relationships in the problem and suggest a solution.
And when you have an optimal substructure and the local solutions overlap, that's when you can bring dynamic programming to bear.
当你得到一个最优子结构,但局部解决方案有重跌时,你就可以引入动态编程,来解决这个问题了。
The notion here is that you can get a globally optimal solution from locally optimal solutions to sub-problems.
这里的概念是你可以通过,子问题的局部最优方案,得到全局优化解决方案。
First of all, two parameters. It's OK. All it says is, when I call this, I need to pass in two parameters for this to work. All right? Now, if I want to use that, I'm going to use a second piece of code here, called Barnyard. I'm going Barnyard to read in a couple of values, convert them into integers, and then I'm going to use solve to get a solution out.
注意我得到了什么,第一,两个参数,它的意思就是我调用这个函数,我得给它输入两个参数,明白了吗?,现在如果我要使用它我得用,这里的第二段代码,也叫,我将读入一组值,将它们转化为整型,然后我会用solve得到一个解决方案。
应用推荐