Dive Into Competitive Programming
Key Takeaways from TSEC CodeCell’s Dive Into Code
- Seminar by Saket Thota & Tushar Nankani
- Note: Last Year’s Virtual Seminar By CodeCell
What is CP?
Competitive Programming. It’s more of a mind sport than a coding challenge. CP is about focusin on time, efficiency and accuracy.
Author’s note: Please read the entire post and visit the approprate links. A great care has been taken into writing this and formulating the resources. If you come across some new term, please do not assume and learn it’s meaning.
Why do CP?
It helps one:
- with developing Problem Solving skills.
- to be a quick thinker.
- to think about efficency in terms of time and memory limits.
- And also, it is a part of recruitment/shortlisting for some companies for full time job roles.
If we take a broader look, and zoom out a little from this scenario — it emulates real time problem solving.
- Reading the problem and understanding it.
- Understanding the requirements.
- Thinking about an approach. (Design)
- Thinking about efficency. (Feasability)
- Coding out the problem. (Development)
- Result of the problem. (Speed, Time, Testing)
How to get started with CP?
Level 1: Learn a language.
Which programming language to choose from?
Fact: Language doesn’t matter. You can start with any. Opinion: If you’re a beginner, you can start with C++. Java syntax can be overwhelming. Python is slower at runtime and could give TLEs, while other languages could give Accepted
with the same approach.
Another Fact: There are certain performance benefits of using C++, however there are several people such as Petr (Java) and pajanegod (Python) who have reached 2400+ on Codeforces without using C++.
How do I get started with learning a language?
Any place which covers the basics right works. Opinion: Focus more on doing it than sticking to books or tutorials. A great place to evaluate your skills can be Hackerrank.
Hackerrank > Prepare By Topics > Choose A Language.
Then, move to Problem Solving.
Level 2: Practice.
Now, could be the time to take a shot at platforms like Codeforces, Codechef, etc.
Getting Started on Codechef, Codeforces
Problems on Codechef , Codeforces .
(difficulty increasing progressively)
Another tool to help aid this gradual difficulty level is A2OJ ladders.
Level 3: Give Contest
What are contests?
Solving a few problem statements under given amount of time. They are a great way to upskill yourself and maintain good speed.
Give contests with your peer group (more at the end). After giving a contest, compare your code with with someone with good rating and someone who’s code you can understand. Discuss.
Some contests suggestions.
Strategies :
- Solving effectively
- Taking part in contest
- Upsolving*
- Editorial Reading.
Upsolving:
- Solve the sums you couldn’t do. Look at others code their way of implementation.
- While reading editorial. Don’t read the entire code.
- Read one line try to think what the implementation could be, second line…and so on.
- If you don’t understand, then see the whole code.
- But try to implement and write code on your own.
Mistakes To Avoid.
Switching between problems.
- Now, if you’re coding your subconscious mind keeps thinking about the previous question. It is recommended not switch in between problems until and unless you’ve exhausted your thoughts.
Being in your comfort zone.
- One thing, don’t solve a same rating problem continuously. There will be a point where you’ll realize that you’re comfortable with these level sums. Increase the difficulty gradually.
For beginners please don’t wait to solve complete tutorials. Chances are you’ll forget overtime. Practice.
Note: Writing the code is the easiest thing to do. Thinking about how should you proceed and finding the corner case is something which will make you a problem solver. Then comes implementation. Read the problem statement properly. Don’t use the hint until it’s too necessary.
Contests to look if you are beginner :
Some Prestigious Contests:
- ICPC (Internation Collegiate Programming Contest)
- Google Kickstart, Hashcode and CodeJam
- Facebook Hacker Cup
- Codechef Snackdown
Looking for peers?
If you are beginner and looking for peers or post contest discussions, you are free to join.
Authored by Sarah Khan, co-authored by Anas Khan.
Dive Into Competitive Programming
https://geekspaceclub.xyz/post/dive-into-competitive-programming/