与‘基础算法-贪心’有关的日志

uva400

maksyuki 发表于 oj 分类,标签: ,
0
uva400

The computer company you work for is introducing a brand new computer line and is developing a new Unix-like operating system to be introduced along with the new computer. Your assignment is to write the formatter for the ls function.

Your program >>继续阅读

uva1590

maksyuki 发表于 oj 分类,标签:
0
uva1590

Alex is administrator of IP networks. His clients have a bunch of individual IP addresses and he decided to group all those IP addresses into the smallest possible IP network.

Each IP address is a 4-byte number that is written byte-by-byte in a dec >>继续阅读

poj3262

maksyuki 发表于 oj 分类,标签:
0
poj3262

Protecting the Flowers

Farmer John went to cut some wood and left N (2 ≤ N ≤ 100,000) cows eating the grass, as usual. When he returned, he found to his horror that the cluster of cows was in his garden eating his beautiful flowers. Wanting to mini >>继续阅读

poj3040

maksyuki 发表于 oj 分类,标签:
0
poj3040

Allowance

As a reward for record milk production, Farmer John has decided to start paying Bessie the cow a small weekly allowance. FJ has a set of coins in N (1 <= N <= 20) different >>继续阅读

poj2393

maksyuki 发表于 oj 分类,标签:
0
poj2393

Yogurt factory

The cows have purchased a yogurt factory that makes world-famous Yucky Yogurt. Over the next N (1 <= N <= 10,000) weeks, the price of milk and labor will fluctuate weekly such that it will cost the company C_i (1 <= C_i < >>继续阅读

poj3190

maksyuki 发表于 oj 分类,标签: ,
0
poj3190

Stall Reservations

Oh those picky N (1 <= N <= 50,000) cows! They are so picky that each one will only be milked over some precise time interval A..B (1 <= A <= B <= 1,000,000), which includes both times A and B. Obviously, FJ must c >>继续阅读

poj2376

maksyuki 发表于 oj 分类,标签: ,
0
poj2376

Cleaning Shifts

Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He always wants to have one cow working on cleaning things up and has divided the day into T shifts (1 <= T <= 1, >>继续阅读

poj2431

maksyuki 发表于 oj 分类,标签: ,
0
poj2431

Expedition

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 >>继续阅读

poj3069

maksyuki 发表于 oj 分类,标签:
0
poj3069

Saruman's Army

Saruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes seeing stones, known as palantirs, among the troops. Each palantir >>继续阅读

poj3617

maksyuki 发表于 oj 分类,标签:
0
poj3617

Best Cow Line

FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arranges his cows in a line and herds them past the judges.

The contest organizers adopted a new registration >>继续阅读

poj3646

maksyuki 发表于 oj 分类,标签:
0
poj3646

The Dragon of Loowater

Once upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem.The shores of Rellau Creek in central Loowater had always been a prime breeding ground for geese. Due to the lack of predators, the ge >>继续阅读

poj2709

maksyuki 发表于 oj 分类,标签:
0
poj2709

Painter

The local toy store sells small fingerpainting kits with between three and twelve 50ml bottles of paint, each a different color. The paints are bright and fun to work with, and have the useful property that if you mix X ml each of any three >>继续阅读

poj1700

maksyuki 发表于 oj 分类,标签:
0
poj1700

Crossing River

A group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore some sort of shuttle arrangement must be arranged in order to row the boat back and forth so that all people may cross >>继续阅读

poj1456

maksyuki 发表于 oj 分类,标签:
0
poj1456

Supermarket

A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured >>继续阅读

hdu1421

maksyuki 发表于 oj 分类,标签: ,
0
hdu1421

搬寝室

Problem Description

搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2*k件过去就行了.但还是会很累,因为2*k也不小是一个不大于n的整数.幸运的是xhd根据多年的搬东西的经验发现每搬一次的疲劳度是和左右手的物品的重量差的平方成正比 >>继续阅读

hdu1160

maksyuki 发表于 oj 分类,标签: ,
0
hdu1160

FatMouse's Speed

Problem Description

FatMouse believes that the fatter a mouse is, the faster it runs. To disprove >>继续阅读