任意门:http://poj.org/problem?id=3635 Full Tank? Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8388 Accepted: 2734 Description After going through the receipts from your car trip through Europe this summer, you realised that the gas pri…
BZOJ_1916_[Usaco2010 Open]冲浪_分层图+拓扑排序+DP Description 受到秘鲁的马丘比丘的新式水上乐园的启发,Farmer John决定也为奶牛们建 一个水上乐园.当然,它最大的亮点就是新奇巨大的水上冲浪.超级轨道包含 E (1 <= E <=150,000)条小轨道连接着V (V <= 50,000)个水池,编号为1..V.每个小轨道必须按照特定的方向运行,不能够反向运行.奶牛们从1号水池出发,经过若干条小轨道,最终到达V号水池.每个水池(除了V号和…
题意:有一张图,每条边有一个边权t表示经过所花时间,每个点有两个权t.p,分别表示经过该点所花时间和所花费用,要求找一条路径,从点1出发再回到点1,所花时间恰好为x且费用最小,输出其费用,找不到则输出"It is a trap." 思路:这题的解法和之前一场网络赛碰到的L题异曲同工,那题的题意是有k次机会把一条路的边权置为0,求最短路.我们可以把它抽象成分层图,即用二维的dis数组,dis[i][j]表示到点i且状态为j的最小花费.具体到题目来说,就是到点i且剩下j次机会的最小花费.也…
Full Tank? Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7248 Accepted: 2338 Description After going through the receipts from your car trip through Europe this summer, you realised that the gas prices varied between the cities you v…