General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
95969596 Practice:
ya_hossein
1195C - 18 Python 3 Runtime error on test 5 265 ms 7436 KB 2020-10-19 14:48:27 2020-10-19 14:48:27
→ Source
#besme taala
#ya_hossein
n = int(input())
num1 = list(map(int, input().split()))
num2 = list(map(int, input().split()))
def ans1(x):
    if x >= n:
        return 0
    return num1[x] + max((ans0(x + 1)), ans0(x + 2))
def ans0(x):
    if x >= n:
        return 0
    return num2[x] + max(ans1(x + 1), ans1(x + 2))
print(max(ans0(0), ans1(0)))
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details