⌨️

[AtCoder]ABC-306|B - Base 2

2023/09/15に公開

設問ページ

提出結果

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


def main():
    a = getIntList()

    r = 0
    for i in range(len(a)):
        if a[i] == 0:
            continue
        r += (2 ** i)

    print(r)


if __name__ == "__main__":
    main()

Discussion