Stack size in codeforces is 256 MB (and in problems with lower memory limit, you will sooner get MLE than runtime error from stack overflow). So that answers why you got Runtime Error.
As to why Codeforces does this, no idea, but it has been like this for a long time.
Stack size in codeforces is 256 MB (and in problems with lower memory limit, you will sooner get MLE than runtime error from stack overflow). So that answers why you got Runtime Error.
As to why Codeforces does this, no idea, but it has been like this for a long time.