Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Getting started with Competitive Programming

Getting started with Competitive Programming

I gave this talk at MIT School of Engineering, Pune

Yashraj Kakkad

June 21, 2021
Tweet

More Decks by Yashraj Kakkad

Other Decks in Programming

Transcript

  1. Weekend talks with a 5-star competitive programmer Yashraj Kakkad Incoming

    Goldman Sachs Intern’21 Undergraduate Researcher, Ahmedabad University DSC Lead, Ahmedabad University Linkedin GitHub For CodeChef MITSOE Chapter
  2. Who are you, bro? Competitive Programmer Backend Developer Undergraduate Researcher

    Community Builder • 5-stars CodeChef • Expert CodeForces • IEEEXtreme 14.0 Country Rank 5 • IEEEXtreme 13.0 Country Rank 14 • Backend Developer at CuratePad • Personal and freelancing projects in Django • Working on a research problem related to “Mathematical modelling of LTE-LAA and WiFi Coexistence” since one year. • DSC Lead • CodeChef Chapter President • Secretary, Programming Club
  3. “Competitive programming is a mind sport usually held over the

    Internet or a local network, involving participants trying to program according to provided specifications.” Source - Wikipedia
  4. You’ll develop - • Strong implementation skills • Good grasp

    of data structures and algorithms. • Logical thinking and analytical reasoning skills Yashraj, पर मुझे इससे क्या मलेगा? Why should I care about competitive programming?
  5. There are world level competitions, and the rewards are huge.

    Money, fame, jobs - you name it. • ACM ICPC • Google CodeJam • Google Kickstart • IEEE Xtreme
  6. Mandatory Things you need to know • Understanding of one

    programming language (ideally, C++ or Java) • Basic math knowledge • Understanding of asymptotic notation Good to have • Understanding of data structures and algorithms. • Knowledge of discrete mathematics.
  7. How do I get started? If you’re an absolute beginner

    - • Solve a few problems from HackerRank. • A2OJ Ladder 1. If you have solved a few problems - • Give contests, and lots of them. ◦ Short vs long contests • Upsolve the next problem. • Learn concepts as they appear in practice and contests.
  8. Where should I go for contests? CodeChef • Long challenge

    • Short contests (Lunchtime and Cookoff) • Other contests CodeForces • Short contests Other platforms • AtCoder (ABCs are beginner friendly) • TopCoder • HackerRank • HackerEarth • LeetCode
  9. My recommended learning resources • CodeChef DSA Learning Series •

    A2OJ Ladders • CSES • CodeForces EDU • CP-Algorithms
  10. My recommended list of topics • Arrays and Strings •

    Sorting • Binary Search • Two pointer technique • Prefix-Suffix sum • Sliding window technique • Greedy • Constructive algorithms • Bit manipulation • Mathematics ◦ Number Theory ◦ Prime numbers • Recursion ◦ Little bit of dynamic programming • Graph algorithms ◦ Graph coloring ◦ DFS/BFS ◦ Shortest paths
  11. I struggle with DSA, what should I do? Do not

    worry, you are not alone DSA MOOC Courses - • MIT OCW Introduction to Algorithms, 2011 • Stanford Coursera Course • Princeton Coursera Course (Has two parts) Placement/CP oriented stuff • Resources discussed before • GeeksForGeeks • Coding Blocks • Coding Ninjas
  12. Find the right problems to solve Here’s a beautiful analogy

    (Source) For each problem, in order to solve it, you must jump over a gap. Some problems are very easy While some are too hard Gradually solve harder problems, but not too hard!
  13. How to approach a problem? • Read the problem statement

    very carefully. • Understand the sample test cases well. • Think of corner cases. • Think through before writing code. (Will help you write neat and crisp code) • Look at the time and memory constraints. • Brute force technique. • Use pen-paper.
  14. How to do well in contests? • Look at the

    number of people who solved a problem. • Do not look at the ranklist. • Accuracy >> Speed. • Use a good IDE. Before the contest - • Relax yourself with deep breaths. • Keep a water bottle, notebook and pen nearby.
  15. What to do after a contest? Or, after solving some

    problems in general • Look at the editorial. • Upsolve. • Look at solutions of great programmers. • Discuss with friends. • Learn missing concepts.
  16. How to increase speed? • Think through before you code.

    • Use a notebook to increase clarity. • Practice
  17. A simple hack to increase your progress rate. Find a

    motivated friends circle. My friends are the reason why I didn’t stop competitive programming.
  18. Other tips on growing fast • Solving the right problems.

    • Time bounding. • Giving sufficient time to a problem (neither too less nor too much) • Introspection.
  19. That’s all from my side! I hope you’re ready to

    start your competitive programming journey. Connect with me on LinkedIn if you’d like to keep touch or ask me anything,