General-purpose header-only modern c++(20+) library with well-abstracted algorithm and data structure implementations. It's useful for solving algorithmic problems, but not limited to it.
- [s,e) half opened range
- 0-based-index
- Support negative index (same as python) (only suppoerted in Arr<T> as of now)
Requirements: ubuntu(20.04+), g++(10.3.0+)
git clone https://github.com/tuxedcat/ps.cpp
cd ps.cpp
tool/build_cmake.sh src/sample/helloworld.cpp Debug
cat build/submit.cpp #It resolves all header file dependancies and merge them into build/sumit.cpp
build/src/sample/helloworld.cpp/Debug/ps.cpp.out
#include "core/base.h"
i32 main(){
//Can get arbitrary tuple from stdin
auto [n,m,k,x]=input<int,short,int,string>();
//Can create and read dynamic array of arbitrary dimension
//This creates n*m*k dynamic array, then read values from stdin
auto a=input(ARR(n,m,k,0ll));
//Can print an arbitrary tuple and dynamic array
dbg(n,m,make_tuple(k,x),a);
}
2 3 2 hi
1 2
3 4
5 6
0 0
1 1
2 2
n,m,make_tuple(k,x),a;=
< 2, 3,
-< 2, hi,>,
-{
--(
---[ 1, 2,],
---[ 3, 4,],
---[ 5, 6,],),
--(
---[ 0, 0,],
---[ 1, 1,],
---[ 2, 2,],),},>
- Install CompetitiveCompanion extension to your webbrowser
- Install nodev14+ and expressjs
- Run
node tool/tcsaver.js
- Click the extension on webbrowser will download all examples on current page into
./test/*
- Run
tool/tc.sh [executable file path]
will check all output automatically.
You can use preset VSCode tasks. For more information, .vscode/tasks.json
- Due to dependancy resolving logic, #include must be located on top of source file.
- Don't use Subtyping-Polymorphism. (pslib assume this for simple code)