会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
inaku's Gensokyo
管理
2022年8月19日
基于 Python 的对果蝇基因自由组合的模拟
摘要: 使用 Python 模拟果蝇减数分裂产生配子和受精作用的过程,进而模拟性状分离比,测试基因自由组合、基因连锁和伴性遗传现象。 程序设计 染色体 Chromosome 染色体中用列表记录着该染色体携带的基因。 # 染色体 @dataclass() class Chromosome: _genes: l
阅读全文
posted @ 2022-08-19 19:48 Gyan083
阅读(461)
评论(2)
推荐(1)
2022年6月24日
matrix.h
摘要: /** * * * * * * * */ #ifndef __IGS__matrix_H #define __IGS__matrix_H #include <iterator> #include <iostream> namespace IGS { namespace detail { namesp
阅读全文
posted @ 2022-06-24 18:21 Gyan083
阅读(131)
评论(0)
推荐(0)
2022年6月18日
引用折叠 万能引用 std::forward 完美转发
摘要: 引用折叠和完美转发 - 知乎 auto&&、万能引用和完美转发 - 知乎 测试 点击查看代码 #include <iostream> using std::cout; using std::cerr; using std::endl; #include <type_traits> using std
阅读全文
posted @ 2022-06-18 09:58 Gyan083
阅读(68)
评论(0)
推荐(0)
2022年6月3日
封装类(容器)中对 std::allocator 及 __gnu_cxx::__alloc_traits 的使用例
摘要: #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
阅读(222)
评论(0)
推荐(0)
2022年6月2日
using std::swap 与 C++ ADL 机制
摘要: 问题引入 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
阅读(1157)
评论(0)
推荐(0)
2022年5月14日
STL 内存分配器及其特性萃取器
摘要: 剖析STL内存分配器 三张图带你弄懂stl内存分配器
阅读全文
posted @ 2022-05-14 13:48 Gyan083
阅读(51)
评论(0)
推荐(0)
2022年4月22日
用 STL 红黑树求第 K 大
摘要: 众所周知, STL 中的 \({\tt std:\,:set}\) 和 \({\tt std:\,:map}\) 内部使用红黑树来维护数据,于是有着极为优秀的时间效率:在 \(O(\log n)\) 级别的时间复杂度内进行插入、删除或查询。 同时,诸如红黑树一类的平衡树在 OI 中也有着广泛的应用。
阅读全文
posted @ 2022-04-22 22:01 Gyan083
阅读(1034)
评论(2)
推荐(0)
2022年4月16日
树分治
摘要: 树分治有多种。 点分治 用于处理树上路径问题。 选择一个点作为当前的 root ,把路径分为两种: 经过 root 的路径 不经过 root 的路径 对于第 1 类路径,我们可以暴力 dfs 统计对答案的贡献。 对于第 2 类路径,它一定是在 root 的某一棵子树内,于是我们把 root 删掉,让
阅读全文
posted @ 2022-04-16 16:29 Gyan083
阅读(86)
评论(0)
推荐(0)
2022年4月9日
C++ 用户定义字面量 User-defined literals
摘要: 百度百科: 在计算机科学中,字面量(literal)是用于表达源代码中一个固定值的表示法(notation)。 C++ 中,字面量分为以下几种: 整型字面量 integer literal 浮点型字面量 floating-point literal 布尔型字面量 boolean literal 字符
阅读全文
posted @ 2022-04-09 17:01 Gyan083
阅读(2818)
评论(0)
推荐(2)
Markdown 公式整理(引用)
摘要:
MARKDOWN 公式
阅读全文
posted @ 2022-04-09 08:19 Gyan083
阅读(84)
评论(0)
推荐(0)
下一页