Git Product home page Git Product logo

cpt's Introduction

CPT

competitive programming template

TL;DR: write all your code in source/example.cpp, reset the file when done and depend on the judging systems to keep your code :)

Linux

To add a new task use: ./create exampleTask

A new file called exampleTask.cpp will be created in the source folder and is added to the cmake build system. The new file contains our current c++ template. All left to do is implement your main!

Windows

I recommend a WSL and Clion setup. If you cloned this repo into the windows filesystem, then you probably have windows line endings and get an error when running the create script from WSL. You can change this with dos2unix ./create which changes line endings of the create file. To avoid this in the future read about the git core.autocrlf option.

MacOS

Try the same as for Linux. When using clang the <bits/stdc++.h> header does not work. I recommend gcc because that's what most juding systems use.

Sanitizers

I enabled sanitzers for gcc and clang. Set ASAN_OPTIONS=abort_on_error=1 for easier debugging. Same for UBSAN_OPTIONS. Clion has a settings page for these options. Go to Settings / Preferences | Build, Execution, Deployment | Dynamic Analysis Tools | Sanitizers and put abort_on_error=1 under AddressSanitizer and UndefinedBehaviorSanitizer. This will open the debugger when the sanitizer finds an error.

When debugging reaches end of main the sanitizer might falsely detect an error. Ignore this.

I don't want to use the ./create script -.-

Ok. To create a new executable copy .template.cpp to the source folder and add the line add_executable([name] [name].cpp) to source/CMakeLists.txt.

cpt's People

Contributors

chistopher avatar fpottbaecker avatar scheibel avatar wgierke avatar

Watchers

 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.