結果

問題 No.365 ジェンガソート
ユーザー 双六
提出日時 2020-08-04 02:40:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 515 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 82,144 KB
実行使用メモリ 90,776 KB
最終ジャッジ日時 2024-09-13 20:34:02
合計ジャッジ時間 4,379 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")
import bisect

def LIS(N, A):
	DP = [INF] * N

	for i in range(N):
		x = bisect.bisect_left(DP, A[i])
		DP[x] = A[i]

	ans = bisect.bisect_left(DP, INF)
	# print(DP)

	return ans

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N = int(input())
	A = getlist()
	lis = LIS(N, A)
	print(N - lis)




if __name__ == '__main__':
	main()
0