Submission #2214659


Source Code Expand

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
const int inf=1000000000;

int main() {
  int N;
  cin>>N;
  int c[N];
  for (int i=0; i<N; i++) {
    cin>>c[i];
  }
  int dp[N];
  memset(dp,inf,sizeof(dp));
  for (int i=0; i<N; i++) {
    *lower_bound(dp,dp+N,c[i])=c[i];
  }
  cout<<n-(lower_bound(dp,dp+n,inf)-dp)<<endl;
  return 0;
}

Submission Info

Submission Time
Task D - トランプ挿入ソート
User tom123
Language C++14 (GCC 5.4.1)
Score 0
Code Size 393 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:15:27: error: ‘memset’ was not declared in this scope
   memset(dp,inf,sizeof(dp));
                           ^
./Main.cpp:19:9: error: ‘n’ was not declared in this scope
   cout<<n-(lower_bound(dp,dp+n,inf)-dp)<<endl;
         ^