Skip to content

babhishek21/oj-sols

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

128 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oj-sols

Solutions to problems in Online Judges

This repository was made with the intention of backing up my solutions for future reference, as well as serve as a reference for people who might be looking for help. Please use this sparingly. The code is not maintained, and probably never will be.

The repository does not reflect the actual statistics of my sessions on online judges. There are a few problems whose solutions I forgot to save, or cannot otherwise source. I'll try to keep it complete.

But no guarantees. I am too lazy.

Oh! And do take a look at the LICENSE file before you do something with the code.

Config & Setup

Toolchain

  1. [🅲++] If using Clang (ideally on macOS), copy my patched snippets/stdc++.h header file to /usr/local/include/bits/ (or any other CPLUS_INCLUDE_PATH location, in the bits subdiretory).

Important

Update the path to the header in the HEADER_SRC variable in the Makefile.

Tip

No need to worry about G++ as <bits/stdc++.h> is included pre-compiled by default.

  1. [🅲++] Get cxx-prettyprint and place the header files in to /usr/local/include/custom/ (or any other CPLUS_INCLUDE_PATH location, in the custom subdiretory). Useful for pretty-printing most STL containers.

  2. [🅲++] Copy snippets/*.sublime-snippet to the Sublime Text User Packages folder (~/Library/Application Support/Sublime Text/Packages in macOS).

  3. [🅲++] [☕️] Makefile and mymake

    1. Copy mymake.fish to ~/.config/fish/functions/ (or wherever your custom fish shell functions live).
      • mymake is a custom fish shell function to auto-detect the Makefile at root directory of this repo and pass it to make correctly, regardless of the working subdirectory.
    2. Makefile targets macOS and Unix-like platforms.
      • Run mymake thing.bin to smart-compile thing.cpp or thing.java into thing.bin
      • Run mymake cpp.thing.bin to force compile thing.cpp into thing.bin (bonafide executable)
      • Run mymake java.thing.bin to force compile thing.java into thing.bin (bash script that runs the generated Java class file)
      • Run mymake clean to clean out executable and generated files
      • Where Clang is available, make will try to precompile the <bits/stdc++.h> header for use.

About

Solutions to problems in Online Judges

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors