SP348 EXPEDI - Expedition】的更多相关文章

嘟嘟嘟 水贪心. 当经过一个加油站的时候,记下这个加油站能加的油,然后没油的时候从经过的加油站中选择加油最多的加. #include<cstdio> #include<iostream> #include<cmath> #include<algorithm> #include<cstring> #include<cstdlib> #include<cctype> #include<vector> #includ…
题目描述 A group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately managed to run over a rock and puncture the truck's fuel tank. The truck now leaks one unit of fuel every unit…
题目传送门(以纪念调了两个半小时的单调队列) emmm这题单调队列可海星... 因为每个点有油量无限的,但是油箱容量是无限的(正好反的一道题 SP348 EXPEDI - Expedition) 所以我们可以用一个价格递减单调队列来记录已加过油的加油站 若要行驶到一个新的加油站时,弹出对头,直到油量可以支撑到这个加油站,然后判断到没到终点,再然后弹出对尾,直到对尾的价格小于这个加油站的价格(之前的状态都可以去掉,因为每个加油站油量是无限的,你在开头就已经判断了,就算你到了这个加油站油箱空了,你也…
题目链接: 传送门 Expedition Time Limit: 1000MS     Memory Limit: 65536K 题目描述 驾驶一辆卡车行驶L单位距离.最开始有P单位的汽油.卡车每开1单位距离消耗1单位的汽油.在途中一共有N个加油站.假设卡车的燃料箱容量无限大,问如果到达终点最少的加油次数. 思路 在卡车开往终点途中,只有在加油站才可以加油,换做认为"在到达加油站i时,就获得了一次在之后任何时候都可以加油的权利" #include<iostream> #in…
POJ 2431 Expedition(探险) Time Limit: 1000MS   Memory Limit: 65536K [Description] [题目描述] A group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately managed to run over a rock an…
Expedition Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 12980   Accepted: 3705 Description A group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately managed t…
Expedition Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8053   Accepted: 2359 Description A group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately managed to…
Expedition 点我 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9465   Accepted: 2760 Description A group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately managed…
poj 3431 Expedition 优先队列 题目链接: http://poj.org/problem?id=2431 思路: 优先队列.对于一段能够达到的距离,优先选择其中能够加油最多的站点,这样,行驶过这段距离之后还能走更远的距离. 将输入的数据进行排序处理,按照位置的先后.注意输入的距离是与终点的,要转化成与起点的. 代码: #include <iostream> #include <algorithm> #include <stdio.h> #include…
题目地址:CF1091F New Year and the Mallard Expedition 题意比较复杂,整理一下: \(n\) 段,每段有两个属性:长度,地形(G,W,L) 有三种运动方式: 1.游泳:W,3m/s,+1 2.走路:G,5m/s,+1 3.飞行:G,W,L,1m/s,-1 思路:贪心 需要解决两个问题: 1.遇到L时没体力飞行 解决的方法很简单:在之前的某个地方向后游泳或走路半米,再向前半米,这样可以+1 显然,游泳比走路更优,因此我们在第一次遇到W时完成所需的所有+1…