ABC87 C - Candies を解いた
3901 ワード
全探索でよいのでは?
Candies.py
N = int(input())
A = [list(map(int,input().split())) for _ in range(2)]
ans = 0
for i in range(N):
score = 0
for j in range(N):
if j == i:
score += A[0][j]
score += A[1][j]
elif j < i:
score += A[0][j]
elif j > i:
score += A[1][j]
ans = max(ans,score)
print(ans)
一応通った
Author And Source
この問題について(ABC87 C - Candies を解いた), 我々は、より多くの情報をここで見つけました https://qiita.com/AKpirion/items/3c2d48a52512e32fc39e著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .