--
- What is competitive programming (CP)?
- Why do CP?
- How and where to practice?
- Comparison of programming languages
- Programming language specific tips
- Programming environment - tools and runtime errors
- Fast IO
- Time complexity
- Containers/Collections
- Modular arithmetic
--
- Choose a language
- Read tutorials
- Practice (usually by competitive programming).
--
- Programming according to input/output specification.
- Example: https://www.codechef.com/problems/FCTRL
--
- It's fun. It's definitely fun for those who like programming and math.
- You don't have to memorize much and it's very objective.
- It's easy to start. CP is very practical. (compare to OS)
- It's the most asked thing in CS placements.
- It will make you a good and fast programmer.
- It's a good way to learn a language.
- It will improve your problem solving skill.
--
Popular online judges:
- Codechef
- Codeforces
- Hackerrank
- Hackerearth
- SPOJ
- Topcoder
--
- Try to solve problems which are challenging but not too difficult. Start with easy problems (usually the ones with most submissions) initially.
- If you can't solve a problem, read the problem's editorial.
- Occasionally look at others' code.
- Discuss problems with your peers.
- Keep learning about a programming language if you haven't already.
--
-
Start participating in contests:
- Codechef long challenge
- Codeforces rounds
- Codechef cookoff
- Other contests on other OJs
-
Contests provide a competitive, time-constrained environment.
--
- Once you solve around 30-40 problems, you should learn about new algorithms and data structures.
- DiSCo - MIT Math for CS.
- Do problems on Math, DP when starting out.
- I used NPTEL for DSA (youtube videos).
- Above resources aren't enough, but they cover a good amount. You must keep learning from other resources.
- LightOJ is a good resource to practice problems from a specific topic.
--
- C
- C++
- Java
- Python
--
- Integer overflow
- Storage classes in C, C++
- Runtime errors (SIGSEGV, SIGFPE, SIGABRT) in C/C++. Exceptions in Java and Python.
- Return code
- GCC Flags
- GNU Debugger
--
- Linux vs Windows vs Mac.
- Text editor and command-line, benefits like redirection.
- IDE
- Checking execution time
--
scanf
andprintf
are faster thancin
andcout
in C++.BufferedReader
is faster thanScanner
in Java.sys.stdin.readline()
is a bit faster thaninput()
in Python.
--
- It's a way to measure efficiency of code.
- Example: Linear Search
- Example: selection sort
- Example: Binary Search
- Example: Merge sort
- Example: Finding number of distinct elements in a list
- Finding expected time complexity from constraints.
--
- vector, linked-list, set, map, algorithms, iterators
- http://en.cppreference.com/w/
- https://docs.oracle.com/javase/8/docs/api/overview-summary.html
- https://docs.python.org/3/
--
- What is it?
- Addition, Subtraction, Multiplication
- Exponentiation
--
Find the last digit of 3400.
MIT math for cs link not working due to an linefeed character in the link. Please update.