Welcome to my repository of competitive programming solutions! Here you'll find my solutions to problems from various online judges like Codeforces, CodeChef, URI, LeetCode, and more.
- Codeforces: Solutions to Codeforces problems.
- CodeChef: Solutions to CodeChef problems.
- beecrowd: Solutions to URI problems.
- LeetCode: Solutions to LeetCode problems.
- Others: Solutions to problems from other platforms or contests.
Each platform directory contains subdirectories for specific problems or contest rounds, organized to make it easy to navigate and find solutions.
I created this repository to:
- Share my problem-solving journey and solutions with the community.
- Showcase my approach to solving various types of problems.
- Provide a resource for others learning or practicing competitive programming.
A list of recommended books for competitive programming.
☆ | Name | Description |
---|---|---|
★★☆ | Competitive Programming, by Steven and Felix Halim | This book contains a collection of relevant data structures, algorithms, and programming tips. It's a well-received book. ... The first edition is free for download (pdf). |
★★☆ | Programming Challenges: The Programming Contest Training Manual, by Steven Skiena and Miguel Revilla | This book includes more than 100 programming challenges, as well as the theory and key concepts necessary for approaching them. Problems are organized by topic, and supplemented by complete tutorial material. |
★★☆ | Competitive Programmer's Handbook, by Antti Laaksonen | An introduction to competitive programming for aspiring IOI and ICPC contestants. Free to download (pdf). |
★★☆ | Algorithmic Thinking: A Problem-Based Introduction, by Daniel Zingaro | A book that teaches data structures and algorithms using competitive programming problems (IOI, USACO, CCC/CCO, etc.). |
★★☆ | Computational Geometry: Algorithms and Applications, by Mark de Berg, Otfried Cheong, Marc van Kreveld, Mark Overmars | This is a well-written book which covers a broad range of computational geometry problems. |
★☆☆ | The Hitchhiker’s Guide to the Programming Contests, by Nite Nimajneb | This book is free for download (pdf). This book covers various topics relevant to competitive programming. |
☆ | Name | Description |
---|---|---|
★★★ | Introduction to Algorithms, by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and Clifford Stein | Also known as CLRS (taken from name initials), this book is often referred to as the "bible" for algorithms and data structures. It's one of the most popular textbooks for university algorithm courses. This book covered various algorithms and data structures in great detail. The writing is more rigorous and can be difficult to some. |
★★☆ | Algorithm Design, by Jon Kleinberg and Éva Tardos | This book revolves around techniques for designing algorithms. It's well-organized and written in a clear, understandable language. Each chapter is backed with practical examples and helpful exercises. The chapter on network flow is highly praised by lots. ... The lecture slides that accompany the textbook are available on its official website. |
★★☆ | The Algorithm Design Manual, by Steven S. Skiena | The book is written in more readable text. Some find it comprehensive than other books. You can also find some good resources (including the author's own video lectures) on its official website. |
★★★ | Algorithms, by Robert Sedgewick and Kevin Wayne | This book is neatly categorized, coupled with elaborate explanations and fantastic illustrations. It is used in some IOI training camps as a textbook. |
Algorithms and Data Structures in Action, by Marcello La Rocca | This book provides a different approach to algorithms, balancing theory with a more practical angle, with a section per-chapter focusing on how to apply algorithms to real-world use cases that can be found in your daily work, or in competitive programming; it also presents a blend of classic, advanced, and new algorithms. | |
★★★ | Algorithms, by Jeff Erickson | A free electronic version of a self-published textbook licensed under CC by 4.0. This is a well written book from lecture notes of theoretical computer science courses at the University of Illinois. Covers the main paradigms of backtracking, dynamic programming, greedy, and particularly graphs in depth. |
☆ | Name | Description |
---|---|---|
★★☆ | Discrete Mathematics and Its Applications, by Kenneth H. Rosen | Discrete Mathematics is closely relevant to competitive programming. This book provides comprehensive materials on a wide range of topics including: Logics and Proofs, Sets, Functions, Sequences, Matrices, Number Theory, Recursion, Counting, Probability, Graphs, Trees and Boolean Alegra to name but a few. |
★★☆ | Concrete Mathematics: A Foundation for Computer Science, by Ronald L. Graham, Donald E. Knuth, Oren Patashnik | The book offers a deeper insight into Discrete Mathematics with more emphases on number-related topics. |
★★☆ | Linear Algebra and Its Applications, by David C. Lay, Steven R. Lay, Judi J. McDonald | The book does a brilliant job at bridging the gap between a physical system (for scientists and engineers) and an abstract system (for mathematicians). |
★★☆ | Introduction to Probability, by Charles M. Grinstead, J. Laurie Snell | This is a well-written introductory probabilities book. ... It's free for download (pdf) (released under GNU Free Documentation License). |
★★☆ | How to Solve It: A New Aspect of Mathematical Method, by G. Polya | An old-time classic. In this book, the author provides a systematic way to solve problems creatively. |
★★☆ | Intermediate Counting & Probability, by David Patrick | Topics in counting and probability byformer USA Mathematical Olympiad winner David Patrick , topics include inclusion-exclusion, 1-1 correspondences, the Pigeonhole Principle, constructive expectation, Fibonacci and Catalan numbers, recursion, conditional probability, generating functions, graph theory, and much more.. |
Good online judge systems / contest platforms to practice.
☆ | Name | Description |
---|---|---|
★★★ | Codeforces | Codeforces is one of, if not, the most popular contest platforms out there. Currently maintained by Saratov State University, it features regular contests and countless awesome original problems. Additionally, every contest provides immediate helpful tutorials (usually) written by the authors themselves. Codeforces also houses a strong and engaging community. All in all, one would indeed learn and improve tremendously here. |
★★★ | Topcoder | Topcoder has been around since 2001. Rich in history, It's considered to be one of the most prestigious organizations when it comes to technology competitions. Hundreds of SRMs gave birth to an abundant problemset. Problems here are typically more challenging than others and Topcoder therefore appeals to many elite programmers. The annual Topcoder Open (TCO) is also a widely-discussed event. |
★★★ | Google Code Jam | Google Code Jam is certainly one of the most highly-esteemed programming competitions. The competition consists of unique programming challenges which must be solved in a fixed amount of time. Competitors may use any programming language and development environment to obtain their solutions. |
★★★ | AtCoder | AtCoder is a new but phenomenal contest platform created by a team of highly-rated Japanese competitive programmers. |
★★☆ | CodeChef | CodeChef is a non-profit educational initiative of Directi. It's a global competitive programming platform and has a large community of programmers that helps students and professionals test and improve their coding skills. Its objective is to provide a platform for practice, competition and improvement for both students and professional software developers. Apart from this, it aims to reach out to students while they are young and inculcate a culture of programming in India. |
★★★ | SPOJ | The SPOJ platform is centered around an online judge system. It holds a staggering amount of problems prepared by its community of problem setters or taken from previous programming contests, some of which are great problems for practice (refer to the Problem classifiers section). SPOJ also allows advanced users to organize contests under their own rules. |
★★☆ | Timus | Timus Online Judge is the largest Russian archive of programming problems with automatic judging system. Problems are mostly collected from contests held at the Ural Federal University, Ural Championships, Ural ACM ICPC Subregional Contests, and Petrozavodsk Training Camps. |
★☆☆ | HDU | HDU is an online judge maintained by Hangzhou Dianzi University. It's home to many classic problems from the Chinese IOI scene. |
★★☆ | Aizu Online Judge | Aizu online judge is a contest platform and problem archive hosted by The University of Aizu. It has a lot of great problems from programming competitions in Japan. |
★★☆ | UVa | An old-school problem archive / online judge with rich history. Thousands of problems, including many classic ones, are featured here. However, it is strongly advised that you practice with uHunt following its "Competitive Programming Exercise" section. |
★★☆ | HackerRank | HackerRank is a company that focuses on competitive programming challenges for both consumers and businesses. HackerRank's programming challenges can be solved in a variety of programming languages and span multiple computer science domains. |
★★☆ | POJ | POJ is an online judge with many great problems maintained by Peking University. Most Chinese competitive programmers began their journey here. The platform is really dated so mysterious compilation and run-time issues may occur. |
★★☆ | Project Euler | Project Euler features a stunning set of good math problems. It also hosts a forum where people can discuss. |
★☆☆ | Hackerearth | HackerEarth is a startup technology company based in Bangalore, India that provides recruitment solutions. |
★☆☆ | Caribbean Online Judge | COJ is hosted by University of Informatics Sciences (UCI, by its acronym in Spanish), located in Cuba. Feature ACM ICPC and Progressive contest styles, mostly from Caribbean and Latin American problem setters, also has problem classifier and contest calendar. |
★★☆ | CS Academy | New in the competitive programming scene, CS Academy is a growing online judge that hosts competitions once every two weeks. It supports live chat, interactive lessons and an integrated online editor (that actually works). |
Feel free to contribute by:
- Adding solutions for new problems or platforms.
- Improving existing solutions with better algorithms or optimizations.
- Fixing bugs or errors in current solutions.
Please follow the contribution guidelines before making any changes.
This repository is licensed under the MIT License. Feel free to use the code however you like, but please attribute by linking back to this repository.
I am passionate about algorithms and data structures. You can find more about me and my work on.
Connect with me for any questions, collaborations, or feedback:
Explore, learn, and conquer the world of competitive programming with Codeforces! Happy coding! 🌟