上一页 1 ··· 3 4 5 6 7
摘要: 在计算 xn 时,我们会怎么算呢?如果只是x * x * x * ... * x 这样每个数乘起来计算 n 次的的话,虽然算法简单,但是复杂度为 O(n) ,往往不能满足要求。让我们来考虑加速幂运算的方法。 如果 n = 2k ,可以将其表示为 xn = ((x2)2)... ,只要做 k 次平方运 阅读全文
posted @ 2018-12-25 21:05 Aikoin 阅读(3078) 评论(0) 推荐(0)
摘要: Supermarket Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 17974 Accepted: 8071 Description A supermarket has a set Prod of products on sa 阅读全文
posted @ 2018-12-22 12:18 Aikoin 阅读(227) 评论(0) 推荐(0)
摘要: The Suspects Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 51969 Accepted: 24829 Description Severe acute respiratory syndrome (SARS), an 阅读全文
posted @ 2018-12-09 23:49 Aikoin 阅读(124) 评论(0) 推荐(0)
摘要: Tickets Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 923 Accepted Submission(s): 467 Problem D 阅读全文
posted @ 2018-12-06 22:22 Aikoin 阅读(193) 评论(0) 推荐(0)
摘要: 一道贪心题。贪心的特点是找到局部最优解,做出当前的最好选择,且不能回退,只能一路往前。动态规划主要运用于二维或三维问题,而贪心一般是一维问题。 下面给出题目: Saruman's Army Description Saruman the White must lead his army along 阅读全文
posted @ 2018-12-05 20:13 Aikoin 阅读(269) 评论(0) 推荐(0)
摘要: 动规题一直似懂非懂,今天做了道经典例题,加深理解。 下面给出原题: Problem Description A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a 阅读全文
posted @ 2018-12-03 21:53 Aikoin 阅读(197) 评论(0) 推荐(0)
摘要: 以下部分内容转载自琴影老师博客:这是一个传送门 感谢帮助! 今天做了一道算法题,题目本身不是特别难,内容如下: What Are You Talking About Problem Description Ignatius is so lucky that he met a Martian yest 阅读全文
posted @ 2018-07-15 11:38 Aikoin 阅读(605) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7