結果
| 問題 | No.2126 MEX Game |
| コンテスト | |
| ユーザー |
gr1msl3y
|
| 提出日時 | 2022-11-26 11:27:37 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 436 bytes |
| 記録 | |
| コンパイル時間 | 375 ms |
| コンパイル使用メモリ | 85,376 KB |
| 実行使用メモリ | 83,200 KB |
| 最終ジャッジ日時 | 2026-04-19 00:31:13 |
| 合計ジャッジ時間 | 2,851 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 WA * 4 |
ソースコード
N = int(input())
A = list(map(int, input().split()))
A.sort()
indl = 0
indr = N
res = 0
M = 10**5
for i in range(M):
ct = 0
while indl < indr and A[indl] == i:
ct += 1
indl += 1
if ct == 0:
print(i)
exit()
if ct == 1:
if res:
res -= 1
elif indl == indr:
print(i)
exit()
else:
indr -= 1
else:
res += ct-2
gr1msl3y