結果
問題 |
No.365 ジェンガソート
|
ユーザー |
![]() |
提出日時 | 2016-09-19 00:19:01 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 300 bytes |
コンパイル時間 | 351 ms |
コンパイル使用メモリ | 53,956 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-17 09:07:25 |
合計ジャッジ時間 | 2,020 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 WA * 19 |
ソースコード
#include <iostream> using namespace std; int ans[100001], n, inp, max_ans; int main(){ cin >> n; for(int i=0; i<n; ++i){ cin >> inp; ans[inp] = ans[inp-1] + 1; } for(int i=1; i<=n; ++i){ max_ans = max(max_ans, ans[i]); } cout << n - max_ans << endl; }