diff --git a/articles/2024/umi.md b/articles/2024/umi.md new file mode 100644 index 0000000..4d8a23e --- /dev/null +++ b/articles/2024/umi.md @@ -0,0 +1,3 @@ +# [Umi](https://umijs.org/) + +[github]() diff --git a/cpl/cplusplus.md b/cpl/cplusplus.md index 598aa41..00280dc 100644 --- a/cpl/cplusplus.md +++ b/cpl/cplusplus.md @@ -96,6 +96,7 @@ Argument-dependent lookup, 在[What's In A Class?][1] 中第一次看到Koenig l std::cout << 1; // 等价于 operator<< (std::cout, 1) // 当初函数调用,传入参数 ``` +[CPO](https://www.zhihu.com/question/518132411) ## TMP(template metaprogramming) diff --git a/exercises/math.primary.md b/exercises/math.primary.md index 8fd60c9..316ea57 100644 --- a/exercises/math.primary.md +++ b/exercises/math.primary.md @@ -1,2 +1,55 @@ # 小学数学 -> + +## 模数 + +### 2024-5-23 + +$$ +A = 1 \times 3 \times 5 \times 7 \times 9 \times 11 \times \cdots \cdots \times 2023 \text{的末两位是多少?} +$$ + +小学题应该找规律就可以了吧,十位乘十位就是整百,所以只要算1×3×5×7×9,然后用周期性规律得出,类似组合问题的本来就应该先简单枚举 去体会 再找到突破口。 +这里我想利用同余的乘积性质来分析这个问题。 + +求末两位数就是模100,就是求除以25和除以4的余数。A一定是25的倍数,这样末两位数只能是00,25,50,75. 由于默认是奇数2023,那么只能是25或75两个的一个。 + +$\color{red} \text{如果这个数A模4余1就是25,A模4余3就是75.}$ + +奇数模4的结果是1和-1的交叉出现 + +$$ +\text{余为正是} 1 \equiv 1 \pmod 4 \equiv 5 \pmod 4 \equiv 9 \pmod 4 \equiv \cdots \cdots \newline +\text{余为负是} -1 \equiv 3 \pmod 4 \equiv 7 \pmod 4 \equiv 11 \pmod 4 \equiv \cdots \cdots \newline +\text{而} \lceil {2023/4} \rceil = 2024 = 4 \times 506 \to 2023 = 4 \times 506 - 1 +$$ + +由此得出最后的余为负的共有506个,偶数个-1的结果是1,这样A模4的结果就是1,A的末两位数就是25. + +把问题扩展一下,就是数A的末三位数是多少呢? + +就是求模1000,分别除以125和除以8的余数。数A一定是125的倍数,且为奇数,那么它的末三位数一定是 + +$125 \times 1 = 125, 125 \times 3 = 375, 125 \times 5 = 625, 125 \times 7 = 875 $ + +$$ +125 \equiv 5 \pmod 8, 375 \equiv 7 \pmod 8, 625 \equiv 1 \pmod 8, 875 \equiv 3 \pmod 8. +$$ + +现在的问题变成求数A莫8后的余数,由于连续8个整数是模8的一个完全剩余系,这里只有奇数,所以每四个数为一组,每组四个数除以8的余数分别是1,3,5,7,即1,3,-3,-1。它们的乘积除以8的余数是1. + +1到2024是的自然数一共有2024个,其中一半的奇数,共有1012,1012恰好是4的倍数,刚好四个数一组分完。 + +$$ +1 \times 3 \times 5 \times 7 \times 9 \times 11 \times 13 \times 15 \times \cdots \cdots \times 2023 \newline += (1 \times 3 \times 5 \times 7) \times (9 \times 11 \times 13 \times 15) \times \cdots \cdots \times (2017 \times 2019 \times 2021 \times 2023) \newline +\equiv = 1 \times 1 \times \cdots \cdots \times 1 \equiv 1 \pmod 8 +$$ + +所以答案是末三位数是625 + + + + + + + diff --git a/exercises/number.theory.md b/exercises/number.theory.md index 05706b2..5abd234 100644 --- a/exercises/number.theory.md +++ b/exercises/number.theory.md @@ -8,3 +8,7 @@ - 模运算 - 等差数列求和运算 - 排列组合 + +## 完全剩余系 +Complete Residue System是数论中的一个概念,指在模n的条件下从1到n-1的一个整数集合,这个集合中的每个数都与n互斥,并且这个集合包含了所有可能的模n的余数。 + diff --git a/web/library.md b/web/library.md index cebe646..09b4505 100644 --- a/web/library.md +++ b/web/library.md @@ -1,6 +1,6 @@ # 库 -相关库,工作中使用过 +相关库,工作中使用过,分析并学习的库 ## Quill > quill富文本编辑器 @@ -93,7 +93,8 @@ new Promise(()=>{ ## [node-gyp](https://github.com/nodejs/node-gyp) node-gyp is a cross-platform command-line tool written in Node.js for compiling native addon modules for Node.js. It contains a vendored copy of the gyp-next project that was previously used by the Chromium team and extended to support the development of Node.js native addons. -## [Daikon](https://github.com/rii-mango/Daikon) +## [UMI](https://umijs.org/) +- [笔记](/articles/2024/umi.md) # 其他库 diff --git a/web/pkg.md b/web/pkg.md index 3eaaeea..666f57e 100644 --- a/web/pkg.md +++ b/web/pkg.md @@ -60,6 +60,7 @@ pnpm store prune // 删除缓存 // 工作区 pnpm add react -w // 全局公共依赖 pnpm add react --filter pkg1 // 指定项目按照 +pnpm config set store-dir e:\dev-data\.pnpm-store\v3 --global // 设置存储目录 ``` ### [Yarn is a package manager](https://yarnpkg.com/) @@ -72,6 +73,7 @@ yarn install --registry https://registry.npm.taobao.org // 清除缓存 yarn cache dir // 查看路径 yarn cache clean // 清理 +yarn config set cache-folder e:\dev-data\.yarn-store\v6 // 设置缓存路径 // 镜像设置 yarn config get registry yarn config set registry https://registry.npmmirror.com