結果

問題 No.2126 MEX Game
ユーザー gr1msl3ygr1msl3y
提出日時 2022-11-26 11:19:31
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 359 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 86,916 KB
実行使用メモリ 90,664 KB
最終ジャッジ日時 2023-07-25 21:31:48
合計ジャッジ時間 5,534 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,248 KB
testcase_01 AC 80 ms
71,108 KB
testcase_02 AC 80 ms
71,152 KB
testcase_03 AC 79 ms
71,420 KB
testcase_04 AC 76 ms
71,256 KB
testcase_05 AC 76 ms
71,240 KB
testcase_06 AC 76 ms
71,504 KB
testcase_07 WA -
testcase_08 AC 77 ms
71,104 KB
testcase_09 AC 78 ms
71,148 KB
testcase_10 AC 119 ms
90,664 KB
testcase_11 AC 116 ms
90,660 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 113 ms
90,200 KB
testcase_16 AC 113 ms
90,176 KB
testcase_17 AC 115 ms
90,268 KB
testcase_18 AC 115 ms
90,372 KB
testcase_19 AC 97 ms
88,600 KB
testcase_20 AC 95 ms
88,316 KB
testcase_21 WA -
testcase_22 AC 76 ms
71,112 KB
testcase_23 AC 76 ms
71,240 KB
testcase_24 AC 77 ms
71,304 KB
testcase_25 AC 77 ms
71,352 KB
testcase_26 WA -
testcase_27 AC 77 ms
71,240 KB
testcase_28 AC 75 ms
71,244 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