The below mentioned code is giving random answer on submission on codeforces, but on my local maschine it is giving correct answer. I am using the following g++ version gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) and compiling using the command g++ -g -std=c++0x d.cpp code