Getting Segmentation Fault on my Machine, AC on Codeforces

Revision en3, by Bekh, 2019-08-03 11:16:58

Hello,

I was trying to solve 1117D - Magic Gems using Matrix Exponentiation. I'm trying to use -Morass- implementation for Matrix Power since it's much faster than mine. I'm using 2 transformation matrices and multiply them to get the final transformation matrix named transform and then raise it to the power of n.

This submission: 58207232 gets AC, while on my machine it gives segmentation fault on line: 108, the line where I raise the transform matrix to the power of n. Following it with the debugger, it doesn't enter the operator ^ function at all, it stops on the definition line and halts.

Reducing the dimensions of the array v to 180 x 180 seems to fix the issue locally but the code doesn't seem to take that much memory. Idk if this is related to a memory leak or what.

My IDE is CLion, the compiler is MinGW version 5.0, my CMake version is 3.13.2, and I'm using C++ 14.
It prints exit message Process finished with exit code -1073741571 (0xC00000FD).
If there is any more information you need, please ask. I'm a kind of a newbie when it comes to these stuff.

Any help would be appreciated

Tags segfault, memory usage

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English Bekh 2019-08-03 11:42:19 72
en3 English Bekh 2019-08-03 11:16:58 24 Tiny change: 'ng to use Morris's implement' -> 'ng to use [user:-Morass-] implement'
en2 English Bekh 2019-08-03 10:58:36 27
en1 English Bekh 2019-08-03 10:57:18 1203 Initial revision (published)