上一页 1 ··· 4 5 6 7 8 9 下一页

2019年9月19日

POJ2349

摘要: #include//POJ2349 #include #include #include #include #define inf (0x3f3f3f3f) #define DEF (1e-5) using namespace std; const int maxn = 500 + 5; /*一些最小生成树的新见解 (因为最小生成树是贪心构造, 每一条边都是体系内的最短距 离,所以也可以用来求构... 阅读全文

posted @ 2019-09-19 23:31 chengyulala 阅读(181) 评论(0) 推荐(0)

dijkstra算法的简单应用与板子

摘要: //dijkstra算法 求单源最短路径(板子) O(n^2)还能优化,等会补充 #include//important (不能求带负权值的图) #include #include #define inf (0x3f3f3f3f) using namespace std; const int maxn = 100 + 15; int Grape[maxn][maxn];//u - v的路... 阅读全文

posted @ 2019-09-19 20:02 chengyulala 阅读(508) 评论(0) 推荐(0)

Prim算法的简单入门与板子

摘要: #include<iostream>//Prim算法的简单实现(最小生成树的最小生成路径) #include<cstdio> #include<cstring> #define inf (0x3f3f3f3f) using namespace std; const int maxn = 100 + 阅读全文

posted @ 2019-09-19 09:50 chengyulala 阅读(299) 评论(0) 推荐(0)

2019年9月17日

矩阵快速幂HDU2065

摘要: //学习了。ORZ 阅读全文

posted @ 2019-09-17 22:24 chengyulala 阅读(108) 评论(0) 推荐(0)

2019年9月15日

poj 1035 字符串匹配

摘要: //刚开始傻乎乎的拿字典树写,佛了,就一水题 阅读全文

posted @ 2019-09-15 13:58 chengyulala 阅读(164) 评论(0) 推荐(0)

2019年9月14日

拓扑排序的小总结

摘要: #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int maxn = 100 + 15; int n,m,t;//图中有n个节点 int topo[maxn];//储存拓扑排序的顺序 i 阅读全文

posted @ 2019-09-14 16:37 chengyulala 阅读(154) 评论(0) 推荐(0)

POJ1018

摘要: //POJ 1018(DP) 当有俩个变量时可固定一个边量再去求另一个变量(important) #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #define inf (0x3f3f3f3f) using namespace std; int dp[115][1200];//前i个的设备的j带宽的 阅读全文

posted @ 2019-09-14 13:25 chengyulala 阅读(124) 评论(0) 推荐(0)

2019年9月7日

POJ1328详细题解

摘要: 看了大佬的博客才搞懂...... 以每个小岛为坐标原点,建立圆,获得与x 轴的左交点 left 与右交点 right,获得了雷达在x轴上可以存在的区间,然后贪心枚举,具体看代码注释 阅读全文

posted @ 2019-09-07 13:33 chengyulala 阅读(856) 评论(0) 推荐(2)

2019年9月6日

POJ1159题解报告

摘要: 一道简单DP,但我好像没用滚动数组,菜得真实 思路:i 从字符串尾n开始,j 从i开始,截取字符串 if(str[i] == str[j])因为字符相等,显然 dp[i][j] = dp[i+1][j-1] 当字符不相等时dp[i][j] = 1 + min(dp[i+1][j],dp[i][j-1 阅读全文

posted @ 2019-09-06 15:28 chengyulala 阅读(344) 评论(0) 推荐(1)

2019年9月4日

POJ1088 (滑雪)

摘要: 试了一下深搜每个节点结果TLE了 突然发现是个很明显的DP 从最小的节点开始,更新它四周的节点,如果存在比它高度高的节点,高的节点步数 + 1,因为节点的更新状态肯定是比它高度低那获取的,因此更新时四周比它低的节点已经确定了是最大步数了 阅读全文

posted @ 2019-09-04 18:30 chengyulala 阅读(263) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8 9 下一页

导航