hiho一下 第六十九周 题目1 : HIHO Drinking Game 二分
2015-10-30 17:46
465 查看
题目1 : HIHO Drinking Game
时间限制:10000ms单点时限:1000ms
内存限制:256MB
描述
Little Hi and Little Ho are playing a drinking game called HIHO. The game comprises N rounds. Each round, Little Hi pours T milliliter of water into Little Ho's cup then Little Ho rolls a K-faces dice to get a randomnumber d among 1 to K. If the remaining water in Little Ho's cup is less than or equal to d milliliter Little Hi gets one score and Little Ho drinks up the remaining water, otherwise Little Ho gets one score and Little Ho drinks exactly d milliliter of water
from his cup. After N rounds who has the most scores wins.
Here comes the problem. If Little Ho can predict the number d of N rounds in the game what is the minimum value of T that makes Little Ho the winner? You may assume that no matter how much water is added, Little
Ho's cup would never be full.
输入
The first line contains N(1 <= N <= 100000, N is odd) and K(1 <= K <= 100000).The second line contains N numbers, Little Ho's predicted number d of N rounds.
输出
Output the minimum value of T that makes Little Ho the winner.样例输入
5 6 3 6 6 2 1
样例输出
4
相关文章推荐
- SQL Server2005主从复制实现
- Web前端开发学习1:静态网页
- ORACLE存储过程的应用(1流水号)
- ocilib 安裝配置
- 给定n个矩阵{A1, A2, …,An},其中,Ai与Ai+1是可乘的,计算这n个矩阵的连乘积。从中找出一种乘次数最少的计算次序(矩阵连乘最优顺序Java语言实现
- Intent传递对象的两种方法(Serializable,Parcelable) (转)
- section 模块页面切换代码
- 页面切换代码
- Java实现http服务器(一)
- SqlServer 还原他服数据库只建立发布却删除不了
- 最新VMware的下载地址
- nios的头文件
- 我的第一篇博客
- modelsim的do文件
- 【NGUI】Unity实现英雄联盟选择皮肤效果
- Socket-TCP-2
- LDAP 中 CN, OU, DC 的含义
- Word详细教程三(几个快捷键的应用)
- BZOJ 4320 ShangHai2006 Homework 并查集
- iOS 【UIKit-UITableView】