Problem: p03449
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))

ttl = 0
li1 = []
for i in range(n):
    ttl += a1[i]
    li1.append(ttl)

ttl = 0
li2 = []
for i in range(1,n+1):
    ttl += a2[i*(-1)]
    li2.append(ttl)

ans = 0
for i in range(n):
    ans = max(ans,li1[i]+li2[i])

Failing test case input:
7
0 14 0 0 2 6 1
50 2 0 2 1 0 3

Expected output:
58


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))

ttl = 0
li1 = []
for i in range(n):
    ttl += a1[i]
    li1.append(ttl)

ttl = 0
li2 = []
for i in range(1,n+1):
    ttl += a2[i*(-1)]
    li2.append(ttl)

ans = 0
for i in range(n):
    
    ans = max(ans,li1[i]+li2[(i+1)*(-1)])

print(ans)

Problem: p03449
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a1=list(map(lambda x: int(x), input().split()))
a2=list(map(lambda x: int(x), input().split()))

ans=a1[0]+sum(a2)
for i in range(n-1):
    ans=max(ans, ans+a1[i+1]-a2[i])
print(ans)

Failing test case input:
5
3 2 0 4 1
0 2 1 2 1

Expected output:
12


Actual output:
14


Fixed submission (verdict: Accepted):
n=int(input())
a1=list(map(lambda x: int(x), input().split()))
a2=list(map(lambda x: int(x), input().split()))

tmp=a1[0]+sum(a2)
ans=tmp
for i in range(n-1):
    tmp=tmp+a1[i+1]-a2[i]
    ans=max(ans,tmp)
print(ans)

Problem: p03449
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
li = []

for n in range(2):
  li.append(list(map(int,input().split())))

max = 0

for x in range(N):
  now = 0
  if x == 0:
    now += li[0][0]
  
  for y in range(x):
    now += li[0][y]

  for y in range(N - x):
    now += li[0][y]

  if max < now:
    max = now

print(max - 1)

Failing test case input:
7
-2 -1 0 0 1 23 1
73 -1 0 -1 -8 -1 2

Expected output:
62


Actual output:
19


Fixed submission (verdict: Accepted):
N=int(input())
li = []

for n in range(2):
  li.append(list(map(int,input().split())))

max = 0

for x in range(N):
  now = 0
  
  for y in range(x + 1):
    now += li[0][y]

  for y in range(N):
    if y < x:
      continue
    now += li[1][y]

  if max < now:
    max = now

print(max)

Problem: p03449
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = int(input())
a = []
for i in range(2):
    a.append([int(num) for num in input().split()])

result = 0
for i in range(0, n):
    point = sum(a[0][0:i+1]) + sum(a[1][i:])
    print(a[0][0:i+1])
    print(a[1][i:])
    if(result < point):
        result = point

print(result)


Failing test case input:
7
0 14 3 0 0 28 1
37 11 5 2 1 0 3

Expected output:
59


Actual output:
[0]
[37, 11, 5, 2, 1, 0, 3]
[0, 14]
[11, 5, 2, 1, 0, 3]
[0, 14, 3]
[5, 2, 1, 0, 3]
[0, 14, 3, 0]
[2, 1, 0, 3]
[0, 14, 3, 0, 0]
[1, 0, 3]
[0, 14, 3, 0, 0, 28]
[0, 3]
[0, 14, 3, 0, 0, 28, 1]
[3]
59


Fixed submission (verdict: Accepted):

n = int(input())
a = []
for i in range(2):
    a.append([int(num) for num in input().split()])

result = 0
for i in range(0, n):
    point = sum(a[0][0:i+1]) + sum(a[1][i:])


    if(result < point):
        result = point

print(result)