結果
問題 |
No.2126 MEX Game
|
ユーザー |
|
提出日時 | 2022-11-18 22:29:35 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 456 bytes |
コンパイル時間 | 274 ms |
コンパイル使用メモリ | 81,804 KB |
実行使用メモリ | 100,088 KB |
最終ジャッジ日時 | 2024-09-20 02:55:30 |
合計ジャッジ時間 | 2,790 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 WA * 9 |
ソースコード
n = int(input()) a = list(map(int,input().split())) from collections import Counter c = Counter(a) if c[0] == 0: print(0) else: ans = 0 amari = 0 flg = True now = [] for i in range(n+10): if c[i] >= 2: now.append(c[i]) elif c[i] == 1 and flg: now.append(c[i]) flg = False else: break flg = False for i in now: if i >= 3: flg = True if flg: print(len(now)) else: print(len(now)-1)