Skip to content

Commit

Permalink
禁止套娃!! (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sallee1 authored Feb 11, 2024
1 parent 7c39609 commit 760ed9b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Sallee1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 禁止套娃

## 禁止禁止套娃

### 禁止禁止禁止套娃

#### 禁止禁止禁止禁止套娃

##### 禁止禁止禁止禁止禁止套娃

###### 禁止禁止禁止禁止禁止禁止套娃

创建一个指向自己的符号链接,然后用dir命令递归展开,BOOM

实际上因为cmd的路径有260个字符限制,所以展开到128层就停止了

但是如果有两个指向自己的符号链接呢

理论上就能展开出$\sum_{k=0}^{n}C_{n}^{k} = 2^n$ 条路径

如果n取128,则总共会展开出$3.4028*10^{38}$条路径

当然有点慢就是了,我电脑跑了一个半小时才达到4GB的题目要求

另外要不是因为CMD只能存储一行命令输出,只能用PWSH调用CMD以存储命令输出,如果只用CMD,字符数能更少
Binary file added Sallee1/a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Sallee1/a.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CMD /CMKLINK /D C .
CMD /CMKLINK /D M .
$D = CMD /CDIR /S

0 comments on commit 760ed9b

Please sign in to comment.