Giter Club home page Giter Club logo

cfbooster's Introduction

CFBooster

Something diff

This is forked from CFBooster.

To parse more platforms , I use a extension competitive-companion so that this tools can be used in both Windows and Ubuntu. In fact, to use it you just need python3 and a browser with extension competitive-companion worked.

Upstream resp readme

What's this?

A small tool that may help you a bit in Codeforces contests. (Currently C++ only)

How to use?

Make sure you have python, beautifulsoup4, requests installed. It should work for both python2 and python3.

Run cfbooster.py in your work path. Enter the round id you're taking part.

For example, if you're entering https://codeforces.com/contest/1279, input 1279.

Also you can call python some/cool/path/cfbooster.py 1279 directly.

What can it do exactly?

see in action (speed adjusted)

Roughly, it will read sample inputs & outputs and try to parse input format (will fail on some problems, of course). You just need to write based on the generated code in the 'main' function and compile & run normally.

After you run the binary, you can input one of the following:

  • If you want to test on all samples, input a.
  • If you want to test the i-th sample, just input i in the first line (your output will be compared with sample output after removing some blanks & spaces).
  • If you only want to feed the i-th sample as input, input i followed by r or s, e.g. 2r/2s ('r'ead will display the sample output while 's'ilent won't display anything more).
  • If you just want to run normally, press enter.

If you want to use the binary normally, say you want to call ./program <my_in, do it with command line argument r(aw): ./program r <my_in.

Also, if you want to add more samples, you can follow the format of the comment at the end of the file.

How does it work?

The inputs & outputs are stored in the comments of the code. The program will try to read its own code by opening __FILE__. It won't work if you moved your source file after compiling!

Input parsing is done with some switch-cases (yes, there's no deep learning down there). For further details you can refer to the very clumsy code. Currently int,long long,double,string,vector<int>,vector<long long>,vector<double>,vector<string> are the only supported types. The input parsing is very fragile. Check if the input is correct before you actually submit!

I want to put my own templates in!

Just open cfbooster.py and follow the comments.

I want to contribute!

If something goes wrong or something can be improved, feel free to submit an issue or open a pull request.

cfbooster's People

Contributors

fjzzq2002 avatar inzamz 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.