3253专题

poj 2431 poj 3253 优先队列的运用

poj 2431: 题意: 一条路起点为0, 终点为l。 卡车初始时在0点,并且有p升油,假设油箱无限大。 给n个加油站,每个加油站距离终点 l 距离为 x[i],可以加的油量为fuel[i]。 问最少加几次油可以到达终点,若不能到达,输出-1。 解析: 《挑战程序设计竞赛》: “在卡车开往终点的途中,只有在加油站才可以加油。但是,如果认为“在到达加油站i时,就获得了一

【队列,树】poj 3253

Fence Repair Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 26380 Accepted: 8554 Description Farmer John wants to repair a small length of the fence around the pasture. He measure

POJ--3253 -- Fence Repair

Fence Repair   Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 19763   Accepted: 6269 Description Farmer John wants to repair a small length of the fence around t

poj 3253 Fence Repair

题目链接:点击打开链接 Description Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, each having so

POJ 3253 Fence Repair (优先权队列+贪心)

Fence Repair Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 29081 Accepted: 9452 Description Farmer John wants to repair a small length of the fence around the pasture. He me

Fence Repair POJ 3253

Description Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, each having some integer leng

poj 3253 优先队列 堆

Fence Repair Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 39924 Accepted: 13022 Description Farmer John wants to repair a small length of the fence around the pasture. He mea

POJ 3253 修理栅栏 - (贪心 Huffman)

题目链接:http://poj.org/problem?id=3253 Huffman #include <stdio.h>#include <algorithm>#include <functional>#include <queue>using namespace std;//POJ 3253int main() {int n;scanf("%d", &n);int *leng

POJ--3253 Fence Repair

Fence Repair Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 35738 Accepted: 11586 Description Farmer John wants to repair a small length of the fence around the pasture. He measure

poj-3253-sdutoj-2127-哈夫曼树-优先队列

Description Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needsN (1 ≤ N ≤ 20,000) planks of wood, each having some integer lengt