結果

問題 No.2126 MEX Game
ユーザー ShirotsumeShirotsume
提出日時 2022-11-18 22:37:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 834 bytes
コンパイル時間 961 ms
コンパイル使用メモリ 81,752 KB
実行使用メモリ 100,712 KB
最終ジャッジ日時 2023-10-20 07:34:35
合計ジャッジ時間 3,748 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
75,424 KB
testcase_01 AC 60 ms
75,424 KB
testcase_02 AC 59 ms
75,432 KB
testcase_03 AC 58 ms
75,428 KB
testcase_04 AC 57 ms
75,424 KB
testcase_05 AC 58 ms
75,424 KB
testcase_06 AC 58 ms
75,424 KB
testcase_07 AC 59 ms
75,424 KB
testcase_08 AC 59 ms
75,424 KB
testcase_09 AC 59 ms
75,432 KB
testcase_10 AC 109 ms
97,672 KB
testcase_11 AC 100 ms
97,672 KB
testcase_12 AC 100 ms
97,672 KB
testcase_13 AC 98 ms
97,672 KB
testcase_14 WA -
testcase_15 AC 100 ms
99,748 KB
testcase_16 AC 99 ms
99,684 KB
testcase_17 AC 87 ms
89,444 KB
testcase_18 AC 88 ms
89,632 KB
testcase_19 AC 76 ms
88,592 KB
testcase_20 AC 81 ms
88,592 KB
testcase_21 AC 94 ms
100,712 KB
testcase_22 AC 57 ms
75,428 KB
testcase_23 AC 57 ms
75,428 KB
testcase_24 AC 59 ms
75,424 KB
testcase_25 AC 58 ms
75,424 KB
testcase_26 AC 61 ms
75,424 KB
testcase_27 AC 58 ms
75,424 KB
testcase_28 AC 58 ms
75,428 KB
testcase_29 AC 58 ms
75,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque, Counter
sys.setrecursionlimit(5 * 10 ** 5)
from pypyjit import set_param
set_param('max_unroll_recursion=-1')
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353

n = ii()

A = Counter(li())
yoyu = False
for i in range(0, 10 ** 5 + 1):
    if A[i] >= 3:
        yoyu = True
ans = -1
for i in range(0, 10 ** 5 + 2):
        if A[i] == 1 and yoyu:
            A[i] = 2
            yoyu = False
        elif A[i] <= 1:
            ans = i
            break

A[max(A)] -= 1
yoyu = True
for i in range(0, 10 ** 5 + 2):
        if A[i] == 1 and yoyu:
            A[i] = 2
            yoyu = False
        elif A[i] <= 1:
            ans = max(ans, i)
            break

print(ans)
0