上一页 1 2 3 4 5 6 ··· 8 下一页
摘要: 快排变种. 快排每次只进行部分排序,进入左边或者右边或者当前mid就是答案. 据说期望值是O(n) 然后STL中的 nth_element也是用这个思想. 阅读全文
posted @ 2019-02-03 16:15 过路人1998 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 机器指令: CPU能直接识别并执行的指令. 是二进制编码. 通常由操作码和操作数两部分组成. 汇编指令: 机器指令的助记符,同机器指令一一对应,可由编译器转化成机器指令. 注:每种CPU都有自己的汇编指令集 汇编的3类指令:(1) 汇编指令: 机器码的助记符(2) 伪指令 : 由编译器执行,计算机不 阅读全文
posted @ 2019-02-01 22:27 过路人1998 阅读(346) 评论(0) 推荐(0) 编辑
摘要: 题目链接: https://nanti.jisuanke.com/t/36116 题目: 在蒜厂年会上有一个抽奖,在一个环形的桌子上,有 nn 个纸团,每个纸团上写一个数字,表示你可以获得多少蒜币。但是这个游戏比较坑,里面竟然有负数,表示你要支付多少蒜币。因为这些数字都是可见的,所以大家都是不会出现 阅读全文
posted @ 2019-01-31 19:54 过路人1998 阅读(381) 评论(0) 推荐(0) 编辑
摘要: struct Edge { int lst; int v; int w; }; const int maxn = 1e5+500; const int maxe = (1e5+500) * 2; const int inf = 0x3f3f3f3f; class ISAP { public : Edge edge[maxe]; int head[ma... 阅读全文
posted @ 2018-11-29 23:31 过路人1998 阅读(227) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; const int maxe = 1e4+50; struct Edge { int lst; int to; int w; }edge[maxe * 2]; int head[128]; int qsz; inline void add(int u, in... 阅读全文
posted @ 2018-10-11 18:03 过路人1998 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 复杂度好像很乱,用了A_star不好算.要看估值函数.但是一般适用于N<=1000的 阅读全文
posted @ 2018-10-11 12:05 过路人1998 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 注意, qsz 应该是从2开始的 因为用到了^1无向图 #include #include using namespace std; const int maxn = 1e3+50; struct Edge{ int st; int lst; int to; }edge[maxn*5]; int head[maxn]; int qsz; inline v... 阅读全文
posted @ 2018-10-08 14:21 过路人1998 阅读(123) 评论(0) 推荐(0) 编辑
摘要: dfs #include #include using namespace std; const int maxn = 1e5+50; struct Edge{ int lst; int to; }edge[maxn*5]; int head[maxn]; int qsz; inline void add(int u, int v) { edge[qsz]... 阅读全文
posted @ 2018-10-08 13:04 过路人1998 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 本文来自 Fuko_Ibuki 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/qq_31908675/article/details/81233816?utm_source=copy 阅读全文
posted @ 2018-10-07 19:49 过路人1998 阅读(396) 评论(0) 推荐(0) 编辑
摘要: #include <queue> #include <cstdio> #include <cstring> using namespace std; const int maxn = 1e6+500; char str[maxn]; class AC { int next[maxn][26]; in 阅读全文
posted @ 2018-10-02 14:46 过路人1998 阅读(247) 评论(2) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 8 下一页