+7

What is the best language for competitive programming

I have attended so many competitions regarding programming. I mostly used C++ or C or rarely python . But I need to know what is the best language

11/9/2019 1:13:29 PM

Sahan Dissanayaka

5 Answers

New Answer

+5

Assuming that by competitive coding, you refer to ICPC or time-bound coding contests, mastery of C++ with a basic knowledge of Java will get you through it. Most competitive programmers prefer C++ over C because of the in-built functions associated with it. In C++, you can simply use sort(a, a+n) to sort an array a[] of size n, or use lower_bound(a, a+n, num) to binary search a number instead of writing the entire code (imagine the benefits in a time bound contest). Moreover there are inbuilt data structures like vector (resizeable arrays), list, queue, stack, etc. in C++. Java, albeit slower, has a powerful BigInteger, String Processing, HashTable and GregorianCalendar API. Suppose you have to calculate the factorial of 25 (the answer has 26 digits), creating a C/C++ code from scratch will take time and effort, whereas a Java solution is this: BigInteger fac = new BigInteger.valueOf(1); for (int i = 2; i <= 25; i++) fac = fac.multiply(BigInteger.valueOf(i)); // wow :slight_smile: Bottomline: To actually excel in these contests, use better data structures and algorithms. No kidding. If you encounter a graph problem and you are not familiar with graphs, it doesn’t really matter which language you are using.

+5

All languages are best, but Python and Java are most demanding languages.

+3

their is no best languages keep it in mind!! but c/c++ is the fastest language comparing to other languages. .

+2

no language is best language depends on your priorities dynamicity-python static properties-c c++

0

Hello! Nice Question. You can start JavaScript first as it has similarity to all the other programming languages. Note that you should choose language for your future work. The languages with the topics are: Game Developing: C++, C# Desktop Application: C, C++ Android Application: Java, Python 3 Web Developing: JavaScript, HTML, CSS But you can start with JavaScript. It will help you to realize the other languages. Thank you. If it helps you then give an upvote and Subscribe my youtube channel: CREATION TUBE.