07 2018 档案
HDU-4791-Alice‘s Print Service
摘要:分析: 1.由于价格是递减的,所以可能出现si*pi>sj*pj(j>i)。所以要有一个数组来储存当前端点的最小值。 2.然后二分查找当前的si,比较q*p[i]和M[i+1].不过在这之前要确认i是小于n的。】 3.upper_bound是返回第一个大于当前值得坐标,否则返回左闭右开的右端点。而l
POJ-3122-Pie
摘要:Description My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of vari
POJ-3104-Drying
摘要:Description It is very hard to wash and especially to dry clothes in winter. But Jane is a very smart girl. She is not afraid of this boring process.
POJ-2456- Aggressive cows
摘要:Description Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,...
CF-478C
摘要:You have r red, g green and b blue balloons. To decorate a single table for the banquet you need exactly three balloons. Three balloons attached to so
HDU-2074-叠筐
摘要:分析: 1. 为了一致性,首先要确定外边先赋值谁。当行数为奇数二倍-1时,最外层是中心块。否则是外框字符。 2.然后遍历赋值时候。从上到下。漏斗形状赋值。同步过程中,由于图形对称,坐标反一下即可。
HDU-2037-今年暑假不AC
摘要:分析: 1. 很多组结果,都在一个时间轴上,结束越早的越好。所以按照结束时间排序。 2.一步一步更新当前的时间,若谁的开始时间大于等于当前时间。更新当前时间为此节目的结束时间。计数加一。
POJ-2785-4 Values whose Sum is 0
摘要:4 Values whose Sum is 0 Description The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quad
HDU-1160-FatMouse's Speed
摘要:分析: 1. 先对w排序,然后求最长子序列。要记录原来的位置,所以结构体定义一个n来记录原来的位置。 2. 我们要找出这个最长子序列的长度,并且还要输出他,就需要一个数组来记录当前块所在的子序列中的后继序号。 3. 如果从前往后找,前面的后继序号多次更新,不方便,从后往前找,只需要更新当前块。
HDU-1297-Children’s Queue
摘要:Children’s Queue 这道题是排序问题,可以用递归方法解决。 计算F(n): 一:当最后一个是男孩M时候,前面n-1个随便排出来,只要符合规则就可以,即是F(n-1); 二:当最后一个是女孩F时候,第n-1个肯定是女孩F,这时候又有两种情况: 1)前面n-2个可以按n-2个的时候的规则来