結果
問題 | No.365 ジェンガソート |
ユーザー |
![]() |
提出日時 | 2017-01-28 18:50:37 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 458 bytes |
コンパイル時間 | 910 ms |
コンパイル使用メモリ | 73,000 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-23 21:19:55 |
合計ジャッジ時間 | 4,058 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 25 |
ソースコード
#include <iostream>#include <algorithm>#include <vector>using namespace std;using ll = long long;constexpr ll INF = (1LL << 55);int main(){int n;cin >> n;int a[n];for (int i = 0; i < n; i++) {cin >> a[i];}vector<ll> dp(n, INF);for (int i = 0; i < n; i++) {*lower_bound(dp.begin(), dp.end(), a[i]) = a[i];}cout << n - (lower_bound(dp.begin(), dp.end(), INF) - dp.begin()) << endl;return 0;}