⌨️

[AtCoder]ABC-290|A - Contest Result

2023/08/23に公開

設問ページ

提出結果

def getIntMap():
    return map(int, input().split())


def getIntList():
    return list(map(int, input().split()))


def main():
    n, m = getIntMap()
    a = [0] + getIntList()
    b = getIntList()

    c = 0
    for i in b:
        c += a[i]
    print(c)


if __name__ == "__main__":
    main()

Discussion