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

aryan57's blog

By aryan57, history, 3 years ago, In English

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

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by aryan57 (previous revision, new revision, compare).

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Maybe the stack size is bigger in codeforces?
check this post for details about compilation flags of cf.

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

even the editorial code gives stackoverflow in local computer https://codeforces.com/blog/entry/89137

»
3 years ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

Local compiler? Is it exactly segfault (not smth exception or another signal)?
Input on which fails?

»
3 years ago, # |
  Vote: I like it +3 Vote: I do not like it