7
10
2015
0

POJ1201:Intervals

                    Intervals
Time Limit: 2000MS   Memory Limit: 65536K
Total Submissions: 22996   Accepted: 8678

Description

You are given n closed, integer intervals [ai, bi] and n integers c1, ..., cn.
Write a program that:
reads the number of intervals, their end points and integers c1, ..., cn from the standard input,
computes the minimal size of a set Z of integers which has at least ci common elements with interval [ai, bi], for each i=1,2,...,n,
writes the answer to the standard output.

Category: POJ | Tags:
7
9
2015
0

POJ1456:Supermarket

                        Supermarket
Time Limit: 2000MS   Memory Limit: 65536K
Total Submissions: 9914   Accepted: 4296

Description

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 as an integral number of time units starting from the moment the sale begins. Each product takes precisely one unit of time for being sold. A selling schedule is an ordered subset of products Sell ≤ Prod such that the selling of each product x∈Sell, according to the ordering of Sell, completes before the deadline dx or just when dx expires. The profit of the selling schedule is Profit(Sell)=Σx∈Sellpx. An optimal selling schedule is a schedule with a maximum profit.
For example, consider the products Prod={a,b,c,d} with (pa,da)=(50,2), (pb,db)=(10,1), (pc,dc)=(20,2), and (pd,dd)=(30,1). The possible selling schedules are listed in table 1. For instance, the schedule Sell={d,a} shows that the selling of product d starts at time 0 and ends at time 1, while the selling of product a starts at time 1 and ends at time 2. Each of these products is sold by its deadline. Sell is the optimal schedule and its profit is 80.


Write a program that reads sets of products from an input text file and computes the profit of an optimal selling schedule for each set of products.

Category: POJ | Tags:
7
9
2015
0

暑假培训实录、、


    一眼看到暑假的安排感觉好像不是很难,感觉十分兴奋终于不用被新初三爷虐了,然后瞬间发现有点不对劲。。40天的暑假20天培训!!!。。你在逗我。。。。。为什么我高中前的一个暑假都过得辣么艰难。。。仿佛看到了黑暗的未来。。

Category: 杂文 | Tags:
7
9
2015
0

POJ:1182食物链

                          食物链
 
Time Limit: 1000MS   Memory Limit: 10000K
Total Submissions: 51566   Accepted: 15069

Description

动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。
现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。
有人用两种说法对这N个动物所构成的食物链关系进行描述:
第一种说法是"1 X Y",表示X和Y是同类。
第二种说法是"2 X Y",表示X吃Y。
此人对N个动物,用上述两种说法,一句接一句地说出K句话,这K句话有的是真的,有的是假的。当一句话满足下列三条之一时,这句话就是假话,否则就是真话。
1) 当前的话与前面的某些真的话冲突,就是假话;
2) 当前的话中X或Y比N大,就是假话;
3) 当前的话表示X吃X,就是假话。
你的任务是根据给定的N(1 <= N <= 50,000)和K句话(0 <= K <= 100,000),输出假话的总数。

Category: POJ | Tags:
7
8
2015
0

BZOJ:1093: [ZJOI2007]最大半连通子图

1093: [ZJOI2007]最大半连通子图

Time Limit: 30 Sec  Memory Limit: 162 MB
Submit: 1962  Solved: 787
[Submit][Status][Discuss]

Description

Category: BZOJ题解 | Tags:
7
7
2015
0

BZOJ:4146: [AMPPZ2014]Divisors

4146: [AMPPZ2014]Divisors

Time Limit: 20 Sec  Memory Limit: 256 MB
Submit: 211  Solved: 139
[Submit][Status][Discuss]

Description

给定一个序列a[1],a[2],...,a[n]。求满足i!=j且a[i]|a[j]的二元组(i,j)的个数。

Category: BZOJ题解 | Tags:
7
7
2015
0

BZOJ:1082: [SCOI2005]栅栏

1082: [SCOI2005]栅栏

Time Limit: 10 Sec  Memory Limit: 162 MB
Submit: 969  Solved: 446
[Submit][Status][Discuss]

Description

农夫约翰打算建立一个栅栏将他的牧场给围起来,因此他需要一些特定规格的木材。于是农夫约翰到木材店购买木材。可是木材店老板说他这里只剩下少部分大规格的木板了。不过约翰可以购买这些木板,然后切割成他所需要的规格。而且约翰有一把神奇的锯子,用它来锯木板,不会产生任何损失,也就是说长度为10的木板可以切成长度为8和2的两个木板。你的任务:给你约翰所需要的木板的规格,还有木材店老板能够给出的木材的规格,求约翰最多能够得到多少他所需要的木板。

Category: BZOJ题解 | Tags:
7
7
2015
0

BZOJ:4010: [HNOI2015]菜肴制作

4010: [HNOI2015]菜肴制作

Time Limit: 5 Sec  Memory Limit: 512 MB
Submit: 641  Solved: 345
[Submit][Status][Discuss]

Description

知名美食家小 A被邀请至ATM 大酒店,为其品评菜肴。 

ATM 酒店为小 A 准备了 N 道菜肴,酒店按照为菜肴预估的质量从高到低给予
1到N的顺序编号,预估质量最高的菜肴编号为1。由于菜肴之间口味搭配的问题,
某些菜肴必须在另一些菜肴之前制作,具体的,一共有 M 条形如“i 号菜肴‘必须’
先于 j 号菜肴制作”的限制,我们将这样的限制简写为<i,j>。现在,酒店希望能求
出一个最优的菜肴的制作顺序,使得小 A能尽量先吃到质量高的菜肴:也就是说,
(1)在满足所有限制的前提下,1 号菜肴“尽量”优先制作;(2)在满足所有限制,1
号菜肴“尽量”优先制作的前提下,2号菜肴“尽量”优先制作;(3)在满足所有限
制,1号和2号菜肴“尽量”优先的前提下,3号菜肴“尽量”优先制作;(4)在满
足所有限制,1 号和 2 号和 3 号菜肴“尽量”优先的前提下,4 号菜肴“尽量”优

Category: BZOJ题解 | Tags:
7
7
2015
0

BZOJ:2600: [IOI2011]ricehub

2600: [Ioi2011]ricehub

Time Limit: 10 Sec  Memory Limit: 128 MB
Submit: 475  Solved: 247
[Submit][Status][Discuss]

Description

乡间有一条笔直而长的路称为“米道”。沿着这条米道上 R 块稻田,每块稻田的坐标均
为一个 1 到 L 之间(含 1 和 L)的整数。这些稻田按照坐标以不减的顺序给出,即对于 0 ≤ i <
R,稻田 i 的坐标 X[i]满足 1 ≤ X[0] ≤ ... ≤ X[R-1] ≤ L。 
注意:可能有多块稻田位于同一个坐标上。 
我们计划建造一个米仓用于储存尽可能多的稻米。和稻田一样,米仓将建在米道上,其
坐标也是一个 1 到 L 之间的整数(含 1 和 L)。这个米仓可以建在满足上述条件的任一个位
置上,包括那些原来已有一个或多个稻田存在的位置。 
在收获季节,每一块稻田刚好出产一滿货车的稻米。为了将这些稻米运到米仓,需要雇
用一位货车司机来运米。司机的收费是每一满货车运送一个单位的距离收取 1 元。換言之,
将稻米从特定的稻田运到米仓的费用在数值上等于稻田坐标与米仓坐标之差的绝对值。 


不幸的是,今年预算有限,我们至多只能花费 B 元运费。你的任务是要帮我们找出一个
建造米仓的位置,可以收集到尽可能多的稻米。 

Category: BZOJ题解 | Tags:
7
7
2015
1

、、、开博了、、、

   这个博客应该是半年以前就在了的吧。。。

Category: 杂文 | Tags:

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com