結果
| 問題 | No.2126 MEX Game |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2022-11-18 21:34:02 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 56 ms / 2,000 ms |
| + 510µs | |
| コード長 | 478 bytes |
| 記録 | |
| コンパイル時間 | 89 ms |
| コンパイル使用メモリ | 64,640 KB |
| 実行使用メモリ | 70,592 KB |
| 最終ジャッジ日時 | 2026-10-19 06:46:57 |
| 合計ジャッジ時間 | 3,302 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
n = int(input())
A = list(map(int, input().split()))
cnt = [0] * (10 ** 5 + 1)
for a in A:
cnt[a] += 1
tot = 0
flg = False
for i in range(10 ** 5):
tot += min(cnt[i], 2)
if cnt[i] == 0:
print(i)
break
elif cnt[i] == 1:
if flg:
print(i)
break
if tot == n:
print(i)
break
else:
flg = True
elif cnt[i] == 2 and flg and tot == n:
print(i)
break