It's a popular competitive programming book in Japan and China.
To pass the coding interviews from big tech companies like FAANGMULA, I need to practice LeetCode-like problems. But tbh, I didn't learn much from the LeetCode after a certain stage (my leetcode contest rating is 2435, which is at the top 0.33% on 2022-03-26). Out of the consideration of interests and marginal benefit, I think it's a good idea to learn and practice entry level cp problems. To have an overall impression on cp about general problems and techniques, I chose to follow the ant book.
I use the list on vjudge to track my effort. However, there are some problems we can't find the OJ like バクテリアの増殖 from Google Code Jam Japan 2011 Final. Other problems on the list are in the scope of this repository.
Nearly all of the code are written by me. But some of them are from the internet, there could be 2 reasons.
-
Most of problems are from POJ (Peking University JudgeOnline). POJ is using very old compilers and machines. It doesn't support the common optimization of STL and might require a tighter constant on implementation. I don't want to waste my time to do constant optimization to please the compilers and machines, especially on C++98. Instead I just use others' solutions with the source and put my code (good enough in time complexity) under it.
-
Some problems need long implementations, I don't like that so skipped them for now. I will implement them in the future (gugugu).
Because there are 2 ants on the cover and the first problem of the book is Ants (POJ 1852).
Because the cover is in white, people that love OI/ICPC have the convention to call famous cp textbooks with the color of the cover.
It's definitely a great book. Problems are great, code in the book is clear and good to learn. But there are some concerns.
-
This book is more like an exercise book over textbook. It's good for OI/ACM-ICPC because we don't need to prove our solutions during the contest. However, it's not good for students as the only reference of data structures and algorithms. Students should learn basics from standard textbooks like CLRS or Algorithms by Robert Sedgewick and Kevin Wayne or Algorithm Design (my favorite one) by Kleinberg and Tardos.
-
Problems are old and most of them are from POJ. The C++ compilers supported by POJ is out of date and machines are slow. It's okay to practice because these problems are in good qualities but we have much more user friendly OJ to choose for now. Why not solve some problems on them?
- Codeforces
- AtCoder
- Luogu (Chinese)
-
If you like the architecture of the book, here are some articles from drken with "modern" problems from AtCoder related to the same patterns as those in the ant books.
-
Some other great cp books, some books are not listed here just because I don't know them:
Please feel free to contact me if you have any feedbacks.
Email: InYuo1997 at gmail.com