96172024-02-23 14:40:13DohajovDanielVásárlás (75 pont)python3Time limit exceeded 15/75453ms44356 KiB
tdb = int(input())
b1L = [int(i) for i in input().split()]
b2L = [int(i) for i in input().split()]
b1sz = 0; asz=0; bsz=0; j=0
for i in range(tdb):
    asz+=b1L[i]
    #print(sum(b2L[j:i+1]))
    if sum(b2L[j:i+1]) <= asz:
        bsz += sum(b2L[j:i+1])
        asz=0
        j=i+1
print(asz+bsz)
"""
4
5 6 7 8
10 1 2 20

"""
    
SubtaskSumTestVerdictTimeMemory
base15/75
1Accepted0/018ms11304 KiB
2Time limit exceeded0/0354ms11800 KiB
3Accepted3/317ms11720 KiB
4Wrong answer0/417ms11944 KiB
5Wrong answer0/417ms12108 KiB
6Accepted4/417ms11996 KiB
7Wrong answer0/420ms12492 KiB
8Wrong answer0/323ms12344 KiB
9Wrong answer0/425ms13004 KiB
10Wrong answer0/430ms13368 KiB
11Wrong answer0/428ms13380 KiB
12Accepted5/520ms13328 KiB
13Wrong answer0/3199ms42496 KiB
14Time limit exceeded0/3439ms20724 KiB
15Time limit exceeded0/3365ms20444 KiB
16Time limit exceeded0/3377ms20748 KiB
17Time limit exceeded0/3388ms20944 KiB
18Time limit exceeded0/3453ms20308 KiB
19Time limit exceeded0/3388ms20604 KiB
20Time limit exceeded0/3377ms21940 KiB
21Wrong answer0/3179ms44356 KiB
22Time limit exceeded0/3370ms11808 KiB
23Time limit exceeded0/3372ms21868 KiB
24Accepted3/3201ms42900 KiB