I was trying to solve 1117D - Magic Gems using Matrix Exponentiation. I'm trying to use an implementation (It was moriss821028's if I recall correctly) 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
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
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