We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Numpy
- Linear Algebra
- Discussions
Linear Algebra
Linear Algebra
Sort by
recency
|
306 Discussions
|
Please Login in order to post a comment
Working with determinants can feel repetitive at first, but once you understand the structure it becomes clearer, almost like how the story shared in About Our Pilates Center explains balance and precision as the core of every practic
For Python3 Platform
import numpy as np
N = int(input()) M = np.array([input().split() for _ in range(N)],float)
A = np.linalg.det(M)
print(np.round(A,2))
import sys import numpy as np
As usual with HackerRank problems,
N
is unnecessary.However, this time I felt like using it as an example
of checking the input.
print([(N := int(input())),
np.linalg.det(np.loadtxt(sys.stdin.readlines(), float)[:N, :N]).round(2)][1])****