Hello codeforces, I need help, I have this 258568779 for 21D - Traveling Graph, which as you can see it causes MLE with 65 use of memory, I changed every long long to int, reduced MXN to 16, and minimized the use of arrays, but still it causes MLE, can someone help please?
Thanks
you're getting mle because of heap overflow in your dfs, check your base condition. your cmask can be negative and it will keep on decreasing and recursion will never end causing heap overflow.