# Category Archives: Competitive Programming

## Digit DP | IntroductionApril 21, 2017

Prerequisite : How to solve a Dynamic Programming Problem ? There are many types of problems that ask to count the number of integers ‘x‘… Read More »

## Project Euler

What is Project Euler? Project Euler is a series of challenging problems that require mathematical and programming skills. Somebody who enjoys learning new area of… Read More »

## Palindromic Tree | Introduction & ImplementationMarch 26, 2017

We encounter various problems like Maximum length palindrome in a string, number of palindromic substrings and many more interesting problems on palindromic substrings . Mostly… Read More »

## Python Input Methods for Competitive ProgrammingMarch 1, 2017

Python is an amazingly user friendly language with the only flaw of being slow. In comparison to C, C++ and Java, it is quite slower.… Read More »

## Input/Output from external file in C/C++, Java and Python for Competitive ProgrammingFebruary 26, 2017

In Competitive Programming, most of the time we need to enter input for checking our code manually. But it would become cumbersome if we have… Read More »

## Writing C/C++ code efficiently in Competitive programmingFebruary 7, 2017

First of all you need to know about Template, Macros and Vectors before moving on the next phase! Templates are the foundation of generic programming,… Read More »

## Sqrt (or Square Root) Decomposition | Set 2 (LCA of Tree in O(sqrt(height)) time)

Prerequisite : Introduction and DFS The task is to find LCA of two given nodes in a tree (not necessarily a Binary Tree). In previous… Read More »

## What to do at the time of Wrong Answer (WA)?February 3, 2017

There is been always a case that a wrong answer gives too much pain rather than TLE (Time Limit Exceed), as in former you couldn’t… Read More »

## Sqrt (or Square Root) Decomposition Technique | Set 1 (Introduction)January 30, 2017

Sqrt (or Square Root) Decomposition Technique is one of the most common query optimization technique used by competitive programmers. This technique helps us to reduce… Read More »

## Graph implementation using STL for competitive programming | Set 2 (Weighted graph)January 20, 2017

In Set 1, unweighted graph is discussed. In this post, weighted graph representation using STL is discussed. The implementation is for adjacency list representation of… Read More »

## How to overcome Time Limit Exceed(TLE)?

Many programmers always argue that the problems in Competitive Programming always end up with TLE(Time Limit Exceed). The Main problem of this error is that… Read More »

## Graph implementation using STL for competitive programming | Set 1 (DFS of Unweighted and Undirected)January 19, 2017

We have introduced Graph basics in Graph and its representations. In this post, a different STL based representation is used that can be helpful to… Read More »

## LCA for general or n-ary trees (Sparse Matrix DP approach < O(nlogn), O(logn)>)

In previous posts, we have discussed how to calculate the Lowest Common Ancestor (LCA) for a binary tree and a binary search tree (this, this… Read More »

## Formatted output in JavaOctober 16, 2016

Sometimes in Competitive programming, it is essential to print the output in a given specified format. Most users are familiar with printf function in C.… Read More »

## How to prepare for ACM – ICPC?October 4, 2016

ACM ICPC(Association for Computing Machinery – International Collegiate Programming Contest) is a world-wide annual multi-tiered programming contest being organized for over thirteen years. The contest… Read More »