I was recently trying to solve problem [K. Kingdom of Ants](https://vietnam-national19.kattis.com/problems/kingdomofants) on Kattis. However, my submission strangely receives a Memory Limit Exceeded verdict, and I can see no way of achieving that with my code.↵
↵
Code: [https://pastebin.com/0sXQaCdi](https://pastebin.com/0sXQaCdi)↵
↵
Do you guys spot any reasons why the above code would give MLE? Maybe some weird C++ undefined behaviour, or maybe some compiler flaw?↵
↵
_UPDATE: After checking for the (very degenerate) case if there is only one y-coordinate (right between lines 119 and 120), the solution gets Accepted verdict. However, I still don't understand why the initial verdict was MLE, and it was very misleading._
↵
Code: [https://pastebin.com/0sXQaCdi](https://pastebin.com/0sXQaCdi)↵
↵
Do you guys spot any reasons why the above code would give MLE? Maybe some weird C++ undefined behaviour, or maybe some compiler flaw?↵
↵
_UPDATE: After checking for the (very degenerate) case if there is only one y-coordinate (right between lines 119 and 120), the solution gets Accepted verdict. However, I still don't understand why the initial verdict was MLE, and it was very misleading._