摘要:
/* //ABDCDCBABC CBABCDCDBA 7 最长相同子序列(不需要连续)采用动态规划DP 二维表 输出最后一个位置就可*/#include <iostream> #include <string> using namespace std; int n, m; string a, b; 阅读全文
摘要:
基础 #include <iostream> #include <algorithm> #include <cstring> #include <stdio.h> using namespace std; typedef unsigned long long LL; LL n, m, mod; vo 阅读全文
摘要:
#include <iostream> #include <algorithm> #include <stdio.h> #include<cstdlib> #include<cstdio> using namespace std; int main() { long long t10[100]; c 阅读全文
摘要:
深度优先搜索(DFS) 深度优先搜索在搜索过程中访问某个顶点后,需要递归地访问此顶点的所有未访问过的相邻顶点。 初始条件下所有节点为白色,选择一个作为起始顶点,按照如下步骤遍历: a. 选择起始顶点涂成灰色,表示还未访问 b. 从该顶点的邻接顶点中选择一个,继续这个过程(即再寻找邻接结点的邻接结点) 阅读全文