Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lmj01 committed May 23, 2024
1 parent 2482a0c commit 2b3d5f7
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 3 deletions.
3 changes: 3 additions & 0 deletions articles/2024/umi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# [Umi](https://umijs.org/)

[github]()
1 change: 1 addition & 0 deletions cpl/cplusplus.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
55 changes: 54 additions & 1 deletion exercises/math.primary.md
Original file line number Diff line number Diff line change
@@ -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







4 changes: 4 additions & 0 deletions exercises/number.theory.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
- 模运算
- 等差数列求和运算
- 排列组合

## 完全剩余系
Complete Residue System是数论中的一个概念,指在模n的条件下从1到n-1的一个整数集合,这个集合中的每个数都与n互斥,并且这个集合包含了所有可能的模n的余数。

5 changes: 3 additions & 2 deletions web/library.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#

相关库,工作中使用过
相关库,工作中使用过,分析并学习的库

## Quill
> quill富文本编辑器
Expand Down Expand Up @@ -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)

# 其他库

Expand Down
2 changes: 2 additions & 0 deletions web/pkg.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand All @@ -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
Expand Down

0 comments on commit 2b3d5f7

Please sign in to comment.