Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nfriedly/stripe-ctf-2014-level0
A simple Big-O reduction
https://github.com/nfriedly/stripe-ctf-2014-level0
Last synced: 17 days ago
JSON representation
A simple Big-O reduction
- Host: GitHub
- URL: https://github.com/nfriedly/stripe-ctf-2014-level0
- Owner: nfriedly
- Created: 2014-02-03T15:21:32.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-03T15:22:22.000Z (almost 11 years ago)
- Last Synced: 2024-10-12T16:22:45.030Z (about 1 month ago)
- Language: Python
- Homepage: https://stripe-ctf.com/
- Size: 234 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Level 0
## Usage
To submit your code, first commit, and then run `git push`.
Only the program input will vary; we'll always run against the same
dictionary (`test/harness` will download that dictionary for you if
you don't have it).See https://stripe-ctf.com for context on this level.
## Observations
It's hard to know what this script does, but it seems to take time
depending on the size of the input:$ time ./level0 < short.txt >/dev/null
real 0m1.231s
user 0m1.132s
sys 0m0.096sCompare to:
$ time ./level0 < long.txt >/dev/null
real 0m14.060s
user 0m12.952s
sys 0m1.104s`wc -c` shows that long.txt is about 10 times larger than short.txt,
so it seems like the runtime grows linearly with input size. Since it
also has to read the entire input, there's not going to be a way to do
better than a linear-time solution.## Catalog
- `build.sh`: We'll run this file before trying to run your code. This
is likely only relevant if you rewrite in another language, but it
also could be useful for something like fetching dependencies via
Bundler. Feel free to modify it arbitarily; we'll run the modified
version on our build servers. (https://stripe-ctf.com/about#build
has more information on the build process.)- `level0`: The mysterious program. Why so slow?
- `long.txt`: An example long input file.
- `short.txt`: An example short input file.
- `README.md`: This file :).
- `test/*`: A framework to make it easy for you to run test cases
locally. You should only ever have to run `test/harness`.