백준/2차원 배열

백준 - 2566 (python)

SooHw 2024. 2. 13. 16:14

 

 

최대값 최소값 구하는 방식 그대로 인덱스 까지 변수로 담아두면 되는 간단한 문제

 

arr = [list(map(int, input().split())) for i in range(9)]
max_val = -1
row_index = 0
col_index = 0
for i in range(9):
    for j in range(9):
        if max_val < arr[i][j]:
            max_val = arr[i][j]
            row_index = i+1	#출력 조건때문에 1씩 더해줌
            col_index = j+1
print(max_val)
print(row_index, col_index)

'백준 > 2차원 배열' 카테고리의 다른 글

백준 - 2738 (python)  (0) 2024.02.13
백준 - 10798 (python)  (0) 2024.02.13
백준 - 2563 (python)  (0) 2024.02.13