摘要: 阅读 Description Input Output Sample Input 0 10 4 10 2 3 10 8 5 Sample Output -20 HINT Main idea 从K走向M,路上有n个收益点,表示到了pos位置可以增加val的收益,每次最多可以走D步,走一次损耗A。求最大 阅读全文
posted @ 2017-03-02 21:22 BearChild 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 字符串匹配 Description Input Output Sample Input 3 3 6 3 1 2 1 2 3 2 3 1 3 6 3 1 2 1 2 1 2 3 1 3 6 3 1 1 2 1 2 1 3 1 3 Sample Output 3 1 2 4 4 1 2 3 4 3 2 阅读全文
posted @ 2017-03-02 20:37 BearChild 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 冒泡排序 Description Input Output 仅一行一个整数表示答案。 Sample Input 4 5 7 9 13 Sample Output 2 HINT Main idea 按照题意生成排列,问要几轮冒泡排序可以让其有序(从小到大)。 Solution 首先我们先根据冒泡排序的 阅读全文
posted @ 2017-03-02 20:30 BearChild 阅读(210) 评论(0) 推荐(0) 编辑