結果
| 問題 | No.2126 MEX Game |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-18 22:38:16 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 94 ms / 2,000 ms |
| + 506µs | |
| コード長 | 386 bytes |
| 記録 | |
| コンパイル時間 | 228 ms |
| コンパイル使用メモリ | 95,816 KB |
| 実行使用メモリ | 99,988 KB |
| 最終ジャッジ日時 | 2026-08-31 12:53:08 |
| 合計ジャッジ時間 | 4,661 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
n = int(input())
a = list(map(int,input().split()))
from collections import Counter
c = Counter(a)
if c[0] == 0:
print(0)
else:
flg = True
now = []
for i in range(n+10):
if c[i] >= 2:
now.append(2)
elif c[i] == 1 and flg:
now.append(c[i])
flg = False
else:
break
if sum(now) != n or flg:
print(len(now))
else:
print(len(now)-1)