⌨️

[AtCoder]ABC-245|B - Mex

2023/06/15に公開

設問ページ

提出結果

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

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

def main():
    n = getInt()
    a = getIntList()

    a.sort()
    for i in range(0, 2000 + 1):
        if not i in a:
            print(i)
            break

if __name__ == "__main__":
    main()

Discussion