Submit solution
Points:
15 (partial)
Time limit:
0.1s
Java
0.2s
Python
0.2s
Memory limit:
256M
Author:
Problem type
FatalEagle recently stumbled upon a manga that teaches linear algebra. A particularly interesting topic was matrix determinants. Your task is simple: given , an matrix, find its determinant! Since this number can be really big, we want to find its value .
Input Specification
The first line of input will have .
The next lines will have integers each. The integer of the line will contain .
For cases worth 30% of the total marks, .
For cases worth another 30% of the total marks, .
For all test cases, .
Output Specification
The output should be a single integer in the range , the determinant of the matrix .
Sample Input 1
2
-1 3
-5 7
Sample Output 1
8
Sample Input 2
6
1 3 5 2 4 6
2 5 4 3 1 6
6 1 2 3 4 5
2 5 1 3 6 4
4 5 1 2 3 6
5 4 3 6 1 2
Sample Output 2
2457
Comments
If you would like to test your determinant code but are getting TLE on this problem here is an alternative (on another judge) that has a 5 second TL if you want to see it run on some larger cases.
This comment is hidden due to too much negative feedback. Show it anyway.
Hey! Spamming the "view previous" button on the comment above (the one with many edits) will get you captcha'd so be warned!!!
Comment by harry7557558: original edit 2 edit 6 edit 12 edit 13+; Account kicked out for spam requesting and is currently inaccessible.
Python hard-coding AC submission; First proper Python AC solution; PyPy 2 AC'd with 0.2s TL;
Some facts related to the comment with many edits:
Edited Oct.13, 2020.
There are a large number of test cases with increasing size. This problem is to test the efficiency of your matrix determinant algorithm -- in other words, the constant matters in this question!
Wait Fatal so you mean e.g. for , if were to be or something, then the coefficient would matter?
Or sorry, I goofed. What do you mean by constant?