結果

問題 No.2126 MEX Game
ユーザー gr1msl3ygr1msl3y
提出日時 2022-11-26 11:27:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 436 bytes
コンパイル時間 491 ms
コンパイル使用メモリ 82,252 KB
実行使用メモリ 84,532 KB
最終ジャッジ日時 2024-04-10 12:58:11
合計ジャッジ時間 2,685 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,440 KB
testcase_01 AC 34 ms
52,536 KB
testcase_02 AC 34 ms
52,572 KB
testcase_03 AC 35 ms
52,068 KB
testcase_04 AC 34 ms
54,004 KB
testcase_05 AC 34 ms
52,280 KB
testcase_06 AC 34 ms
52,872 KB
testcase_07 AC 35 ms
53,428 KB
testcase_08 AC 34 ms
53,948 KB
testcase_09 AC 36 ms
52,164 KB
testcase_10 AC 73 ms
81,648 KB
testcase_11 AC 75 ms
82,568 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 71 ms
81,692 KB
testcase_16 AC 70 ms
79,904 KB
testcase_17 AC 70 ms
81,200 KB
testcase_18 AC 73 ms
80,856 KB
testcase_19 AC 55 ms
78,784 KB
testcase_20 AC 53 ms
77,340 KB
testcase_21 WA -
testcase_22 AC 34 ms
53,132 KB
testcase_23 AC 34 ms
53,292 KB
testcase_24 AC 36 ms
52,024 KB
testcase_25 AC 35 ms
53,008 KB
testcase_26 AC 34 ms
53,016 KB
testcase_27 AC 36 ms
53,336 KB
testcase_28 AC 37 ms
52,244 KB
testcase_29 AC 35 ms
52,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
A.sort()
indl = 0
indr = N
res = 0
M = 10**5
for i in range(M):
    ct = 0
    while indl < indr and A[indl] == i:
        ct += 1
        indl += 1
    if ct == 0:
        print(i)
        exit()
    if ct == 1:
        if res:
            res -= 1
        elif indl == indr:
            print(i)
            exit()
        else:
            indr -= 1
    else:
        res += ct-2
0