Giter Site home page Giter Site logo

breaklien / chainsaw Goto Github PK

View Code? Open in Web Editor NEW

This project forked from angold-4/chainsaw

0.0 0.0 0.0 744 KB

A small codeforces command line tool for competitive programming.

Home Page: http://angorithm4.org

License: MIT License

C++ 60.47% Shell 39.53%

chainsaw's Introduction

chainsaw: A Codeforces Commandline Tool

chainsaw is a small and faster drop-in replacement for your copy and paste while attending Codeforces contests. chainsaw is created for increasing competitive programmer productivity by reducing run sample test time especially in real-time contests and the sites kind of lagging due to the traffic.

Why does the speed matter?

No matter you are a competitive programmer or a hobby coder, while attending a contest, you always want things to be as convenient as possible. A contest consists of three phases. In the first phase, you create all your *.cpp or any other language file. In the second phase, you write algorithms to solve that specific problem. In the third phase, you compile your program and run all sample tests from website to check whether your code is correct.

The first phase and third phase are just repetitive copy and paste work, but it will waste a lot of time if you just do it by your self, and a little bit annoying. chainsaw can make it automatically, and much faster, saving your time and keeping you from being distracted while copy the test file from website and re-compile your program and check whether it is correct. The difference is most noticeable when you are in rapid fix/debug-edit-recompile cycles.

Install

chainsaw is written in C++17, so if you want to install chainsaw on your machine. you need a very recent version of GCC or Clang. I'm using macOS Monterey 12.1 as a development platform, I'm also testing that in Ubuntu 20.04 LTS, it can also install successfully. In that two environment, you can install chainsaw by the following commands:

Ubuntu 20.04 and later / macOS Monterey 12.1 and later

git clone https://github.com/Angold-4/chainsaw.git

cd chainsaw

./install.sh

If no error reported, then restart your shell, now you can run chainsaw on your command line.

chainsaw

By default, chainsaw is installed to /usr/local/bin

How to use

A classic way to use chainsaw
  1. When the contest start
    run chainsaw gen CNUMBER (i.e. 1616) to generate all problems file and sample tests.

gen

  1. After finishing your problem
    run chainsaw runsamples PNUMBER (i.e. H) to compile your code and check whether it is correct.

runsamples

Why is chainsaw so fast?

One reason is because it simply uses faster algorithms and efficient data structures. The other reason is that the sample tests generator is highly parallelized.

I using curl, a very simple C++ Library to fetch all html files, and using pthread to parallize the http Request, which means you can fetch 8 problems's html file just by costing one http request time.

In my machine, the chainsaw gen command only costs 4 seconds for any kinds of contests in Codeforces, which is superfast.

Logo

chainsaw image

chainsaw's People

Contributors

angold-4 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.