I was solving this problem on cf . My c++ code got accepted but it is giving segmentation fault in my local computer. Why is it so? I also tried other online compilers like ideone , and it was working there too.
Same case with java. My java code got AC in cf but gives stackoverflow error in my computer.
My operating system is Ubuntu 20.04
Auto comment: topic has been updated by aryan57 (previous revision, new revision, compare).
Maybe the stack size is bigger in codeforces?
check this post for details about compilation flags of cf.
even the editorial code gives stackoverflow in local computer https://mirror.codeforces.com/blog/entry/89137
Local compiler? Is it exactly segfault (not smth exception or another signal)?
Input on which fails?
https://mirror.codeforces.com/blog/entry/63140 This might help..
thank you very much!!