https://github.com/poudel/protohacke-rs
[WIP] Solutions for https://protohackers.com
https://github.com/poudel/protohacke-rs
protohackers protohackers-solutions rust
Last synced: 3 months ago
JSON representation
[WIP] Solutions for https://protohackers.com
- Host: GitHub
- URL: https://github.com/poudel/protohacke-rs
- Owner: poudel
- Created: 2023-04-23T14:36:23.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-06-05T22:56:59.000Z (almost 2 years ago)
- Last Synced: 2025-02-15T20:45:19.169Z (3 months ago)
- Topics: protohackers, protohackers-solutions, rust
- Language: Rust
- Homepage:
- Size: 28.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.org
Awesome Lists containing this project
README
#+title: protohackers.com solutions
#+startup: overview[WIP] Solutions for https://protohackers.com exercises
* [[https://protohackers.com/problem/0][00 Smoke Test]]
TCP server that echoes back
#+begin_src shell
cargo run 0
#+end_srcTo test
#+begin_src shell
nc 127.0.0.1 8838
#+end_src* [[https://protohackers.com/problem/1][01 Prime time]]
Industrial strength primality tester
#+begin_src shell
cargo run 1
#+end_srcTo test
#+begin_src shell
nc 127.0.0.1 8838
#+end_src* [[https://protohackers.com/problem/2][02 Means to an End]]
#+begin_src shell
cargo run 2
#+end_srcTo test it quickly
#+begin_src shell
python src/means_client.py
#+end_srcthen type the messages as:
#+begin_src shell
I,1,1|I,2,2|Q,1,2
#+end_srcwhere messages are delimited by pipe and each message is delimited by
comma. The script then sends an encoded message to the running server
and prints the result of `Q`.* [[https://protohackers.com/problem/3][03 Budget Chat]]
#+begin_src shell
cargo run 3
#+end_srcThen connect with
#+begin_src shell
nc 127.0.0.1 8838
#+end_srcand again to chat!
* [[https://protohackers.com/problem/4][04 Unusual Database Program]]
Build and run as follows
#+begin_src shell
cargo run 4
#+end_srcThen connect with
#+begin_src shell
nc -u 127.0.0.1 8838
#+end_src* [[https://protohackers.com/problem/5][05 Mob in the Middle]]
Run the unusual budget chat with
#+begin_src shell
cargo run 3
#+end_srcthen run this
#+begin_src shell
cargo run 5
#+end_srcThen connect with
#+begin_src shell
nc -u 127.0.0.1 8839
#+end_src* [[https://protohackers.com/problem/6][06 Speed Daemon]]
#+begin_src shell
cargo run 6
#+end_srcto test
#+begin_src shell
python src/speed_daemon/client.py c1 c2 d
#+end_src* Notes
#+begin_src shell
rsync -avz --exclude-from '.gitignore' ./ remoteuser@remoteserver:/path/to/remote/directory
#+end_src