Don't be intimidated. Even though it is apparently exponential, a lot of times you can actually solve it much, much faster.
别怕,即使它,很明显是指数型的,很多时候,你都能更快的解决它。
Well, if intuitively the problem is the result of dividing an int by an int, surely a solution is: "Don't do that," right?
好的,直观地看,如果那个问题的原因是因为整型数除以整型数的话,无疑有个解决方案是:“不要那样做“,是吗?
There's a tendency for people to say, oh this problem's exponential, I can't solve it.
人们往往会说,哦这是个指数型的问题我没法解决它。
Well, I solve 2 or 3 exponential problems before breakfast every day. You know things like, how to find my way to the bathroom is inherently exponential, but I manage to solve it anyway.
你要知道如何找到,我的浴室就是一个,固有的指数型问题,但是我还是能解决它。
On Thursday we'll do a more careful analysis and try and understand how I could have accomplished this seemingly magical task of solving an exponential problem so really quickly.
在周四的时候,我们会做进一步的分析,并且尝试理解我为什么,能如此快速的解决这种,看上去超复杂的指数型问题。
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得到一个解决方案。
应用推荐