結果

問題 No.2126 MEX Game
ユーザー 遭難者遭難者
提出日時 2022-10-27 20:41:44
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 402 bytes
コンパイル時間 679 ms
コンパイル使用メモリ 81,708 KB
実行使用メモリ 82,960 KB
最終ジャッジ日時 2023-10-19 05:25:28
合計ジャッジ時間 2,742 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
54,320 KB
testcase_01 AC 39 ms
54,320 KB
testcase_02 AC 39 ms
54,320 KB
testcase_03 AC 40 ms
54,320 KB
testcase_04 AC 39 ms
54,320 KB
testcase_05 AC 39 ms
54,320 KB
testcase_06 AC 40 ms
54,320 KB
testcase_07 AC 39 ms
54,320 KB
testcase_08 AC 40 ms
54,320 KB
testcase_09 AC 39 ms
54,320 KB
testcase_10 AC 72 ms
82,800 KB
testcase_11 AC 64 ms
82,812 KB
testcase_12 AC 67 ms
82,960 KB
testcase_13 AC 69 ms
82,960 KB
testcase_14 AC 63 ms
80,596 KB
testcase_15 AC 62 ms
80,596 KB
testcase_16 AC 62 ms
80,544 KB
testcase_17 AC 63 ms
80,516 KB
testcase_18 AC 64 ms
80,640 KB
testcase_19 AC 61 ms
79,524 KB
testcase_20 AC 61 ms
79,524 KB
testcase_21 AC 63 ms
80,596 KB
testcase_22 AC 40 ms
54,324 KB
testcase_23 AC 40 ms
54,324 KB
testcase_24 AC 39 ms
54,324 KB
testcase_25 WA -
testcase_26 AC 39 ms
54,324 KB
testcase_27 AC 41 ms
54,324 KB
testcase_28 AC 39 ms
54,324 KB
testcase_29 AC 40 ms
54,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

c = [0] * 100001
n = int(input())
for i in list(map(int, input().split())):
    c[i] += 1
one, aff = False, False
sum, k = 0, 0
while True:
    aff |= c[k] > 2
    sum += c[k]
    if c[k] == 0:
        print(k)
        exit()
    if c[k] == 1:
        if one:
            print(k)
            exit()
        one = True
        if sum == n and not aff:
            print(k)
            exit()
    k += 1
0