随笔分类 -  贪心

摘要:There is a fishing game as following: The game contains n stages, numbered from 1 to n There are four types of stages(numbered from 0 to 3): type 0: T 阅读全文
posted @ 2020-07-19 11:09 ice--cream 编辑
摘要:题目描述 你有一个长度为 n 序列 (序列下标从1开始) ,每次可以从任意位置 i 花费 ai*i 的代价来把 ai 删除。 注意,删除后 ai 后面的数会依次向前补上(下标 -1 ) 。 求把整个序列删完的最小代价。 输入描述: 第一行一个整数 n ,第二行 n 个整数代表该序列。 输出描述: 一 阅读全文
posted @ 2020-07-15 08:49 ice--cream 编辑

点击右上角即可分享
微信分享提示