线段树Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--#include<cstdio>#include<cstring>#include<algorithm>usingnamespacestd;#defineLC(x... Read More
posted @ 2010-05-10 18:34 ziroy Views(117) Comments(0) Diggs(0)
Time Limit: 1000MSMemory Limit: 65536KDescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 516 1... Read More
posted @ 2009-05-30 12:57 ziroy Views(219) Comments(0) Diggs(0)
Time Limit: 1000MSMemory Limit: 10000KDescription两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方... Read More
posted @ 2009-05-30 12:44 ziroy Views(290) Comments(0) Diggs(0)
Time Limit: 2000MSMemory Limit: 65536KDescriptionBusinesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For e... Read More
posted @ 2009-05-30 12:34 ziroy Views(864) Comments(0) Diggs(0)
DescriptionThere is a sequence of n+2 elements a0, a1, ..., an+1 (n<=3000, -1000<=ai<=1000). It is known that ai = (ai-1+ai+1)/2-ci for each i=1, 2, ..., n. You are given a0, an+1, c1, ... , ... Read More
posted @ 2009-05-30 10:52 ziroy Views(232) Comments(0) Diggs(0)
Given N numbers in a line, we can determine a continuous subsequence by giving its start position and its length. PMH and Roy played a game the other day. Roy gives the start position first, then PMH ... Read More
posted @ 2009-05-30 00:53 ziroy Views(268) Comments(0) Diggs(0)