codeforces Codeforces Round #380 (Div. 1, Rated, Based on Technocup 2017 - Elimination Round 2)// 二分的题目硬生生想出来ON的算法
A. Road to Cinema
很明显满足二分性质的题目。
题意:某人在起点处,到终点的距离为s。 汽车租赁公司提供n中车型,每种车型有属性ci(租车费用),vi(油箱容量)。 车子有两种前进方式 :①. 慢速:1km消耗1L汽油,花费2分钟。 ②.快速:1km消耗2L汽油,花费1分钟。 路上有k个加油站,加油不需要花费时间,且直接给油箱加满。 问在t分钟内到达终点的最小花费是多少?(租车子的费用) 若无法到达终点,输出-1
不谈二分的写法.. 我们考虑离散化可修改的点 和限制的点位置 如果发现有限制就结束。那么思路很简单了。一个数组存分段的最大耗油量。ans = 跑最快情况下的最小时间的最大值。依次牺牲多余时间减小耗油即可。取个max就可以了。
算上排序的时间依旧是klogk+n。不好写坑点多。。
开了流量写CF.... 500MB没了...... 我R 算了算了不写....
codeforces Codeforces Round #380 (Div. 1, Rated, Based on Technocup 2017 - Elimination Round 2)// 二分的题目硬生生想出来ON的算法的更多相关文章
- Codeforces Round #380 (Div. 1, Rated, Based on Technocup 2017 - Elimination Round 2)
http://codeforces.com/contest/737 A: 题目大意: 有n辆车,每辆车有一个价钱ci和油箱容量vi.在x轴上,起点为0,终点为s,中途有k个加油站,坐标分别是pi,到每 ...
- Codeforces Round #380 (Div. 2, Rated, Based on Technocup 2017 - Elimination Round 2) E. Subordinates 贪心
E. Subordinates time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...
- Codeforces Round #380 (Div. 2, Rated, Based on Technocup 2017 - Elimination Round 2) D. Sea Battle 模拟
D. Sea Battle time limit per test 1 second memory limit per test 256 megabytes input standard input ...
- Codeforces Round #380 (Div. 2, Rated, Based on Technocup 2017 - Elimination Round 2)C. Road to Cinema 二分
C. Road to Cinema time limit per test 1 second memory limit per test 256 megabytes input standard in ...
- Codeforces Round #389 (Div. 2, Rated, Based on Technocup 2017 - Elimination Round 3) C
Description Santa Claus has Robot which lives on the infinite grid and can move along its lines. He ...
- Codeforces Round #389 (Div. 2, Rated, Based on Technocup 2017 - Elimination Round 3) B
Description Santa Claus decided to disassemble his keyboard to clean it. After he returned all the k ...
- Codeforces Round #389 (Div. 2, Rated, Based on Technocup 2017 - Elimination Round 3) A
Description Santa Claus is the first who came to the Christmas Olympiad, and he is going to be the f ...
- Codeforces Round #389 (Div. 2, Rated, Based on Technocup 2017 - Elimination Round 3) D. Santa Claus and a Palindrome STL
D. Santa Claus and a Palindrome time limit per test 2 seconds memory limit per test 256 megabytes in ...
- Codeforces Round #389 (Div. 2, Rated, Based on Technocup 2017 - Elimination Round 3) E. Santa Claus and Tangerines
E. Santa Claus and Tangerines time limit per test 2 seconds memory limit per test 256 megabytes inpu ...
随机推荐
- HDP 2.3 Notes
Hortonworks Data Platform 2.3.4.0-3485 [bug] /usr/hdp/2.3.4.0-3485/zookeeper/bin/zkEnv.sh 26 if [ -z ...
- Salesforce 使用Js 调用Webservice实例
1,创建 Custom Button 在页面上 2, 创建CustomJs 代码调用Webservice <!--参数名区分大小写,对于跨层object直接在Object名后直接加参字段名即可- ...
- JuqeryResize
//添加 (function ($, h, c) { var a = $([]), e = $.resize = $.extend($.resize, {}), i, k = "setTim ...
- Mybtis框架总结(一)
一:Mybaits下载并搭建核心框架 1:下载mybatis的jar包: 2:创建mybatis框架链接数据库的配置文件Configuration.xml,格式如下 <!DOCTYPE conf ...
- arguments转换为数组格式
var agArr = []; for(var i = 0; i < arguments.length; i++) { agArr.push(arguments[i]) }
- tomcat虚拟目录映射网络共享目录
<Host name="localhost" debug="0" appBase="webapps" unpackWARs=" ...
- ZYNQ 的PS GEM DMA存在缺陷
使用iperf对zynq进行单socket tcp传输速率测试: 无网络损伤时,单向网络带宽约为600Mbps,双向网络带宽相加约400Mbps: 50ms延时,1ms抖动,无丢包时,单向网络带宽约为 ...
- [转载]Average Manager vs. Great Manager Explained in 10 sketches
Assigning Tasks Delivering News Conducting 1:1s Giving Feedback Dealing with Turbule ...
- Microsoft Azure 01 (Summarize)
What is Windows Azure? As a cloud platform from Microsoft that provides a wide range of different se ...
- Theme皮肤文件(json解析、多文件管理)
一 官方教程 http://developer.egret.com/cn/github/egret-docs/extension/EUI/skin/theme/index.html 二 thm主题文 ...