Coder Social home page Coder Social logo

cbarnson / codeforces-cpp Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 384 KB

This repository is for CodeForces problem solutions, written in C++

License: Other

C++ 94.50% Shell 1.43% Python 3.07% Batchfile 1.00%
cpp competitive-programming codeforces codeforces-solutions cplusplus contests algorithms

codeforces-cpp's Introduction

CodeForces C++

Check out my blog at CodeBarn.ca for more

CodeBarn Blog

Overview

This repository is for CodeForces problem solutions, written in C++. Also included are a handful of useful data structures, algorithms, and various implementations I've written over the years.

Getting started

Most C++ programs you'll find in this repository are standalone, single-file. Most competitive programming contests and sites offer GNU GCC, so that's generally what we want to build with. C++11 was/is considered very standard, but most contests and online judging systems also allow for C++14 or even C++17; no that there is a huge difference in features. But you always want to use the same compiler as the judging system you'll be submitting against, so don't just fire up your Visual Studio IDE without a second thought. Problems are meant to be solved in a contest-setting, which means (ideally) your code is relatively short, and certainly a single source file. Most people opt for a lighter editor like Emacs, Vim, or even VS Code.

Compile / debugging

Compilation is almost always the same (see below), and you run your executable with input being piped in from a file, e.g. ./solution.exe < input.txt, and output to standard out (redirect to file with ./solution.exe < input.txt > output.txt).

On Windows, I enjoy using MSYS2 since you get pacman. But you can also try Cygwin, or you can download MinGW-64 and use a MinTTY emulator like Git-bash. On Linux, just use whatever you have, as GCC is pretty universally accessible (on new setups of say, Ubuntu for example, you may need to run sudo apt-get install build-essential).

Once you're all setup, with your solution contained in a single C++ source file like main.cc file ready to go, compile with:

g++ -std=c++17 -Wall main.cc -o main.exe

Submission (CodeForces)

Lets say you are solving problem 1102E on CodeForces (here). You want to submit. From the problem page, on the side bar select the language and compiler:

Links

Online judges

Learning

Licensing

The code in this project is licensed under MIT license.

The MIT License (MIT)

Copyright (c) 2019 C. Barnson

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

codeforces-cpp's People

Contributors

cbarnson avatar

Stargazers

 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.