結果

問題 No.2126 MEX Game
ユーザー 遭難者遭難者
提出日時 2022-11-14 21:02:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 362 bytes
コンパイル時間 446 ms
コンパイル使用メモリ 81,640 KB
実行使用メモリ 82,792 KB
最終ジャッジ日時 2023-10-19 05:25:53
合計ジャッジ時間 3,085 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
58,116 KB
testcase_01 AC 47 ms
60,176 KB
testcase_02 AC 43 ms
58,116 KB
testcase_03 AC 43 ms
58,116 KB
testcase_04 AC 44 ms
58,116 KB
testcase_05 AC 42 ms
58,116 KB
testcase_06 AC 43 ms
58,116 KB
testcase_07 AC 42 ms
58,116 KB
testcase_08 AC 42 ms
58,116 KB
testcase_09 AC 42 ms
58,116 KB
testcase_10 AC 68 ms
82,768 KB
testcase_11 AC 70 ms
82,768 KB
testcase_12 AC 71 ms
82,792 KB
testcase_13 AC 71 ms
82,792 KB
testcase_14 AC 69 ms
82,588 KB
testcase_15 AC 67 ms
82,584 KB
testcase_16 AC 66 ms
82,532 KB
testcase_17 AC 69 ms
82,336 KB
testcase_18 AC 70 ms
82,460 KB
testcase_19 AC 63 ms
79,604 KB
testcase_20 AC 65 ms
79,596 KB
testcase_21 AC 66 ms
80,528 KB
testcase_22 AC 43 ms
58,116 KB
testcase_23 AC 42 ms
58,116 KB
testcase_24 AC 42 ms
58,116 KB
testcase_25 AC 42 ms
58,116 KB
testcase_26 AC 42 ms
58,116 KB
testcase_27 AC 42 ms
58,116 KB
testcase_28 AC 42 ms
58,116 KB
testcase_29 AC 42 ms
58,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
inf = 10 ** 5 + 1
c = [0] * inf
for i in list(map(int, input().split())):
    c[i] += 1
one, ok1, ok2 = 0, True, 0
for i in range(inf):
    if c[i] >= 1:
        ok2 = i
k = 0
while 1:
    ok1 &= c[k] <= 2
    if c[k] == 1:
        one += 1
    if c[k] == 0 or one > 1 or one == 1 and ok1 and k >= ok2:
        print(k)
        exit()
    k += 1
0