护花专题

护花

Description   FJ出去砍木材去了,把N(2<=N<=100,000)头牛留在家中吃草,当他回来的时候,发现奶牛们都跑到花园里吃花去了,为了减少损失,FJ打算把牛移到牛棚中去。   每头牛的位置离牛棚需要Ti分钟(1<=Ti<=2,000,000),而且在等待被移走的过程中,每分钟破坏Di(1<=Di<=100)朵花,无论多么努力FJ一次只能移动一只奶牛,移动一只奶牛到牛棚需要2×

[BZOJ1634] [Usaco2007 Jan]Protecting the Flowers 护花

[Usaco2007 Jan]Protecting the Flowers 护花 Description 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 t