Sol link :- CodeChef: Practical coding for everyone
SIGSEGV is either an attempt to access an out of bounds memory location or exceeding the memory usage limit. In your code, you declared a 2 dimensional array of dimensions N times N (With N’s upper limit being 2 x 10^6), which (if my calculation isn’t wrong) would require 16,000 GB of memory. Thus you have to think of a better approach memory wise to solve this problem
2 Likes