When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

RishabhKejariwal's blog

By RishabhKejariwal, history, 5 years ago, In English

https://www.spoj.com/problems/WORMS/

Can someone please help me with the approach to the above problem.

**Code link:https://ideone.com/qXjfzI**

It's not passing the memory limits of the questions. (Solve the problem by at most 0.5kB of source code)