摘要: 题目 Rimi learned a new thing about integers, which is any positive integer greater than 1 can be divided by its divisors. So, he is now playing with th 阅读全文
posted @ 2019-07-13 16:29 dgklr 阅读(168) 评论(0) 推荐(0)
摘要: 这道题是一道著名的NP问题。 正解应该是DP,但我在这里讲一种近似算法——爬山。 希望某些 注意一下爬山与模拟退火的区别。 爬山是直往低处往高处爬,每次 ,也就是一种贪心思想。 而模拟退火则是 接受不优解。 不过一次爬山不一定可以找出最优解,要多次随机。 贪心思路如下: 1. 随机数组 2. for 阅读全文
posted @ 2019-07-13 10:27 dgklr 阅读(260) 评论(0) 推荐(0)