結果
| 問題 |
No.2126 MEX Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-29 13:25:21 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 343 bytes |
| コンパイル時間 | 195 ms |
| コンパイル使用メモリ | 82,532 KB |
| 実行使用メモリ | 84,152 KB |
| 最終ジャッジ日時 | 2024-10-07 00:22:33 |
| 合計ジャッジ時間 | 3,078 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 12 |
ソースコード
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse = True)
ans = 0
import sys
while A:
if A[-1] != ans:
print(ans)
exit()
if len(A) <= 1:
print(ans)
exit()
if A[-2] != ans:
print(ans)
exit()
while A and A[-1] == ans:
A.pop()
ans += 1
print(ans)