Category Archives: Competitive Programming

Test Case Generation | Set 1 (Random Numbers, Arrays and Matrices)

The test cases are extremely important part of any “Software/Project Testing Process”. Hence this Set will be very important for all the aspiring software developers. The following are C++ program to generate test cases. Generating Random Numbers Generating Random Arrays Generating Random Matrix Library Functions Used rand() Function– -> Generate random numbers from the range… Read More »

C++ Magicians – STL Algorithms

For all those who aspire to excel in competitive programming, only having a knowledge about containers of STL is of less use till one is not aware what all STL has to offer. STL has an ocean of algorithms, some of the most used algorithms on vectors and most useful one’s in Competitive Programming are… Read More »

Cin-Cout vs Scanf-Printf

Regular competitive programmers face common challenge when input is large and the task of reading such an input from stdin might prove to be a bottleneck. Such problem is accompanied with “Warning: large I/O data”. Let us create a dummy input file containing a line with 16 bytes followed by a newline and having 1000000… Read More »

Fast I/O in Java in Competitive Programming

Using Java in competitive programming is not something many people would suggest just because of its slow input and output, and well indeed it is slow. In this article, we have discussed some ways to get around the difficulty and change the verdict from TLE to (in most cases) AC. For all the Programs below… Read More »

Some important shortcuts in Competitive Programming

The most common tools to save time in C/C++ are typedefs and macros. Unfortunately, these features are not available in many other languages like Java. Here are some examples of our C/C++ code Shortcuts: // Shortcuts for “common” data types in contests typedef long long ll; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<int>… Read More »

A Better Way To Approach Competitive Programming

This article helps to all those who want to begin with Competitive Programming. The only prerequisite one need is the knowledge of a programming language. Now, Let us find a better approach to Competitive Programming. Please note: One should read the proper Input and Output format because most of the beginners make mistakes of having… Read More »