본문 바로가기

알고리즘 문제풀이

백준 2566. 최대값 브론즈3 Python

arr = [list(map(int,input().split())) for _ in range(1,10)]
# pprint.pprint(arr)
max_v = 0
max_i = 0
max_j = 0
for i in range(9):
    for j in range(9):
        if max_v < arr[i][j]:
            max_v = arr[i][j]
            max_i = i
            max_j = j
print(max_v)
print(max_i+1,max_j+1)

컴퓨터 상에서는 0부터 시작이지만

입력값은 1부터 시작이기 때문에

출력할때 i와 j를 1씩 더해서 출력했다.