Posts

Showing posts from May, 2017

Should I quit competitive programming? I am not good at it, but I like it very much?

Think about the reasons you are doing it and make a decision correspondingly. You are doing it because of some benefits you are going to get once you’ll reach decent level? Think if it is worth it - maybe you don’t have other way, or maybe you can get these benefits by doing something else and investing smaller amount of time. Or maybe you simply don’t need them. Look how much you improved over time and scale it to get some approximation on time it will take you to reach the level you want/need. You are going to improve over time. Maybe you aren’t going to improve fast. Even if you can improve quickly - it will require investing great amount of time and effort. What do you need from competitive programming? Why are you doing it? You like it very much, right? This reason sounds good enough - but you have to consider everything carefully and weight it. Just imagine that you are doing some other fun (but possibly useless) activity instead; imagine saying “Should I quit playing compute

Which books should i use for competitive programming?

Image
One must have IMO is  Introduction to algorithms . It's huge to be honest, and gives both depth and breadth of a extensive coverage of different data structures and algorithms techniques. You may not need to study it from page to page, but use it as a reference resource. When you need to understand some topic, read that part in it, and this will give you a very solid foundation on algorithm analysis and design. Another book focus on math topic is Knuth's  Concrete Mathematics,   I believe any ambitious competitive programmer who want to do well on math problems should read this book. If you find this book a little difficult to follow, you may also try the following book which is much easy to understand.   A Friendly introduction to number theory  will teach your most of the knowledge about number theory you need in competitive programming and is extremely easy to follow. Algorithm Design by JON KLEINBERG is a book on some advanced topics on algorithm, which is ver

level-wise breakup of competitive programming

I spent continuous 2 months of fully-dedicated work on algorithms, those were my best days, I can give advice on what felt from that time: First you need to do some good programming in string manipulation, etc., some really shortcut coding is a must, for example using C++ STL, you need to write 1 line that will give you an understanding of about 5-10 lines. This way, you ideas will flow easily, that is, you write one/two line, what you want to do is already accomplished, so understanding of the whole library you are using is mandatory like C++ STL, etc. Searching, linear & binary search are basic. Linear is too inefficient for many tasks, you will binary search in different forms in many other topics, but it is not easy to look & understand on how to apply a binary search at first, if you modify the problem slightly, you will know a binary search operation is possible. Sorting, most times, quick sort will work, rarely others are required, I used Hoare variation implem