結果

問題 No.2126 MEX Game
ユーザー ShirotsumeShirotsume
提出日時 2022-11-18 22:47:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 820 bytes
コンパイル時間 1,228 ms
コンパイル使用メモリ 81,508 KB
実行使用メモリ 100,560 KB
最終ジャッジ日時 2023-10-20 07:46:46
合計ジャッジ時間 4,540 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
75,208 KB
testcase_01 AC 60 ms
75,204 KB
testcase_02 AC 59 ms
75,208 KB
testcase_03 AC 61 ms
75,208 KB
testcase_04 AC 62 ms
75,200 KB
testcase_05 AC 61 ms
75,200 KB
testcase_06 AC 60 ms
75,204 KB
testcase_07 AC 60 ms
75,204 KB
testcase_08 AC 60 ms
75,204 KB
testcase_09 AC 60 ms
75,208 KB
testcase_10 AC 122 ms
97,512 KB
testcase_11 AC 107 ms
97,520 KB
testcase_12 AC 102 ms
97,516 KB
testcase_13 AC 109 ms
97,516 KB
testcase_14 WA -
testcase_15 AC 103 ms
99,592 KB
testcase_16 AC 100 ms
99,528 KB
testcase_17 AC 97 ms
89,292 KB
testcase_18 AC 87 ms
89,480 KB
testcase_19 AC 78 ms
88,368 KB
testcase_20 AC 78 ms
88,368 KB
testcase_21 AC 88 ms
100,560 KB
testcase_22 AC 65 ms
75,212 KB
testcase_23 AC 59 ms
75,208 KB
testcase_24 AC 58 ms
75,212 KB
testcase_25 AC 61 ms
75,212 KB
testcase_26 AC 59 ms
75,212 KB
testcase_27 AC 61 ms
75,212 KB
testcase_28 AC 60 ms
75,212 KB
testcase_29 AC 60 ms
75,208 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 + 2):
    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
k = max(A)
A[k] -= 1
yoyu = True
for i in range(0, 10 ** 5 + 2):
        if A[i] == 1 and yoyu:
            yoyu = False
        elif A[i] <= 1:
            ans = max(ans, i)
            break


print(ans)

0