2023年8月4日

matlab笔记二

摘要: # $Note2$ ## 特殊矩阵 ``` zeros(3,4) % 零矩阵 ones(4,5) %一矩阵 eye(3) %单位矩阵 eye(3,4) rand(2) % 元素大小0~1的随机矩阵 randn(2,3) % 均值为0,方差为1的随机矩阵 exA=20+30*rand(5) % [20 阅读全文

posted @ 2023-08-04 21:21 dolires 阅读(59) 评论(0) 推荐(0)

matlab笔记一

摘要: # $Note1$ ## 基本数据类型 ``` 1.16 32 64 bit int float double(默认) signed unsigned 2.complex(real+image) 3.format long/short ``` ## 矩阵 ``` % 空格/逗号分隔同一行之间的数 A 阅读全文

posted @ 2023-08-04 21:12 dolires 阅读(36) 评论(0) 推荐(0)

2023年8月3日

字符串

摘要: # 复健$Day9$ ## 字符串相关算法 ### $1.$最小表示法 最小表示法就是找出字符串$s$的循环同构串中字典序最小的那一个 时间复杂度为$O(n)$ ``` char s[maxn]; int n; int get_min(char *s) { n=strlen(s+1); for(in 阅读全文

posted @ 2023-08-03 15:03 dolires 阅读(24) 评论(0) 推荐(0)

图论提高

摘要: # 复健$Day7$ ## 图论一 $DGA:$有向无环图 $SCC:$强连通 $BCC:$双连通 强联通:有向图中,两个顶点至少存在一条路径(两个顶点可以互相到达) 强连通图:每两个顶点都强连通的有向图 强连通分量:有向图的极大强连通子图 ### $1.$有向图的强连通分量 #### 问题模型: 阅读全文

posted @ 2023-08-03 15:01 dolires 阅读(33) 评论(0) 推荐(0)

图论四

摘要: # 复健$Day7$ ## 图论四 如果一张无向图的$N$个节点可以分成$A,B$两个不相交的非空集合,并且同一集合内的点之间没有边相连,那么称改无向图为**二分图** > 二分图不存在奇环(长度为奇数的环) > > 因为每一条边都是从一个集合走到另一个集合,只有走偶数次才能回到出发点 ### $1 阅读全文

posted @ 2023-08-03 15:00 dolires 阅读(26) 评论(0) 推荐(0)

图论三

摘要: # 复健$Day7$ ## 图论三 ### $1.$网络流最大流问题 平均来看$Dinic$算法效率强于$EK$算法,所以我这里只学习了$Dinic$算法 网络流是指有一个源点和一个汇点的图,然后每条边有流量限制,我们通过这个算法可以求出源点最大流量 时间复杂度为$O(nm^2)$ https:// 阅读全文

posted @ 2023-08-03 14:59 dolires 阅读(12) 评论(0) 推荐(0)

图论二

摘要: # 复健$Day7$ ## 图论二 ### $1.$拓扑排序 ``` #include #include #include #include #include #define maxn 10010 using namespace std; int head[maxn],tot,n; struct E 阅读全文

posted @ 2023-08-03 14:59 dolires 阅读(10) 评论(0) 推荐(0)

图论一

摘要: # 复健$Day7$(图论一) ## $1.$单源最短路的建图方式 ### $1.$香甜的黄油 https://www.acwing.com/problem/content/description/1129/ ``` #include #include #include #include #incl 阅读全文

posted @ 2023-08-03 14:58 dolires 阅读(11) 评论(0) 推荐(0)

搜索二

摘要: # 复健$Day6$ 注:这一篇笔记里的搜索题都非常简单 ## 搜索二 ### $1.$迷宫 https://www.luogu.com.cn/problem/P1605 不要忘了回溯 ``` #include #include #include #define maxn 10 using name 阅读全文

posted @ 2023-08-03 14:57 dolires 阅读(196) 评论(0) 推荐(0)

搜索一

摘要: # 复健$Day 6$ ## 搜索一 ### 一.基础的$DFS$和$BFS$ 宽搜我不是很常写,这里给出模板 ``` void BFS() { queue q; int vis[maxn]; q.push(s); while(!q.empty()) { int x=q.front();q.pop( 阅读全文

posted @ 2023-08-03 14:56 dolires 阅读(132) 评论(0) 推荐(0)

导航