摘要: 使用 Python 模拟果蝇减数分裂产生配子和受精作用的过程,进而模拟性状分离比,测试基因自由组合、基因连锁和伴性遗传现象。 程序设计 染色体 Chromosome 染色体中用列表记录着该染色体携带的基因。 # 染色体 @dataclass() class Chromosome: _genes: l 阅读全文
posted @ 2022-08-19 19:48 Gyan083 阅读(331) 评论(2) 推荐(1) 编辑
摘要: /** * * * * * * * */ #ifndef __IGS__matrix_H #define __IGS__matrix_H #include <iterator> #include <iostream> namespace IGS { namespace detail { namesp 阅读全文
posted @ 2022-06-24 18:21 Gyan083 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 引用折叠和完美转发 - 知乎 auto&&、万能引用和完美转发 - 知乎 测试 点击查看代码 #include <iostream> using std::cout; using std::cerr; using std::endl; #include <type_traits> using std 阅读全文
posted @ 2022-06-18 09:58 Gyan083 阅读(52) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> class test { protected: typedef int int_type; typedef std::string str_type; typedef std::allocator<int_type> _Int_alloc; typedef s 阅读全文
posted @ 2022-06-03 14:49 Gyan083 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 问题引入 STL std::pair 中的 swap 函数是这样实现的:(来自 stl_pair.h,仅展示部分源代码) namespace std { template<typename _T1, typename _T2> struct pair { _T1 first; ///< The fi 阅读全文
posted @ 2022-06-02 21:03 Gyan083 阅读(807) 评论(0) 推荐(0) 编辑
摘要: 剖析STL内存分配器 三张图带你弄懂stl内存分配器 阅读全文
posted @ 2022-05-14 13:48 Gyan083 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 众所周知, STL 中的 \({\tt std:\,:set}\) 和 \({\tt std:\,:map}\) 内部使用红黑树来维护数据,于是有着极为优秀的时间效率:在 \(O(\log n)\) 级别的时间复杂度内进行插入、删除或查询。 同时,诸如红黑树一类的平衡树在 OI 中也有着广泛的应用。 阅读全文
posted @ 2022-04-22 22:01 Gyan083 阅读(549) 评论(2) 推荐(0) 编辑
摘要: 树分治有多种。 点分治 用于处理树上路径问题。 选择一个点作为当前的 root ,把路径分为两种: 经过 root 的路径 不经过 root 的路径 对于第 1 类路径,我们可以暴力 dfs 统计对答案的贡献。 对于第 2 类路径,它一定是在 root 的某一棵子树内,于是我们把 root 删掉,让 阅读全文
posted @ 2022-04-16 16:29 Gyan083 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 百度百科: 在计算机科学中,字面量(literal)是用于表达源代码中一个固定值的表示法(notation)。 C++ 中,字面量分为以下几种: 整型字面量 integer literal 浮点型字面量 floating-point literal 布尔型字面量 boolean literal 字符 阅读全文
posted @ 2022-04-09 17:01 Gyan083 阅读(2214) 评论(0) 推荐(1) 编辑
摘要: Markdown 公式整理(引用) MARKDOWN 公式 阅读全文
posted @ 2022-04-09 08:19 Gyan083 阅读(74) 评论(0) 推荐(0) 编辑