Skip to content

Commit

Permalink
fixed brench
Browse files Browse the repository at this point in the history
  • Loading branch information
lovemilk2333 committed Feb 9, 2024
2 parents 8188d78 + 06813e3 commit 72906d1
Show file tree
Hide file tree
Showing 30 changed files with 45 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/rank.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from scoring import file_score, best_file_score
from scoring import file_score, best_file_score, filter_ext
from pathlib import Path

if __name__ == '__main__':
Expand All @@ -11,7 +11,7 @@
if player.stem.startswith('.'):
continue

result = best_file_score([x for x in player.glob('**/*') if x.is_file()])
result = best_file_score([x for x in player.glob('**/*') if x.is_file() and not x.suffix in filter_ext])
if result:
path, score = result
score_list.append((player.stem, path, score))
Expand Down
5 changes: 4 additions & 1 deletion .github/scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import pathlib


filter_ext = [".md", ".txt", ".png", ".jpg", ".gif", ".bmp"]


def file_score(path: pathlib.Path) -> typing.Optional[typing.Tuple[int, int, int]]:
"""Return the score of a file based on its length and number of used characters."""

Expand Down Expand Up @@ -68,5 +71,5 @@ def best_file_score(path_list: typing.List[pathlib.Path]) -> typing.Optional[typ
print('Usage: python scoring.py <files>')
exit()

paths = [pathlib.Path(arg) for arg in sys.argv[1:]]
paths = [pathlib.Path(arg) for arg in sys.argv[1:] if not pathlib.Path(arg).suffix in filter_ext]
best_file_score(paths)
2 changes: 1 addition & 1 deletion .github/workflows/auto_rank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:

jobs:
build:
rank:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions Cherry-mma/main.wl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Range[9^9]
Binary file added Cherry-mma/截图.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Cherry/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main(){while(1)malloc(9);}
Binary file added Cherry/截图.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added HisAtri/oom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Moeweb647252/IMG_20240209_220214.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Moeweb647252/Screenshot_20240209_220554.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Moeweb647252/oom.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
%0|%0
1 change: 1 addition & 0 deletions Moeweb647252/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fork炸弹,理论上能占满内存
1 change: 1 addition & 0 deletions Ns2Kracy/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package main;func main(){for{_=make([]byte,1<<32)}}
Binary file added Ns2Kracy/oom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Ns2Kracy/oom2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
## 比赛规则

- 使用最短的代码占满内存!考虑大家设备各不相同,为方便比赛计量,实际占用 4G 及以上的内存即可
- 要求在不使用断点等调试手段的情况下,使用 任务管理器 / htop / top 等第三方主流工具 **截图** 并上传
即要占用一定的时间,申请内存后立刻进程结束这种无法截图的不行
- 计分规则为:代码字符数量 乘 字符种类。最小者获胜!
- 对于类似 Matlab 等解释器本身占用极大的语言,实际占用需减去解释器本身占用
- 不准联网;不准通过环境变量、文件名、编译参数等耍赖;不准使用专门为本次比赛设计的编程语言、操作系统、API 等。总之不准卡 bug,主办方享有比赛规则解释权(
Expand All @@ -22,15 +24,27 @@
<!-- begin of RANKING -->
| Rank | Player | File | Length | Category | Score |
| ---- | ------ | ---- | ------ | -------- | ----- |
| 1 | [wanz](wanz) | [oom.py](wanz/oom.py) | 9 | 3 | 27 |
| 2 | [dragove](dragove) | [oom.py](dragove/oom.py) | 9 | 5 | 45 |
| 3 | [HisAtri](HisAtri) | [new.py](HisAtri/new.py) | 10 | 5 | 50 |
| 4 | [mr_cino](mr_cino) | [oom.wo](mr_cino/oom.wo) | 26 | 17 | 442 |
| 1 | [Moeweb647252](Moeweb647252) | [oom.bat](Moeweb647252/oom.bat) | 6 | 4 | 24 |
| 2 | [wanz](wanz) | [oom.py](wanz/oom.py) | 9 | 3 | 27 |
| 3 | [dragove](dragove) | [oom.py](dragove/oom.py) | 9 | 5 | 45 |
| 4 | [HisAtri](HisAtri) | [new.py](HisAtri/new.py) | 10 | 5 | 50 |
| 5 | [Cherry-mma](Cherry-mma) | [main.wl](Cherry-mma/main.wl) | 10 | 9 | 90 |
| 6 | [lovemilk](lovemilk) | [oom.rb](lovemilk/oom.rb) | 14 | 10 | 140 |
| 7 | [Rear_Sagittar](Rear_Sagittar) | [fuckwin.ps1](Rear_Sagittar/fuckwin.ps1) | 13 | 12 | 156 |
| 8 | [Zhilu](Zhilu) | [simple-oom.js](Zhilu/simple-oom.js) | 17 | 13 | 221 |
| 9 | [yusuixian](yusuixian) | [main.cpp](yusuixian/main.cpp) | 26 | 17 | 442 |
| 10 | [mr_cino](mr_cino) | [oom.wo](mr_cino/oom.wo) | 26 | 17 | 442 |
| 11 | [Cherry](Cherry) | [main.c](Cherry/main.c) | 27 | 18 | 486 |
| 12 | [RaySky_Rt](RaySky_Rt) | [oom.cpp](RaySky_Rt/oom.cpp) | 30 | 19 | 570 |
| 13 | [lianhong](lianhong) | [main.go](lianhong/main.go) | 43 | 24 | 1032 |
| 14 | [wzyisyyds](wzyisyyds) | [rust.rs](wzyisyyds/rust.rs) | 48 | 27 | 1296 |
| 15 | [Ns2Kracy](Ns2Kracy) | [main.go](Ns2Kracy/main.go) | 52 | 32 | 1664 |
<!-- end of RANKING -->

## 奖品

- 第一名:一箱难喝的黑咖啡。由 [@MistEO](https://github.com/MistEO) 赞助!
- 第一名:一箱难喝的黑咖啡。由 @MistEO 赞助!
- 最佳创意奖:10 美元 苹果 或 Google Play 礼品卡。由 @守夜人 赞助!

欢迎老板们赞助更多奖品~

Expand Down
1 change: 1 addition & 0 deletions RaySky_Rt/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
~~我cpp还能再压.jpg~~
1 change: 1 addition & 0 deletions RaySky_Rt/oom.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
int main(){for(;;)new int[9];}
Binary file added RaySky_Rt/oom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Rear_Sagittar/fuckwin.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
for(){&calc}
Binary file added Zhilu/simple-oom-zhilu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Zhilu/simple-oom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Array(1e9).fill()
1 change: 1 addition & 0 deletions lianhong/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package main;func main(){_=make([]int,9e9)}
Binary file added lianhong/任务管理.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lovemilk/oom.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(9..9**9).to_a
(9..9**9).to_a
Binary file added wzyisyyds/QQ截图20240209210626.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions wzyisyyds/rust.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fn main() {let mut v = vec![];loop {v.push(0);}}
6 changes: 6 additions & 0 deletions yusuixian/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
msvc

![image](https://github.com/InvoluteHell/OutOfMemory/assets/47711102/d4e62dd5-bce3-40b1-ac79-c56df300a974)

https://github.com/InvoluteHell/OutOfMemory/blob/master/yusuixian/main.cpp

1 change: 1 addition & 0 deletions yusuixian/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
int main(){new int[9e9];}

0 comments on commit 72906d1

Please sign in to comment.