結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
52,220 KB
testcase_01 AC 31 ms
52,228 KB
testcase_02 AC 31 ms
53,348 KB
testcase_03 AC 30 ms
52,368 KB
testcase_04 AC 30 ms
52,068 KB
testcase_05 AC 31 ms
52,416 KB
testcase_06 AC 30 ms
52,492 KB
testcase_07 WA -
testcase_08 AC 30 ms
52,616 KB
testcase_09 AC 30 ms
52,384 KB
testcase_10 AC 68 ms
83,252 KB
testcase_11 AC 69 ms
82,592 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 64 ms
80,524 KB
testcase_16 AC 64 ms
79,784 KB
testcase_17 AC 67 ms
81,020 KB
testcase_18 AC 67 ms
81,432 KB
testcase_19 AC 48 ms
77,260 KB
testcase_20 AC 46 ms
77,328 KB
testcase_21 WA -
testcase_22 AC 30 ms
52,400 KB
testcase_23 AC 32 ms
53,912 KB
testcase_24 AC 31 ms
53,228 KB
testcase_25 AC 33 ms
53,256 KB
testcase_26 WA -
testcase_27 AC 30 ms
52,644 KB
testcase_28 AC 31 ms
51,868 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
A.sort()
indl = 0
indr = N
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 indl == indr:
            print(i)
            exit()
        else:
            indr -= 1
0