![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
poj
文章平均质量分 80
zt_1995
这个作者很懒,什么都没留下…
展开
-
poj2533&&hdu1087 最长上升子序列问题
题目链接: http://poj.org/problem?id=2533 http://acm.hdu.edu.cn/showproblem.php?pid=1087最长上升子序列问题: 思路1:dp[i]表示以i结尾的最长上升子序列 转移方程:dp[i]=max{dp[j]+1}; 思路2:dp[i]表示长度为i的最小元素升序排列: iterator lower_bound( cons原创 2016-01-06 18:34:12 · 268 阅读 · 0 评论 -
poj 1179 Polygon
题目链接:http://poj.org/problem?id=1179思路:区间dp,石子归并的变形。考虑到最大值可能由最小值*最小值转化过来,所以不仅要记录最大值也要记录最小值。代码#include<cstdio>#include<algorithm>#include<iostream>#include<vector>using namespace std;const int N=55;原创 2015-09-04 00:55:09 · 259 阅读 · 0 评论 -
poj1088 滑雪
题目链接: http://poj.org/problem?id=1088思路:记忆化搜索。 dp[i][j] 表示从(i,j)出发的最大滑行距离。 代码:#include<iostream>#include<cstdio>#include<string.h>#include<algorithm>const int N=105;using namespace std;int a[N]原创 2015-08-18 21:19:24 · 342 阅读 · 0 评论 -
poj 3615Cow Hurdles floyd
http://poj.org/problem?id=3615代码:#include<iostream>#include<cstdio>using namespace std;#define Max 1000005int max(int a,int b){return a>b?a:b;}int min(int a,int b){return a<b?a:b;}int a[305][305]原创 2015-07-19 13:06:06 · 304 阅读 · 0 评论 -
poj1741 树分治
题目链接:http://poj.org/problem?id=1741可参考论文:https://wenku.baidu.com/view/e087065f804d2b160b4ec0b5.html题意:求树上的点对(u,v)个数,点对满足dist(u,v)解法:树上点分治。树上递归求解问题,为了防止递归过程中树退化成一条链,我们每次递归时找树的重心。重心求原创 2017-03-04 23:40:05 · 360 阅读 · 0 评论 -
poj1655 求树的重心
题目链接:http://poj.org/problem?id=1655题意:求树的重心。解法:对树进行dfs,记录对于某个节点它的子树大小son[u],在dfs的时候可以处理出来这个点的所有子树节点个数的最大值Max,而n-son[u]可以处理出它父节点延伸出去的节点数目,那么答案便可以找到了。#include<cstdio>#include<cstring>#include<algorithm原创 2017-02-28 23:54:37 · 234 阅读 · 0 评论 -
poj2299
Ultra-QuickSortTime Limit: 7000MS Memory Limit: 65536KTotal Submissions: 51330 Accepted: 18828DescriptionIn this problem, you have to analyze a particular sorting a原创 2016-02-15 20:54:02 · 403 阅读 · 0 评论 -
poj1950 深搜
DessertDescriptionFJ has a new rule about the cows lining up for dinner. Not only must the N (3 <= N <= 15) cows line up for dinner in order, but they must place a napkin between each pair of cows with原创 2016-02-25 20:36:39 · 413 阅读 · 0 评论