GDSUB - Editorial

There’s an integer overflow on line 78:

mat[i-1][j-1]*mat[0][j]

but even after fixing that, it’s still not right :confused:

Edit:

The two occurrences of

ans+=(mat[i][k]%MOD)

can also be made to overflow.

Edit2:

Read this :slight_smile: Simple Trick to Detect Integer Overflow (C/C++)

2 Likes