Compare commits

...

2 Commits

Author SHA1 Message Date
Mattéo Delabre 8084cadad9
Fix option count computation 2021-01-26 23:00:19 +01:00
Mattéo Delabre f9d6b18bb9
Set memory limit to 6 MB 2021-01-26 23:00:06 +01:00
2 changed files with 3 additions and 2 deletions

View File

@ -2,5 +2,5 @@ How to run:
```
docker image build --quiet --tag runall-image .
docker container run --tty --rm --read-only runall-image
docker container run --tty --rm --read-only --memory=6m runall-image
```

View File

@ -21,7 +21,8 @@ def check_pairs(script, pairs):
def find_script(pairs, max_length):
candidates = []
total_options = len(string.printable) ** max_length
chars = len(string.printable)
total_options = int((chars ** (max_length + 1) - 1) / (chars - 1))
current_option = 0
for length in range(max_length + 1):