Gas Station
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].
You have a car with an unlimited gas tank and it costs cost[i] of gas to travel fro...
分类:
其他好文 时间:
2015-08-16 23:08:44
阅读次数:
230
链接
题解链接:http://www.cygmasot.com/index.php/2015/08/16/hdu_5380
题意:
n C
一条数轴上有n+1个加油站,起点在0,终点在n。车的油箱容量为C
下面n个数字表示每个加油站距离起点的距离。
下面n+1行表示每个加油站买进和卖出一单位油的价格。油可以买也可以卖。
问开到终点的最小花费。
思路:
把油箱保持装满,然后维护一个...
分类:
其他好文 时间:
2015-08-16 16:41:51
阅读次数:
150
本文纯属原创,转载请注明出处。http://blog.csdn.net/zip_fan,谢谢。
题目传送门:http://acm.hdu.edu.cn/showproblem.php?pid=5380。
Travel with candy
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (...
分类:
其他好文 时间:
2015-08-16 16:41:33
阅读次数:
269
题目链接:hdu 5380 Travel with candy
保持油箱一直处于满的状态,维护一个队列,记录当前C的油量中分别可以以多少价格退货,以及可以推货的量。每到一个位置,可以该商店的sell值更新队列中所有价格小于sell的(还没有卖)。用buy值更新队列中大于buy(卖掉了)。移动所消耗的油从价格最低的开始。
#include
#include
#include ...
分类:
其他好文 时间:
2015-08-15 11:56:37
阅读次数:
202
CREATE?USER?‘ecweb‘@‘%‘?IDENTIFIED?BY?‘cxtech360.com‘; ?grant?all?privileges?on?ec_travel.*?to?‘ecweb‘@‘%‘?identified?by?‘cxtech360.com‘;...
分类:
数据库 时间:
2015-08-13 22:34:50
阅读次数:
178
通道题意:1个人在数轴上来回走,以pi的概率走i步i∈[1, m],给定n(数轴长度),m,e(终点),s(起点),d(方向),求从s走到e经过的点数期望思路:E[x] = sum((E[x+i]+i) * p[i])(i∈[1, m]) ,(走i步经过i个点,所以是E[x+i]+i)E[x] = ...
分类:
其他好文 时间:
2015-08-12 23:09:01
阅读次数:
102
Description
The cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superior. Bessie, ever the competent travel agent, ...
分类:
其他好文 时间:
2015-08-10 13:41:19
阅读次数:
147
Interstellar Travel
Time Limit: 1000ms, Special Time Limit:2500ms,
Memory Limit:65536KB
Total submit users: 2, Accepted users:
1
Problem 11568 : No special judgement
Problem desc...
分类:
其他好文 时间:
2015-08-08 19:59:00
阅读次数:
127
Problem J. TriatripTime Limit: 20 SecMemory Limit: 256 MB题目连接http://codeforces.com/gym/100342/attachmentsDescriptionThe travel agency “Four Russians” ...
分类:
其他好文 时间:
2015-08-07 13:15:12
阅读次数:
275
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].
You have a car with an unlimited gas tank and it costs cost[i] of gas to travel
from station i to ...
分类:
其他好文 时间:
2015-08-06 11:15:43
阅读次数:
135