https://www.codetree.ai/missions/5/problems/best-place-of-13/description
코드트리 | 코딩테스트 준비를 위한 알고리즘 정석
국가대표가 만든 코딩 공부의 가이드북 코딩 왕초보부터 꿈의 직장 코테 합격까지, 국가대표가 엄선한 커리큘럼으로 준비해보세요.
www.codetree.ai
import sys
input = sys.stdin.readline
n = int(input())
graph = []
for _ in range(n):
temp = list(map(int, input().rstrip().split(" ")))
graph.append(temp)
max_val = 0
for i in range(n):
for j in range(n-2):
max_val = max(max_val, graph[i][j] + graph[i][j+1] + graph[i][j+2])
print(max_val)
728x90
반응형
'🔻PS > Codetree' 카테고리의 다른 글
[Codetree] 격자 위의 편안한 상태 Python (0) | 2024.08.06 |
---|---|
[Codetree] 이상한 진수 2 Python (0) | 2024.08.06 |
[Codetree] 일렬로 서있는 소 2 Python (0) | 2024.08.04 |
[Codetree] 괄호 쌍 만들어주기 3 Python (0) | 2024.08.04 |
[Codetree] 모이자 Python (0) | 2024.08.04 |