![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++ 编程
xiaobaoo
这个作者很懒,什么都没留下…
展开
-
算法之生成全排列
#include <iostream>#include <string>#include <vector>#include <climits>#include <algorithm>vector<vector<int>> res;vector<int> p;void generatePermutation(const vector<int>& array, int index原创 2021-02-09 16:06:01 · 71 阅读 · 0 评论 -
区间动态规划 LeetCode 1000 Minimum Cost to Merge Stones
区间动态规划 LeetCode 1000 Minimum Cost to Merge Stones原创 2021-02-03 15:51:28 · 98 阅读 · 0 评论 -
区间动态规划 石子合并
#include <iostream>#include <string>#include <vector>#include <climits>using namespace std;int mergeStones(const vector<int>& stones){ int n = stones.size(); if ( n ==0 ) return 0; vector<vec...原创 2021-02-03 15:42:51 · 153 阅读 · 1 评论 -
动态规划 LeetCode 48 Scramble String
长度为n的字符串,中间有n-1个位置。原创 2021-02-02 10:31:05 · 75 阅读 · 0 评论 -
动态规划 LeetCode 10 Regular Expression Matching
动态规划 LeetCode 10 Regular Expression Matching原创 2021-01-27 10:03:14 · 80 阅读 · 0 评论 -
Minimum Edit Distance
#include <iostream>#include <vector>#include <string>using namespace std;int minimumEditDistance(string s1, string s2){ int m = s1.length(); int n = s2.length(); vector<vector<int>> dp(m + 1, vector<int&g...原创 2021-01-15 01:23:33 · 75 阅读 · 0 评论 -
Longest Common Subsequence
#include <iostream>#include <vector>#include <string>using namespace std;//int dp[1000][1000];int LCS(string s1, string s2){ int m = s1.length(); int n = s2.length(); vector<vector<int>> dp(m+1, vector<i...原创 2021-01-14 21:21:01 · 103 阅读 · 0 评论 -
判断一个字符串是不是另一个字符串的子字符串
#include <iostream>#include <string>using namespace std;bool isSubString(string s, string t){ if ( t.length() < s.length() ) return false; for (int i = 0; i <= t.length() - s.length(); i++) { int j; ...原创 2021-01-12 22:30:29 · 602 阅读 · 0 评论 -
判断一个序列是不是另一个序列的子序列
bool isSubSequence(string s, string t){ int j = 0; for (int i = 0; i < t.length() && j < s.length() ; i++) { if (s[j] == t[i]) j++; } if (j == s.length() ) return true; else ...原创 2021-01-12 21:28:24 · 506 阅读 · 0 评论 -
TCO 2014 Finals FrozenStandings 分析与题解
TCO 2014决赛题。题目大意: 给定一个数组X[i],比如{1, 0, 1, 1, 1, 0, 1, 1}.,表示选手当前做出的题。现在每位选手将再作一道题,即每位选手最后做出的题为X[i]或X[i] + 1,做出较多题的选手排在前面,如果两个选手做出相同数量的题,编号较小的选手排在前面。问最后有多少种选手?原创 2017-01-30 20:02:49 · 533 阅读 · 0 评论 -
topcoder SRM 517 div1 AdjacentSwaps 分析与题解
题目大意:给定一个N个数的排列,要将其经过N-1次的交换(只能是相邻位置数的交换),变成0到N-1的排列,问有多少种交换的排列方式。rng_58的题,费脑筋。这个一个关于排列的inversion的题。排列的inversion代表排列的有序程度。排列的inversion的数量从0到n*(n-1)/2。由此得出结论,要将一个排列经过N-1次的交换,变成0到N-1的排列,其inversi原创 2017-01-29 00:10:25 · 326 阅读 · 0 评论 -
tightvnc 源码分析
tightvnc 版本 2.7.10。原创 2016-01-21 02:20:54 · 1155 阅读 · 0 评论