FAQ of Competitive Programming

We're a team of software engineers who want to democratize access make learning algorithms and systems easy. Plain and simple.

There are many similarities between the different languages ​​of programming. Which is why learning one language doesn't take much time to learn the other. But of course there are some special languages ​​that are very different from our mainstream programming languages. If you don't find it very difficult, then you should learn C / C ++. It is the most widely used for competitive programming and most judges code in this language. Although other languages ​​such as Java or Python are also used in various programming contests, C / C ++ is universally used in almost all mainstream programming contests. So if you haven't taken the time to learn any other language in the meantime, then learning C / C ++ would be wise.

Competitive programming is very possible with C / Java / Python etc. languages. However, there are some reasons behind C ++ being the most popular language in the contest. C ++ is actually the only language that is at the same time much faster (almost like C) and has a rich library like STL (like Java / Python). In fact, in both cases there is a moderate condition due to which the contestants can improve rapidly. Since the syntax of C ++ has a lot in common with C or Java, it doesn't take much time to learn. Although there are few similarities with Python, the slowness of Python is actually quite inconvenient for contests at times. But I want to emphasize learning C ++ for a reason. More than 95 percent of the resources available for online competitive programming are actually written with C ++ in mind. So my idea is that C ++ coders are a little more privileged in these cases.

In the first step, learning variables, if-elsif, loops, arrays and strings is enough. Knowing these and using them well, it is possible to solve almost all the problems of the contest. In the second step, you need to learn the function, structure and STL (Standard Template Library) to write a program. In the third step, some data structures may need to learn pointers and dynamic memory allocation. Many of the higher concepts of programming are actually not used in competitive programming. Such as: object oriented programming, functional programming etc. Since most of the contest programs are actually relatively small, it is less useful to use these techniques. That's why even if you don't know C ++ class or object oriented subjects. It will suffice to know C ++'s C subset and STL.

You can learn Bengali English from any book. Or you can learn by searching online. However, after learning a little, you have to give importance to solving the problem on your own. Otherwise, there will be no benefit if you just fall. In Bengali, Tamim Shahriar is quite useful for starting Subin's book. The eshikkha.net also has a chance to solve the problem in Bengal, as well as tutorials. Many people like Herbert Schildt's book in English books.

The best way to start a contest is to start using an online jazz. Here are some of the online programming contests:
  • codeforces.com
  • atcoder.com
  • codechef.com
However, in the beginning, it is very natural to feel difficult to contest in these jazz. So those who are just starting out, they can start with one of the following "easy" online jazz:
  • eshikkha.net
  • urionlinejudge.com.br
  • dimikoj.com
  • algo.codemarshal.org/problems
There are also a number of online jazz outlets that have a lot of practice problems. If you want to do well in ICPC or equivalent competitions, it is very important to practice regularly in these jazz. These jazz are:
  • lightoj.com
  • onlinejudge.org
  • spoj.com
  • acm.timus.ru
As soon as you have a little idea of ​​programming, you need to start solving problems from an online jazz. In that case you can start with the "easy" online jazz. As skills and confidence gradually increase, you can start solving problems and contesting from other online jazz. In order to master the programming language well, it is very important to solve various jazz problems. So it is better to start as soon as possible without delay.

There are several steps you can take to begin the process of preparation for mediation. The problem with most of us is that we are usually not very used to reading English. This problem is especially evident in those who come from Bangla medium school / college, or are still studying. There is actually no substitute for reading a lot of English problems in case of this problem. Therefore, if you can practice reading some problems every day without making too many choices in the beginning, it will be very useful. In this case, you can make sure that you understand exactly what you are talking to a friend or senior. However, if your English is very weak, then you can benefit from watching English books, movies. Keep in mind that without learning English, you will not be able to solve the problem by bypassing it. So even if it is difficult in the beginning, you have to do these things with a little patience. To understand if you understand the problem correctly, you can verify how the output from the sample inputs of the problem is real by writing it down in a notebook pen. But even after that, if you want to be sure, you have to talk to someone. Close friends or seniors can help in this case. If there is no such person, you can ask in the group related to various programming contests on Facebook. However, when asked in such a place, "I did not understand anything, explain the whole" such questions are less likely to get help. Rather, you will get the answer only if you can point out exactly the place where you are struggling.

After learning programming, many people stop at the beginning to code any logic. It actually takes a while for one person to change this situation. If you think you still have this problem, you can get someone to help you figure out how to code. But in that case, it is better to take a hint without looking at the code directly. It is best if someone can help you figure out where the code is wrong and how to make it better. It is also important to code many similar problems to overcome the problem.

Debugging is a very important skill. However, many experienced programmers are weak in debugging because they do not practice much. Here are some tips to help you understand where the code is wrong:
  • Can be seen with different inputs. In this case it is usually seen with the smallest or largest values ​​of the input range. However, it can be tried with different cases.
  • Overflow is quite a problem in the beginning. So with any such input you can try to see if there is any overflow in your code.
  • Read your code from top to bottom, not from bottom to top. Many times spelling mistakes come out in this way.
  • In order to find out the logical error, it is very useful to explain something out loud to someone. In this way, many times the mistake comes out. If you don't have any people then, even if you assume that there is someone, it also helps a lot. This is called rubber post debugging.
Helping other programmers in different forums or groups is very useful to increase the efficiency of debugging. Because it increases the ability of others to read the code and find out their mistakes. However, in this case you can say which line of code is wrong and if you can say that this code will give wrong output for any input, then both you and the program will benefit more.

It is actually harmful to look at someone else's code before solving a problem. Reading editorials without trying hard enough actually does some harm. I personally believe that hard work to solve a problem on your own actually helps you learn best. However, if a problem cannot be solved after trying many ways, then the editorial can be read. But you should never try to solve that problem by looking at someone else's code. Absolutely helpless can be seen as a last resort. However, if you read the editorial or see / hear any other hint that you do not know the algorithm required for this problem, then you should first try to understand the algorithm better. If necessary, we have to solve the simpler problem that can be solved with that algorithm first and then try to solve this problem again. But after solving a problem, you should see how other (especially experienced and skilled) contestants have solved it. In this way it is possible to learn many new things. And the techniques learned in this way are usually remembered for a long time. It's not a bad thing to be temporarily left out if you can't solve many problems in the beginning. After six months or a year, the problem can be tried again. In that case, if you succeed, you will have confidence in your own progress, which is very beneficial.

Number theory, gridi, sorting, searching, these algorithms are good for learning at the very beginning. These do not require much coding. Again, it is quite easy to understand logically. There are a lot of problems that can be done with these. Graph, DP, data structure, basic level algorithms can be learned with a little help in coding.

There is no need to practice a certain number of hours a day. However, every day should be given at least a little time. Even if it is an hour. You will benefit more if you can make it a habit to solve the problem. When you are too busy with other things, you will have the opportunity to think about a problem. Then there will be no big cuts in your practice. So it is important to practice every day with a routine. It is also very helpful to talk regularly with other programmers to get better. You can learn new things by talking to someone who is doing better than you. You will also learn to help those from whom you are in a better position. When you try to convince someone, you actually understand what you can do, which is very useful. However, in order to do well in a team contest like ICPC, it is very important to practice more than five hours of team contest. This leads to better understanding with other members of the team. And endurance, like five hours of head-scratching, also develops.

Frustration is a very common thing among those who do programming contests. You have to understand that this is not easy. And because success is not easy, we feel better about ourselves. However, it should be kept in mind that almost everyone who has succeeded in the contest has had to work hard for a long time. It is natural that success will be difficult if you do not have the time or effort. Remember, there are very few instances of success in ICPC without regular hard work for almost two to three years. Many of those who do well in their first year at university have already completed programming or other Olympiad experience. So don't increase your frustration by comparing Khamaka with others. If you want to compare, you will always compare yourself. Compare your present with four to six months ago. If you keep working, you will always see that you know more now than you could before. If you look at this comparison and see that you are in the same place, then you need to change the type of practice or work harder. If you keep one thing in mind, you may not be disappointed anymore. The main goal of the programming contest is to get success in the contest or not to get a good job. Its main goal is to help you learn in a very effective way. You will learn a lot if you don't get much success but practice for the contest for three or four years. This education and skills can no longer be easily acquired. In the context of Bangladesh, I do not know of a better way to master the basics of computer science and to acquire problem-solving skills.
Q&A PIC Q&A PIC