aryan57's blog

By aryan57, history, 4 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

»
4 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).

»
4 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.

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

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

»
4 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?

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