HDOJ 3486 Interviewe
一看就知道 RMQ+2分
但是题目文不对题。。。。不知道到底在问什么东西。。。。
各种WA,TLE,,RE。。。后就过了
果然无论错成什么样都可以过的,就是 上层的样例 啊
Interviewe
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 3865 Accepted Submission(s): 956
YaoYao decides to make the interview as follows. First he queues the interviewees according to their coming order. Then he cuts the queue into m segments. The length of each segment is , which means he ignores the rest interviewees (poor guys because they comes late). Then, each segment is assigned to an interviewer and the interviewer chooses the best one from them as the employee.
YaoYao’s idea seems to be wonderful, but he meets another problem. He values the ability of the ith arrived interviewee as a number from 0 to 1000. Of course, the better one is, the higher ability value one has. He wants his employees good enough, so the sum of the ability values of his employees must exceed his target k (exceed means strictly large than). On the other hand, he wants to employ as less people as possible because of the high salary nowadays. Could you help him to find the smallest m?
In the first line of each case, there are two numbers n and k, indicating the number of the original people and the sum of the ability values of employees YaoYao wants to hire (n≤200000, k≤1000000000). In the second line, there are n numbers v1, v2, …, vn (each number is between 0 and 1000), indicating the ability value of each arrived interviewee respectively.
The input ends up with two negative numbers, which should not be processed as a case.
7 100 7 101 100 100 9 100 100 110 110
-1 -1
We need 3 interviewers to help YaoYao. The first one interviews people from 1 to 3, the second interviews people from 4 to 6, and the third interviews people from 7 to 9. And the people left will be ignored. And the total value you can get is 100+101+100=301>300.
HDOJ 3486 Interviewe的更多相关文章
- hdu 3486 Interviewe (RMQ+二分)
Interviewe Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total ...
- HDU 3486 Interviewe
题目大意:给定n个数的序列,让我们找前面k个区间的最大值之和,每个区间长度为n/k,如果有剩余的区间长度不足n/k则无视之.现在让我们找最小的k使得和严格大于m. 题解:二分k,然后求RMQ检验. S ...
- HDU 3486 Interviewe RMQ
题意: 将\(n\)个数分成\(m\)段相邻区间,每段区间的长度为\(\left \lfloor \frac{n}{m} \right \rfloor\),从每段区间选一个最大值,要让所有的最大值之和 ...
- 3486 ( Interviewe )RMQ
Problem Description YaoYao has a company and he wants to employ m people recently. Since his company ...
- [数据结构]RMQ问题小结
RMQ问题小结 by Wine93 2014.1.14 1.算法简介 RMQ问题可分成以下2种 (1)静态RMQ:ST算法 一旦给定序列确定后就不在更新,只查询区间最大(小)值!这类问题可以用倍增 ...
- 【转载】图论 500题——主要为hdu/poj/zoj
转自——http://blog.csdn.net/qwe20060514/article/details/8112550 =============================以下是最小生成树+并 ...
- HDU题解索引
HDU 1000 A + B Problem I/O HDU 1001 Sum Problem 数学 HDU 1002 A + B Problem II 高精度加法 HDU 1003 Maxsu ...
- hdu图论题目分类
=============================以下是最小生成树+并查集====================================== [HDU] 1213 How Many ...
- HDU图论题单
=============================以下是最小生成树+并查集====================================== [HDU] 1213 How Many ...
随机推荐
- 实战Django:官方实例Part3
前面两个部分我们介绍了投票应用的框架和后台管理部分.接下来舍得要介绍这个应用面向用户的界面. 这里我们要引入一个新的概念,"视图".在Django中,视图是一根连接模型和模板的纽带 ...
- django-url调度器-初级篇
Django 遵从 MVC 模型,并将其特色化为 MTV 模型.模型的核心是通过用户访问的 url 来指向处理的函数,而函数处理后返回相应的结果.所以url决定了用户访问的入口,另外表单处理的提交地址 ...
- java-testng-selenium优化
由于项目中webui测试的需要,是用testng+selenium的方式,其中遇到过几个问题,记录下,方便以后查看 1.重复运行多次case 因为是selenium,所以有的时候需要运行多次,方法是写 ...
- Node.js深受欢迎的六大原因
Node.js是一种后起的优秀服务器编程语言,它用来构建和运行Web应用,这和ASP.NET,Ruby on Rails或Spring框架做的工作是类似的.它使用JavaScript作为主要的开发语言 ...
- Qt5 程序发布打包
关于qt5在win7下发布 & 打包 ----------------------------------------------------------------------------- ...
- 如何在Swing窗体增删组件后及时刷新显示新界面
转自:http://blog.csdn.net/leeshuqing/article/details/8636211 关键的四行代码,连续调用窗体的四个方法即可: repaint();validate ...
- 硬件相关-ADC原理(未完成)
一.模数转换的一般步骤: 1)采样和保持 为了把模拟信号转换成对应的数字信号,必须首先将模拟量每隔一定时间抽取一次样值,使时间上连续变化的模拟量变为一个时间上断续变化的模拟量,这个过程称为采样. 为了 ...
- P3384: [Usaco2004 Nov]Apple Catching 接苹果
一道DP题, f[i,j,k] 表示 第 k 时刻 由 1 位置 变换 j 次 到达 当前 i 棵树 注意也要维护 变换 0 次的情况. var i,j,k,t,w,now:longint; tree ...
- Asp.Net MVC3(三)-MvcApp实现全局异常捕获
定义异常捕获类: [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = true, AllowMu ...
- linux查看端口是否已开启和查看文件数
查看端口是否开启 lsof -i:80 查看文件数 ls | wc -w