Submission #6469203


Source Code Expand

Copy
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;

const ll mx = 1000000000000;

int main(){
  int N;
  cin >> N;
  ll a[N];
  for(int i = 0; i < N; i++){
    cin >> a[i];
    a[i] = mx - a[i];
  }

  multiset<ll> st;
  st.insert(a[0]);
  for(int i = 1; i < N; i++){
    auto itr = st.upper_bound(a[i]);
    //cout << "hofe" << endl;
    if(itr == st.end()){
      st.insert(a[i]);
    } else {
      st.erase(itr);
      st.insert(a[i]);
    }
  }

  cout << st.size() << endl;
  return 0;
}

Submission Info

Submission Time
Task E - Sequence Decomposing
User syawacha
Language C++14 (GCC 5.4.1)
Score 500
Code Size 721 Byte
Status AC
Exec Time 82 ms
Memory 5760 KB

Judge Result

Set Name All Sample
Score / Max Score 500 / 500 0 / 0
Status
AC × 35
AC × 2
Set Name Test Cases
All all_same, killer_01, killer_02, killer_03, killer_04, killer_05, many_dup_01, many_dup_02, many_dup_03, many_dup_04, many_dup_05, many_dup_06, many_dup_07, many_dup_08, many_dup_09, many_dup_10, many_dup_11, many_dup_12, rand_max_01, rand_max_02, rand_max_03, rand_max_04, rand_max_05, rand_max_06, rand_max_07, rand_max_08, rand_max_09, rand_max_10, rand_max_11, sample_01, sample_02, sorted_ascending, sorted_descending, unique_perm_01, unique_perm_02
Sample sample_01, sample_02
Case Name Status Exec Time Memory
all_same AC 82 ms 5760 KB
killer_01 AC 77 ms 5632 KB
killer_02 AC 72 ms 5248 KB
killer_03 AC 77 ms 5632 KB
killer_04 AC 67 ms 4096 KB
killer_05 AC 68 ms 4224 KB
many_dup_01 AC 53 ms 1024 KB
many_dup_02 AC 54 ms 1024 KB
many_dup_03 AC 53 ms 1024 KB
many_dup_04 AC 56 ms 1152 KB
many_dup_05 AC 56 ms 1280 KB
many_dup_06 AC 51 ms 1152 KB
many_dup_07 AC 63 ms 1920 KB
many_dup_08 AC 61 ms 2176 KB
many_dup_09 AC 56 ms 2048 KB
many_dup_10 AC 65 ms 3328 KB
many_dup_11 AC 62 ms 2560 KB
many_dup_12 AC 58 ms 2432 KB
rand_max_01 AC 53 ms 1024 KB
rand_max_02 AC 54 ms 1024 KB
rand_max_03 AC 50 ms 1024 KB
rand_max_04 AC 52 ms 1024 KB
rand_max_05 AC 51 ms 1024 KB
rand_max_06 AC 51 ms 1024 KB
rand_max_07 AC 52 ms 1024 KB
rand_max_08 AC 53 ms 1024 KB
rand_max_09 AC 50 ms 1024 KB
rand_max_10 AC 55 ms 1024 KB
rand_max_11 AC 51 ms 1024 KB
sample_01 AC 1 ms 256 KB
sample_02 AC 1 ms 256 KB
sorted_ascending AC 32 ms 1024 KB
sorted_descending AC 63 ms 5504 KB
unique_perm_01 AC 41 ms 1024 KB
unique_perm_02 AC 44 ms 1024 KB