Guards(https://acs.jxnu.edu.cn/problem/GYM103536A)

描述:

There are NN prisoners in jail cells numbered from 00 to N−1N−1 and GG guards. The guards ensure the prisoners do not escape and can only take charge of adjacent segments of jail cells. Each jail cell is assigned to exactly one guard.

Each prisoner ii has a certain intelligence SiSi, and if the guard is watching him has kk people to watch over, his escaping possibility will be kSikSi. You should assign the guards so that the total escaping possibility over all the prisoners is minimized.

输入:

The first line of input contains 22 integers NN and GG (1≤8000≤N,1≤3000≤G1≤8000≤N,1≤3000≤G).

The next NN lines of input will contain one integer each, SiSi (1≤Si≤1091≤Si≤109).

输出:

The output should contain one line with one integer, the minimum total escaping possibility.

翻译:监狱牢房里有n个编号为0到n-1的囚犯还有g个守卫.守卫只能负责相邻的牢房并且需要确保囚犯无法逃跑.每个牢房有一个守卫.每个囚犯i有智商si,如果守卫需要看管k个囚犯,那么囚犯逃跑的概率为ksi.你应该分配守卫以保证囚犯最小的逃跑概率.

输入:第一行输入2个整数n和g)1<=8000<=n.1<=3000<=g.

接下来n行输入一个整数si(1<=si<=10E9).

输出:输出中一行一个整数,该整数为逃跑的总概率.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值