結果

問題 No.2126 MEX Game
ユーザー tamatotamato
提出日時 2022-11-18 21:42:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 544 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 81,764 KB
実行使用メモリ 97,664 KB
最終ジャッジ日時 2023-10-20 06:28:38
合計ジャッジ時間 3,240 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
53,516 KB
testcase_01 AC 44 ms
53,464 KB
testcase_02 AC 46 ms
53,464 KB
testcase_03 AC 46 ms
53,464 KB
testcase_04 AC 48 ms
53,464 KB
testcase_05 AC 44 ms
53,464 KB
testcase_06 AC 44 ms
53,464 KB
testcase_07 AC 45 ms
53,464 KB
testcase_08 AC 45 ms
53,464 KB
testcase_09 AC 50 ms
53,464 KB
testcase_10 AC 89 ms
92,432 KB
testcase_11 AC 86 ms
92,432 KB
testcase_12 AC 86 ms
92,432 KB
testcase_13 AC 87 ms
92,432 KB
testcase_14 AC 84 ms
94,276 KB
testcase_15 AC 90 ms
94,276 KB
testcase_16 AC 82 ms
94,236 KB
testcase_17 AC 72 ms
83,140 KB
testcase_18 AC 71 ms
83,092 KB
testcase_19 AC 64 ms
80,488 KB
testcase_20 AC 65 ms
80,488 KB
testcase_21 AC 83 ms
97,664 KB
testcase_22 AC 43 ms
53,464 KB
testcase_23 AC 43 ms
53,464 KB
testcase_24 AC 44 ms
53,464 KB
testcase_25 WA -
testcase_26 AC 42 ms
53,464 KB
testcase_27 AC 42 ms
53,464 KB
testcase_28 AC 45 ms
53,464 KB
testcase_29 AC 43 ms
53,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353


def main():
    import sys
    from collections import Counter
    input = sys.stdin.readline

    N = int(input())
    A = list(map(int, input().split()))

    C = Counter(A)
    flg = 1
    ans = 0
    for a in range(10 ** 5 + 10):
        if C[a] == 0:
            break
        elif C[a] == 1:
            if flg and (a + 1) * 2 <= N:
                flg = 0
                ans += 1
            else:
                break
        else:
            ans += 1
    print(min(ans, N))


if __name__ == '__main__':
    main()
0