LoginSignup
0
0

More than 1 year has passed since last update.

ABC87 C - Candies を解いた

Posted at

abc87_1.png
abc87_2.png
abc87_3.png
abc87_4.png
abc87_5.png

全探索でよいのでは?

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)

一応通った

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0