結果
問題 |
No.365 ジェンガソート
|
ユーザー |
![]() |
提出日時 | 2020-01-27 17:28:16 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 516 bytes |
コンパイル時間 | 234 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 19,980 KB |
最終ジャッジ日時 | 2024-09-14 12:00:11 |
合計ジャッジ時間 | 4,832 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 25 |
ソースコード
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N,*A = map(int,read().split()) def longest_increasing_subsequence(seq, wider_sense = True): from bisect import bisect_left, bisect_right f = bisect_right if wider_sense else bisect_left N = len(seq) INF = 10**18 dp = [INF] * (N+1) for x in seq: i = f(dp,x) dp[i] = x return f(dp,INF-1) answer = N - longest_increasing_subsequence(A, False) print(answer)