- Notifications
You must be signed in to change notification settings - Fork208
Everything competitive programming related - introductory guide, topics/concepts, practice problems, snippets & templates, tips & tricks and more.
License
the-hyp0cr1t3/CC
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Programming is all about writing code to solve problems or tasks. Competitive programming makes a sport out of this, where contestants compete (usually online) to solve a bunch of such problems in a limited amount of time.
Problems are primarily math, logic and/or algorithm based and typically look something likethis. Such problems usually consist of a statement (that details the task), the input and output format, constraints on the input and some examples (will be further explained later on).
Trythis problem. Read the statement carefully and try to understand what it is asking. Once you figure it out, all that's left is to code it.
Here's what one of the many possible solutions looks like.
C++ code
#include<bits/stdc++.h>usingnamespacestd;intmain() {int n; cin >> n;while(n--) { string s; cin >> s;if(s.length() <=10) cout << s << endl;else cout << s.front() << s.length()-2 << s.back() << endl; }return0;}
Most competitive programmers prefer C++, and forgood reason. However, Java and Python are also fairly popular. Knowing a programming language is the only pre-requisite. While I do say that, you are by no means expected to be an expert. If you can manage a basic hello world and can work with loops and conditionals, you are good to go.
Note: The code snippets in this guide will be in C++ since it is arguably the best language for competitive programmingand not because I do not know any other languages :/ UPD: I learnt a little bit of Java and Pythom :)
If you haven't already set up an IDE, you may find use for one of the following links. I personally use Sublime Text, with VS code being my second choice, but it is a matter of personal preference.
There are many platforms that host programming contests and allow you to practice solving problems, among other things. One such platform isCodeforces, which I primarily use and recommend.
Here is a detailed guide I've written about problem statements, how contests work and the rating system on Codeforces (and a few other platforms).
Here are a few problems for you to get started with. They're really simple and should help you understand how to submit code on online platforms.
Click
Once you're done with these, head on over to theproblemsetI liked bugabooset better on Codeforces and sort problems by rating. Solve some easy problems till you get a feel for it.
Once you familiarize yourself with these things, here are some things you could consider doing next:
Time complexity: Take a look attime and space complexity, as you will soon realise that not all logically 'correct' solutions pass the given constraints.
Learn new concepts/topics: Develop your problem solving skills by learning new topics, one at a time.Here's a collection of some common beginner topics and problems on the same. Thecses problemset is another great place to practice standard problems from various topics.
Practice: Turn to the codeforcesproblemset, and sort by difficulty and tags. Grind problems because there's nothing likepractice, practice, practice.
Contests: Participate in livecontests or takevirtual ones. Virtual contests are a way to participate in or experience old contests that have already happened in the past.
The secret formula

In all seriousness thoughLearn new topic > Practice problems > Improve speed > Learn new topic > Practice ... Rinse and repeat.- Cool repos:YouKn0wWho,smax,Ashishgup
- Rating predictor:CF Predictor orCarrot
- Problem/Contest parser:Competitve Companion coupled with
- Competitve Programming Helper (for VS code)
- FastOlympicCodingHook [alt] (for Sublime Text)
- Stats:Codeforces Visualizer,Codeforces Practice Tracker,CF Analytics
- Misc:Codeforces Live Telegram Bot,Codeforces Enhancer,Codeforces Customizer,Dark mode
About
Everything competitive programming related - introductory guide, topics/concepts, practice problems, snippets & templates, tips & tricks and more.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Contributors7
Uh oh!
There was an error while loading.Please reload this page.