96182024-02-23 14:42:09DohajovDanielVásárlás (75 pont)python3Time limit exceeded 15/75400ms44004 KiB
def main():
    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)
main()
"""
4
5 6 7 8
10 1 2 20

"""
    
SubtaskSumTestVerdictTimeMemory
base15/75
1Accepted0/017ms11312 KiB
2Time limit exceeded0/0400ms11704 KiB
3Accepted3/318ms11932 KiB
4Wrong answer0/417ms12120 KiB
5Wrong answer0/417ms12100 KiB
6Accepted4/417ms12148 KiB
7Wrong answer0/419ms12828 KiB
8Wrong answer0/321ms12976 KiB
9Wrong answer0/424ms13084 KiB
10Wrong answer0/430ms13376 KiB
11Wrong answer0/428ms13532 KiB
12Accepted5/520ms13308 KiB
13Wrong answer0/3158ms42952 KiB
14Time limit exceeded0/3365ms20688 KiB
15Time limit exceeded0/3375ms20168 KiB
16Time limit exceeded0/3363ms20656 KiB
17Time limit exceeded0/3368ms20652 KiB
18Time limit exceeded0/3379ms20392 KiB
19Time limit exceeded0/3384ms20704 KiB
20Time limit exceeded0/3375ms21608 KiB
21Wrong answer0/3150ms44004 KiB
22Time limit exceeded0/3368ms11524 KiB
23Time limit exceeded0/3379ms21220 KiB
24Accepted3/3166ms43068 KiB