結果

問題 No.2126 MEX Game
コンテスト
ユーザー flygon
提出日時 2022-11-18 22:18:21
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 312 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 257 ms
コンパイル使用メモリ 85,568 KB
実行使用メモリ 99,484 KB
最終ジャッジ日時 2026-04-08 15:03:40
合計ジャッジ時間 2,547 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n = int(input())
a = list(map(int,input().split()))
from collections import Counter
c = Counter(a)
if c[0] < 2:
  print(0)
else:
  ans = 0
  amari = 0
  for i in range(n+10):
    if c[i] >= 2:
      ans += 1
      amari += c[i] - 2
    else:
      break
  if c[ans] == 1 and amari >= 1:
    ans += 1
  print(ans)
0