2019年9月21日

HDU2112(hash+dijkstra)

摘要: #include<iostream> #include<cstdio> #include<string> #include<map> #include<cstring> #define inf (0x3f3f3f3f) using namespace std; const int maxn = 150 + 15; int Grape[maxn][maxn]; map<string,int> m; 阅读全文

posted @ 2019-09-21 17:00 chengyulala 阅读(157) 评论(0) 推荐(0) 编辑

母函数的一些简单想法(HDU2110)

摘要: // 母函数解决的问题 // n 种物品,每个有一个wi,组合成total价值有多少种组合方案 // 将组合问题转换为 幂级数上的相乘问题(important) (Orz) // #include<iostream> // #include<cstdio> // #include<cstring> // using namespace std; // int n,a[105],b[105],m,s 阅读全文

posted @ 2019-09-21 15:54 chengyulala 阅读(168) 评论(1) 推荐(0) 编辑

最长子串问题

摘要: //关于最长公共子串的一些简单想法 // if 求 str1 与 str2 的最长公共子串,可以将str1 每个字符与str2 每个字符建立矩阵 Grape[len1][len2] // 遍历 如果 str1[i]==str2[j] 则Grape[i][j] = 1 // 因此最长的公共子串为Grape图中最长的1对角线长 // 因此优化下 // if // str1[i] != str2[j] 阅读全文

posted @ 2019-09-21 00:13 chengyulala 阅读(259) 评论(0) 推荐(0) 编辑

导航