[백준/파이썬] 17127번 벚꽃이 정보섬에 피어난 이유
-Coden = int(input())tree = list(map(int, input().split()))res = 0def solution(start, end): li = tree[start:end] answer = 1 for el in li: answer *= el return answerfor i in range(1, n): for j in range(i + 1, n): for k in range(j + 1, n): total = solution(0, i) + solution(i, j) + solution(j, k) + solution(k, n) res = max(res, total)print(res)
2025. 1. 15.