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
- Min and Max
- Discussions
Min and Max
Min and Max
Sort by
recency
|
332 Discussions
|
Please Login in order to post a comment
import numpy n, m = map(int, input().split()) my_array = [] for _ in range(n): my_array.append(list(map(int, input().split()))) print(max(numpy.min(my_array, axis = 1)))
Understandable code from my side..
import numpy as np N,M = map(int,input().split()) print(np.max(np.min(np.array([list(map(int,input().split())) for _ in range(N)]),axis=1)))
import numpy as np
def sample_input_func(x): return list(map(int, x.split()))
def main():
N, M = sample_input_func(input()) initial_array = np.array([sample_input_func(input()) for _ in range(N)]) min_array = np.min(initial_array, axis = 1) max_array = np.max(min_array, axis = 0) print(max_array)
main()
import numpy as np
x, y = map(int, input().split())
data = [list(map(int, input().split())) for _ in range(x)]
data = np.array(data)
result = np.min(data, axis = 1)
print(np.max(result))