I was solving this problem when I implemented it using vectors (this solution) I got MLE(Memory Limit Exceeded) and when I declared a global array in this solution I got AC. I even tried to declare vectors globally but still MLE. Does anyone know what is problem with using vectors here