結果
問題 | No.2126 MEX Game |
ユーザー |
👑 |
提出日時 | 2022-11-18 21:34:02 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 69 ms / 2,000 ms |
コード長 | 478 bytes |
コンパイル時間 | 325 ms |
コンパイル使用メモリ | 82,816 KB |
実行使用メモリ | 82,176 KB |
最終ジャッジ日時 | 2024-09-20 01:58:31 |
合計ジャッジ時間 | 2,593 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
n = int(input())A = list(map(int, input().split()))cnt = [0] * (10 ** 5 + 1)for a in A:cnt[a] += 1tot = 0flg = Falsefor i in range(10 ** 5):tot += min(cnt[i], 2)if cnt[i] == 0:print(i)breakelif cnt[i] == 1:if flg:print(i)breakif tot == n:print(i)breakelse:flg = Trueelif cnt[i] == 2 and flg and tot == n:print(i)break