I was solving this [problem](https://mirror.codeforces.com/contest/1498/problem/C) on cf . My c++ [code](https://mirror.codeforces.com/contest/1498/submission/115396133) got accepted but it is giving segmentation fault in my local computer. Why is it so?↵
I also tried other online compilers like [ideone](https://ideone.com/Bh0vGe) , and it was working there too.↵
↵
Same case with java. My java [code](https://mirror.codeforces.com/contest/1498/submission/115402326) got AC in cf but gives stackoverflow error in my computer.↵
↵
↵
My operating system is Ubuntu 20.04↵
I also tried other online compilers like [ideone](https://ideone.com/Bh0vGe) , and it was working there too.↵
↵
Same case with java. My java [code](https://mirror.codeforces.com/contest/1498/submission/115402326) got AC in cf but gives stackoverflow error in my computer.↵
↵
↵
My operating system is Ubuntu 20.04↵