
漫漫刷题路
Ginsn
放弃很容易,但坚持一定很酷
展开
-
【动态规划】UPC-7780(状压DP)
最短Hamilton路径时间限制: 2 Sec 内存限制: 128 MB题目描述给定一张 n(n≤20) 个点的带权无向图,点从 0~n-1 标号,求起点 0 到终点 n-1 的最短Hamilton路径。 Hamilton路径的定义是从 0 到 n-1 不重不漏地经过每个点恰好一次。 输入第一行一个整数n。接下来n行每行n个整数,其中第i行第j个整数表示点i到j的距离(...原创 2018-08-10 11:16:44 · 483 阅读 · 0 评论 -
【动态规划】乘积最大
题目描述 古人云:“不谋万世者,不足谋一时;不谋全局者,不足谋一域。”张琪曼通过研究惊奇地发现,每个人一生的幸福指数可以用一个长度为n的十进制数字字符串来表示,并且可以通过全局统筹安排,将幸福指数分成k+1个部分应用在她感兴趣的不同领域,从而使得总体幸福值最强,所谓幸福值最强,是指使得k个部分的乘积为最大。例如n=6,k=3,且数字字符串为“310143”时,此时可能有的情况有下列各种: ...原创 2018-08-07 20:23:42 · 1610 阅读 · 1 评论 -
【动态规划】状压DP--POJ—2411-Mondriaan's Dream(2×1方格问题)
Mondriaan's DreamSquares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his 'toilet series' (where he had to use his toilet paper to d...原创 2018-08-08 20:19:32 · 407 阅读 · 0 评论 -
POJ—3255 Roadblocks (次短路算法-Dijkstra的优先级队列实现)
RoadblocksTime Limit:2000MS Memory Limit:65536K Total Submissions:21304 Accepted:7463 DescriptionBessie has moved to a small farm and sometimes enjoys returning to visit on...原创 2019-03-26 22:00:05 · 393 阅读 · 0 评论 -
POJ—3169 Layout (差分约束,SPFA实现)
LayoutTime Limit:1000MS Memory Limit:65536K Total Submissions:16036 Accepted:7704 DescriptionLike everyone else, cows like to stand close to their friends when queuing for ...原创 2019-03-27 21:23:55 · 280 阅读 · 0 评论 -
HDU—6514 Monitor(二维差分数组维护)
MonitorTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 163840/163840 K (Java/Others)Total Submission(s): 852Accepted Submission(s): 266Problem DescriptionXiaoteng has a large area...原创 2019-04-22 17:04:30 · 399 阅读 · 0 评论 -
2019 ICPC 南昌邀请赛 Max answer
Alice has a magic array. She suggests that the value of a interval is equal to the sum of the values in the interval, multiplied by the smallest value in the interval.Now she is planning to find the...原创 2019-04-22 20:17:59 · 303 阅读 · 0 评论