⌨️

[AtCoder]ABC-076|B - Addition and Multiplication

2023/01/04に公開

設問ページ

提出結果

def getInt():
    return int(input())


def main():
    n = getInt()
    k = getInt()

    r = 1
    for i in range(n):
        a = 2 * r
        b = r + k
        r = a if a <= b else b
    print(r)


if __name__ == "__main__":
    main()

Discussion