最小生成树 (正边,负边都可以) Prim 朴素版 O(n^2) 稠密图,代码短,跟Dij很相似 算法流程(以点来扩展): 初始化dist [i] 为 正无穷 for i 0 ~ n ? 先集合外距离最近的点 赋值给 t ? 用 t 更新 其他点到 集合 的距离 ? st[t] = true; ? ...
分类:
其他好文 时间:
2019-09-21 12:52:29
阅读次数:
66
function get_dir_parent(dir:string;n:integer):string; //n为几级父目录varst:string;i:integer;begin st:=GetCurrentDir; SetCurrentDir(dir); for i:=1 to n do be ...
K = 1..length(S)求出所有长度为K的子串中出现次数最多的子串的出现次数 | endpos(st) |就是st这个状态包含的子串在S中出现的次数 在parent tree上自底向上累加| endpos |,考虑特殊情况:当前状态包含S的前缀,则额外+1,最后统计答案即可 C++ incl ...
分类:
其他好文 时间:
2019-09-20 17:10:04
阅读次数:
91
public static void main(String args[]) { String str = "this is Java"; System.out.println(removeCharAt(str, 3)); } public static String removeCharAt(St ...
分类:
其他好文 时间:
2019-09-19 23:40:46
阅读次数:
86
1 #include<cstdio> 2 #include<iostream> 3 #include<cmath> 4 #include<cctype> 5 #include<algorithm> 6 using namespace std; 7 int n,m; 8 int logg[100005 ...
分类:
其他好文 时间:
2019-09-19 21:25:34
阅读次数:
89
"Luogu P4122 [USACO17DEC]Blocked Billboard" 解析 + 画图想一想,莫得想复杂咯! Code cpp include include include include include define LL long long using namespace st ...
分类:
其他好文 时间:
2019-09-19 21:16:09
阅读次数:
75
[TOC] 1. 文件类型 Linux下一切皆文件,但文件也分为7种类型,文件类型信息包含在struct stat结构的st_mode成员中,可以用下表中的宏来检测文件类型,这些宏的参数都是stat.st_mode。 | 文件类型 | 说 明 | 检测文件类型的宏 | | | | | 普通文件 | ...
分类:
其他好文 时间:
2019-09-19 00:53:00
阅读次数:
108
mysql查询的过程图 为什么要优化 系统的吞吐量瓶颈往往出现在数据库的访问速度上 随着应用程序的运行,数据库的中的数据会越来越多,处理时间会相应变慢 数据是存放在磁盘上的,读写速度无法和内存相比 如何优化 设计数据库时:数据库表、字段的设计,存储引擎 利用好MySQL自身提供的功能,如索引等 横向 ...
分类:
数据库 时间:
2019-09-16 09:29:10
阅读次数:
108
参考链接1:https://blog.csdn.net/VictoriaW/article/details/75314737 参考链接2:https://blog.csdn.net/sheldonwong/article/details/86684761 Unicode和str Unicode st ...
分类:
编程语言 时间:
2019-09-15 19:54:40
阅读次数:
119
个人整理,借鉴网络 1、C和C++中struct的区别 1)、C的struct无protect和private属性,C++的有 2)、C不能定义函数,C++能 3)、C中struct加了typedef才能定义成类型,C++不需要 2、C++中的 struct 和 class 有什么区别? 1)、st ...
分类:
编程语言 时间:
2019-09-15 00:36:37
阅读次数:
104