結果
問題 |
No.365 ジェンガソート
|
ユーザー |
![]() |
提出日時 | 2016-06-30 17:25:00 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 422 bytes |
コンパイル時間 | 1,225 ms |
コンパイル使用メモリ | 157,912 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-11 23:14:15 |
合計ジャッジ時間 | 3,029 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 25 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,a) FOR(i,0,a) const int MAX_N=1e5; const int INF=1e8; int N; int a[MAX_N]; int dp[MAX_N]; int main(){ cin.tie(0); ios::sync_with_stdio(false); cin>>N; REP(i,N){ cin>>a[i]; } fill(dp,dp+N,INF); REP(i,N){ *(lower_bound(dp,dp+N,a[i]))=a[i]; } cout<<N-(lower_bound(dp,dp+N,INF)-dp)<<"\n"; return 0; }