백준 27330번: 点数 (Score) #Python

ColorlessDia·2024년 5월 26일

algorithm/baekjoon

목록 보기
188/807
N = int(input())
A = list(map(int, input().split()))
M = int(input())
B = list(map(int, input().split()))

score = 0

for a in A:
    score += a

    if score in B:
        score = 0

print(score)

0개의 댓글