Giter Club home page Giter Club logo

cl-competitive's Introduction

Common Lisp code collection for competitive programming

Build Status

This code collection is maintained mainly for competitive programming, and partly for just understanding algorithms.

License

The greater part of this library is distributed as public domain, or licensed under either CC0 or the MIT license, whichever gives you the most rights in your legislation. Some code, however, has its specific license (usually because it is a dead copy of other library). For the details, please see the header of each file.

Style

Although I put this code collection in a ASDF module, this project is primarily made for competitive programming and the whole structure will be quite different from a common ASDF library. I don't recommend that you directly load this module for your software.

On portability: I try to write portable code as long as the code structure doesn't get too complicated. However, I occasionally use extensions and behaviours of SBCL x86-64, mainly for performance reasons. Below is a SBCL-specific feature that I always depend on:

  • declaration as assertion

Below are the features that I sometimes use:

  • bivalent stream
  • extensible sequence
  • sb-ext:array-storage-vector and sb-kernel:%vector-raw-bits
  • sb-c:define-source-transform

Every data structure and algorithm uses a 0-based index and a half-open interval unless otherwise noted.

Test environment

  • SBCL 2.1.6 (x64, linux) — yukicoder's version
  • SBCL 2.0.3 (x64, linux) — AtCoder's version
  • SBCL 1.3.13 (x64, linux) — CodeChef's version
  • SBCL 1.3.1 (x64, linux) — HackerEarth's version

Contents

Unclassified data structures

Unclassified algorithms

Arithmetic and algebra

Real and complex

Bit operations

Graph

Optimization

Euclidean geometry

String

I/O

Other utilities

Weird things

  • integer-pack.lisp defstruct-like macro to deal with an integer as a structure of several integer slots
  • increase-space.lisp This header runs another SBCL as external process and leaves the entire processing to it. (This ugly hack was invented to increase the stack size of SBCL on online judges.)
  • compile-time-increase-space.lisp analogue of increase-space at compile time

cl-competitive's People

Contributors

privet-kitty avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.