본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 31821번 학식 사주기

by 현장 2024. 5. 14.

-Code

price = [int(input()) for _ in range(int(input()))]
res = 0

for _ in range(int(input())):
    res += price[int(input()) - 1]

print(res)