Can someone please tell me why is the memory limit exceeded in this solution.
99282970
Codeforces Round 1095 Solution Discussion