結果
問題 | No.365 ジェンガソート |
ユーザー |
![]() |
提出日時 | 2018-07-03 20:42:55 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 479 bytes |
コンパイル時間 | 1,886 ms |
コンパイル使用メモリ | 161,704 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-01 02:01:25 |
合計ジャッジ時間 | 3,274 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 25 |
ソースコード
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int,int> pii; #define rep(i,n) for(ll i=0;i<(ll)(n);i++) #define all(a) (a).begin(),(a).end() #define pb emplace_back #define INF (1e9+1) int main(){ int n; cin>>n; vector<int> v(n); rep(i,n)cin>>v[i]; vector<int> dp(n,INF); rep(i,n){ *upper_bound(all(dp),v[i]) = v[i]; } int l = lower_bound(all(dp),INF) - dp.begin(); cout<<n-l<<endl; }