Lotuscc
Lotuscc
全部文章
C/C++语言...
C专家编程(1)
C和C指针(2)
Shell编程(8)
读书笔记(1)
随笔(9)
题解(9)
归档
标签
去牛客网
登录
/
注册
Lotuscc的博客
你和你的犬色声马,我和我的各安天涯。 千里走单骑,八方为敌。 青灯古佛度苍生,不愿度己。
全部文章
/ C/C++语言基本算法
(共34篇)
磁砖样式 另一种思路的dfs
基本的dfs搜索一般都是直接从一个点出发,再从这个点到下一个 但是这题使用了另一种思路的dfs 每次选择点不是根据上一个点来推进,而是从整个地图中选择没有选过的点 也就是扫描一遍地图,从中选择还没有使用过的点,这种方式往往用于两个点之间的转移规则比较复杂的情况,比如这题,每次需要使用两个点,而不是一...
2019-05-09
0
438
A* 求16宫格拼图
#include <QCoreApplication> #include <bits/stdc++.h> #include <iostream> #include <cstring> #include <stdio.h> using na...
2019-03-12
0
451
IDA* 求16宫格拼图
#include <QCoreApplication> #include <bits/stdc++.h> #include <iostream> #include <cstring> #include <stdio.h> using na...
2019-03-12
0
494
广度优先搜索求九宫格
#include <QCoreApplication> #include <bits/stdc++.h> #include <iostream> #include <cstring> #include <stdio.h> using na...
2019-03-12
0
539
回溯法求八皇后
#include <QCoreApplication> #include <bits/stdc++.h> #include <iostream> #include <cstring> #include <stdio.h> using na...
2019-03-11
0
395
二分求LIS
#include <bits/stdc++.h> #include <iostream> #include <cstring> #include <stdio.h> using namespace std; int L[10]; int Lengt...
2019-03-11
0
365
线段树求最长连续上升子序列
//#include <bits/stdc++.h> #include <iostream> #include <algorithm> #include <cstdio> using namespace std; struct Node { ...
2018-12-02
0
526
利用线段树求最大连续子序列和
#include <bits/stdc++.h> using namespace std; struct Node { int Pre, Max, Suf,Sum; int Left, Right; }; struct Node SegTree[100]; in...
2018-12-02
0
432
线性扫描求最长连续子序列 。
扫描法求最长连续子序列。 需要维护两个值,一个当前序列的最大值,一个总的序列的最大值。 当前的序列的最大值为前面的(最大值+当前值)与(当前值)中的较大者。 总的最大值为上一个总最大值与当前最大值中较大者。 例如 45 -88 5 2 -8 -7 88 -9 cur = 45 -43 5 7 -1 ...
2018-12-01
0
463
线段树基本操作
线段树基本操作 线段树的思想来自分治思想。首先求解两个子问题,问题的答案由两个子问题的答案得出。 例如求一个区间的最值。可分别求出左半区间的最值,再求出右半区间的最值,区间的最值为两个最值的最值。而再求左半区间和右半区间时,又可以用分治。直到最后问题化简为最简单的问题,即区间只有一个数的情况。这时,...
2018-12-01
0
418
首页
上一页
1
2
3
4
下一页
末页