time limit exceeded

although my algorithm works well with small inputs, it takes much time for larger inputs. can anyone help me to solve this problem??.. i think i have a problem while taking input and output, from text files(i code in c++)

problem link and your solution plz

1 Like