Description
Samball is going to travel in the coming vacation. Now it's time to make a plan. After choosing the destination city, the next step is to determine the travel route. As this poor guy has ...
分类:
其他好文 时间:
2014-08-18 10:50:54
阅读次数:
334
Secret agent Maria was sent to Algorithms City to carry out an especially dangerous mission. After several thrilling events we find her in the first station of Algorithms City Metro, examining the tim...
分类:
其他好文 时间:
2014-08-18 00:21:13
阅读次数:
383
Dream CityTime Limit:1 Second Memory Limit:32768 KBJAVAMAN is visiting Dream City and he sees a yard of gold coin trees. There arentrees in the yard. ...
分类:
其他好文 时间:
2014-08-16 23:48:01
阅读次数:
245
Description
The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city counci...
分类:
其他好文 时间:
2014-08-16 13:53:40
阅读次数:
679
本题是LIS题解。主要是理解他的题意。他的题意都好像比较隐晦,比如每个poor city和rich city一定是需要对应起来的,比如poor city和rich city并不是按顺序给出的。
其实是可以把数列按照poor city排序,然后求rich city城市号的最大递增子序列。
不过这里不用排序,利用hash的思想直接对应起来就可以了。
然后就是本题是卡DP的O(n*n)的解法的,这...
分类:
其他好文 时间:
2014-08-15 17:55:49
阅读次数:
211
给出n个顶点,n-1条边,对于每一个顶点来说每有一条路径经过,繁荣度+1,求最大繁荣度。
经过的含义就是这条路径使用了跟这个顶点相连的边中的的两条,任意组合都可以,所以要找出每个顶点相连的边延伸出去有多少种情况。
从第一个顶点开始建树,对于第i个节点有sum[i]个子节点,因此dp[i]=sum[i]*(n-1-sum[i]),再加上节点的n棵子树的节点数乘积/2。
#include
#i...
分类:
其他好文 时间:
2014-08-15 10:43:48
阅读次数:
233
1307: City TourTime Limit:1 SecMemory Limit:128 MBSubmit:549Solved:124[Submit][Status][Web Board]DescriptionAlice想要从城市A出发到城市B,由于Alice最近比较穷(不像集训队陈兴老师是个...
分类:
其他好文 时间:
2014-08-14 23:25:46
阅读次数:
198
Topcoder上的一道题目,题目描述如下:Problem StatementByteland is a city with many skyscrapers, so it's a perfect venue for BASE jumping. Danilo is an enthusiastic B...
分类:
编程语言 时间:
2014-08-14 20:24:39
阅读次数:
307
题目链接:http://poj.org/problem?id=2312题目大意:给出一个n*m的矩阵,其中Y是起点,T是终点,B和E可以走,S和R不可以走,要注意的是走B需要2分钟,走E需要一分钟。最后求解Y--->T的最短时间!!看到这题首先想到广搜来找最短时间,但是这里可以对B和E进行处理,方便...
分类:
其他好文 时间:
2014-08-14 19:30:09
阅读次数:
272
Problem Description
One day , Kiki wants to visit one of her friends. As she is liable to carsickness , she wants to arrive at her friend’s home as soon as possible . Now give you a map of the city...
分类:
其他好文 时间:
2014-08-14 16:51:58
阅读次数:
219