# n 입력
n = int(input())
# grid 입력
grid = [
list(map(int, input().split()))
for _ in range(n)
]
# 함수들
# calc(x, y)
def calc(x, y):
# curr_coin
curr_coin = grid[x][y] + grid[x][y+1] + grid[x][y+2]
# return
return curr_coin
# 설계
# 최대 동전의 수 설정
max_coin = 0
# grid 돌기
for i in range(n): # 열
for j in range(n-2): # 행
# max_coin update
max_coin = max(max_coin, calc(i, j))
# 출력
print(max_coin)'Algorithm(CodeTree, Python) > 완전탐색1' 카테고리의 다른 글
| [코드트리 자리 수 단위로 완전탐색] 최고의 13위치 2 python (0) | 2022.11.28 |
|---|---|
| [코드트리 자리 수 단위로 완전탐색] 씨 오 더블유 2 python (0) | 2022.11.17 |
| [코드트리 자리 수 단위로 완전탐색] 마라톤 중간에 택시타기 2 python (0) | 2022.11.14 |
| [코드트리 자리 수 단위로 완전탐색] 일렬로 서있는 소 2 python (0) | 2022.11.10 |
| [코드트리 자리 수 단위로 완전탐색] 괄호 쌍 만들어주기 3 python (0) | 2022.11.08 |