What do you get if you follow the greedy algorithm? What's the first thing the thief does?
如果年贪婪算法你会带走什么呢?,这个贼做的第一件事是什么?
We're exhausting all possibilities. And then choosing the winner. Well, that's what the slow thief tried. Unfortunately it took so long that before he finished the owner returned home, called the police and the thief ended up in jail.
我们穷举了所有可能方案,然后选择最优方案,这就是动作慢的贼的方案,不幸的是它在失主回家之前,要花上了太长的时间。
What should the thief have done?
你们最好的解决方案是什么呢?
It happens. Fortunately, while sitting in jail awaiting trial, the slow thief decided to figure what was wrong. And, amazingly enough, he had studied mathematics. And had a blackboard in the cell. So he was able to work it out.
失主叫了警察然后小偷最后被抓进了监狱,幸运的是这个贼做来牢房里,等待判决时发现了自己的错误,它很惊人的学习过数学,牢房里,还有一个黑板,它可以把题目算出来了。
应用推荐