結果

問題 No.365 ジェンガソート
ユーザー lam6er
提出日時 2025-03-20 20:15:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 242 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 82,704 KB
実行使用メモリ 90,204 KB
最終ジャッジ日時 2025-03-20 20:16:00
合計ジャッジ時間 3,987 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect

n = int(input())
a = list(map(int, input().split()))
tails = []
for num in a:
    idx = bisect.bisect_left(tails, num)
    if idx == len(tails):
        tails.append(num)
    else:
        tails[idx] = num
print(n - len(tails))
0