Submission #31769166


Source Code Expand

#include <atcoder/all>
using namespace atcoder;
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = 3.14159265359;
const ll INF = 1LL << 60;

int main()
{
  int n;
  cin >> n;

  vector<int> v(n+1, (int)1e9);

  for (int i = 0; i < n; i++){
    int c;
    cin >> c;
    auto it = lower_bound(v.begin(), v.end(), c);
    *it = c;
  }

  int lis = lower_bound(v.begin(), v.end(), (int)1e9) - v.begin();
  int ans = n - lis;
  cout << ans << endl;
  return 0;
}

Submission Info

Submission Time
Task D - トランプ挿入ソート
User unnohideyuki
Language C++ (GCC 9.2.1)
Score 100
Code Size 520 Byte
Status AC
Exec Time 17 ms
Memory 3744 KiB

Judge Result

Set Name smallA smallB all
Score / Max Score 10 / 10 40 / 40 50 / 50
Status
AC × 19
AC × 37
AC × 55
Set Name Test Cases
smallA test_01_ABC.txt, test_04_ABC.txt, test_07_ABC.txt, test_10_ABC.txt, test_13_ABC.txt, test_16_ABC.txt, test_19_ABC.txt, test_22_ABC.txt, test_25_ABC.txt, test_28_ABC.txt, test_31_ABC.txt, test_32_ABC.txt, test_35_ABC.txt, test_38_ABC.txt, test_41_ABC.txt, test_44_ABC.txt, test_47_ABC.txt, test_50_ABC.txt, test_53_ABC.txt
smallB test_01_ABC.txt, test_02_AB.txt, test_04_ABC.txt, test_05_AB.txt, test_07_ABC.txt, test_08_AB.txt, test_10_ABC.txt, test_11_AB.txt, test_13_ABC.txt, test_14_AB.txt, test_16_ABC.txt, test_17_AB.txt, test_19_ABC.txt, test_20_AB.txt, test_22_ABC.txt, test_23_AB.txt, test_25_ABC.txt, test_26_AB.txt, test_28_ABC.txt, test_29_AB.txt, test_31_ABC.txt, test_32_ABC.txt, test_33_AB.txt, test_35_ABC.txt, test_36_AB.txt, test_38_ABC.txt, test_39_AB.txt, test_41_ABC.txt, test_42_AB.txt, test_44_ABC.txt, test_45_AB.txt, test_47_ABC.txt, test_48_AB.txt, test_50_ABC.txt, test_51_AB.txt, test_53_ABC.txt, test_54_AB.txt
all test_01_ABC.txt, test_02_AB.txt, test_03_A.txt, test_04_ABC.txt, test_05_AB.txt, test_06_A.txt, test_07_ABC.txt, test_08_AB.txt, test_09_A.txt, test_10_ABC.txt, test_11_AB.txt, test_12_A.txt, test_13_ABC.txt, test_14_AB.txt, test_15_A.txt, test_16_ABC.txt, test_17_AB.txt, test_18_A.txt, test_19_ABC.txt, test_20_AB.txt, test_21_A.txt, test_22_ABC.txt, test_23_AB.txt, test_24_A.txt, test_25_ABC.txt, test_26_AB.txt, test_27_A.txt, test_28_ABC.txt, test_29_AB.txt, test_30_A.txt, test_31_ABC.txt, test_32_ABC.txt, test_33_AB.txt, test_34_A.txt, test_35_ABC.txt, test_36_AB.txt, test_37_A.txt, test_38_ABC.txt, test_39_AB.txt, test_40_A.txt, test_41_ABC.txt, test_42_AB.txt, test_43_A.txt, test_44_ABC.txt, test_45_AB.txt, test_46_A.txt, test_47_ABC.txt, test_48_AB.txt, test_49_A.txt, test_50_ABC.txt, test_51_AB.txt, test_52_A.txt, test_53_ABC.txt, test_54_AB.txt, test_55_A.txt
Case Name Status Exec Time Memory
sample_01.txt AC 4 ms 3556 KiB
sample_02.txt AC 3 ms 3476 KiB
sample_03.txt AC 2 ms 3480 KiB
test_01_ABC.txt AC 2 ms 3476 KiB
test_02_AB.txt AC 2 ms 3440 KiB
test_03_A.txt AC 14 ms 3596 KiB
test_04_ABC.txt AC 2 ms 3584 KiB
test_05_AB.txt AC 2 ms 3584 KiB
test_06_A.txt AC 3 ms 3628 KiB
test_07_ABC.txt AC 3 ms 3564 KiB
test_08_AB.txt AC 2 ms 3476 KiB
test_09_A.txt AC 16 ms 3612 KiB
test_10_ABC.txt AC 5 ms 3584 KiB
test_11_AB.txt AC 2 ms 3536 KiB
test_12_A.txt AC 11 ms 3628 KiB
test_13_ABC.txt AC 3 ms 3624 KiB
test_14_AB.txt AC 2 ms 3496 KiB
test_15_A.txt AC 14 ms 3744 KiB
test_16_ABC.txt AC 2 ms 3408 KiB
test_17_AB.txt AC 2 ms 3616 KiB
test_18_A.txt AC 3 ms 3620 KiB
test_19_ABC.txt AC 2 ms 3612 KiB
test_20_AB.txt AC 2 ms 3440 KiB
test_21_A.txt AC 13 ms 3736 KiB
test_22_ABC.txt AC 3 ms 3528 KiB
test_23_AB.txt AC 2 ms 3568 KiB
test_24_A.txt AC 14 ms 3504 KiB
test_25_ABC.txt AC 2 ms 3588 KiB
test_26_AB.txt AC 2 ms 3632 KiB
test_27_A.txt AC 17 ms 3736 KiB
test_28_ABC.txt AC 4 ms 3612 KiB
test_29_AB.txt AC 2 ms 3476 KiB
test_30_A.txt AC 12 ms 3712 KiB
test_31_ABC.txt AC 2 ms 3496 KiB
test_32_ABC.txt AC 2 ms 3584 KiB
test_33_AB.txt AC 2 ms 3412 KiB
test_34_A.txt AC 13 ms 3552 KiB
test_35_ABC.txt AC 2 ms 3628 KiB
test_36_AB.txt AC 2 ms 3416 KiB
test_37_A.txt AC 4 ms 3496 KiB
test_38_ABC.txt AC 2 ms 3556 KiB
test_39_AB.txt AC 2 ms 3632 KiB
test_40_A.txt AC 14 ms 3596 KiB
test_41_ABC.txt AC 2 ms 3608 KiB
test_42_AB.txt AC 2 ms 3520 KiB
test_43_A.txt AC 5 ms 3492 KiB
test_44_ABC.txt AC 2 ms 3532 KiB
test_45_AB.txt AC 2 ms 3612 KiB
test_46_A.txt AC 16 ms 3732 KiB
test_47_ABC.txt AC 2 ms 3624 KiB
test_48_AB.txt AC 2 ms 3592 KiB
test_49_A.txt AC 5 ms 3548 KiB
test_50_ABC.txt AC 2 ms 3496 KiB
test_51_AB.txt AC 2 ms 3476 KiB
test_52_A.txt AC 14 ms 3680 KiB
test_53_ABC.txt AC 1 ms 3584 KiB
test_54_AB.txt AC 2 ms 3500 KiB
test_55_A.txt AC 13 ms 3552 KiB