自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 收藏
  • 关注

原创 算法之生成全排列

#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

原创 区间动态规划 LeetCode 1000 Minimum Cost to Merge Stones

区间动态规划 LeetCode 1000 Minimum Cost to Merge Stones

2021-02-03 15:51:28 99

原创 区间动态规划 石子合并

#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

原创 动态规划 LeetCode 10 Regular Expression Matching

动态规划 LeetCode 10 Regular Expression Matching

2021-01-27 10:03:14 84

原创 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 76

原创 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 104

原创 判断一个字符串是不是另一个字符串的子字符串

#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 605

原创 判断一个序列是不是另一个序列的子序列

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 507

原创 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 534

原创 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

原创 topcoder srm 696 div2 Clicountingd2分析

topcoder srm 696 div2 Clicountingd2分析 图的clique是图的完全子图(即子图的任意两个顶点之间都有边连接),clique的大小是clique中顶点的数量。给定一个图,其中有些顶点之间的边是未知的,以'?'表示。假如有k条边是未知的,那么总共会有2^k个不同的图,求这2^k个图的最大clique的大小的和。

2016-08-29 01:36:00 516

原创 tightvnc 源码分析

tightvnc 版本 2.7.10。

2016-01-21 02:20:54 1161

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除