Submission #6474532


Source Code Expand

Copy
#include<bits/stdc++.h>
using namespace std;
 
int main()
{
    int n;
    cin >> n;
    vector<int> arr;
    int x;
    cin >> x;
    arr.push_back(x);
    for (int i = 1; i != n; ++i)
    {
        cin >> x;
        if (arr.back() <= x)
            arr.push_back(x);
        else
        {
            int l = -1, r = arr.size() - 1;
            while (r - l != 1)
                ((arr[l + r >> 1] <= x) ? l : r) = l + r >> 1;
            arr[r] = min(arr[r], x);
        }
    }
    cout << arr.size();
}

Submission Info

Submission Time
Task E - Sequence Decomposing
User keima915
Language C++14 (GCC 5.4.1)
Score 0
Code Size 533 Byte
Status WA
Exec Time 46 ms
Memory 892 KB

Judge Result

Set Name All Sample
Score / Max Score 0 / 500 0 / 0
Status
AC × 2
WA × 33
AC × 1
WA × 1
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 44 ms 892 KB
killer_01 WA 40 ms 256 KB
killer_02 WA 38 ms 256 KB
killer_03 WA 40 ms 256 KB
killer_04 WA 42 ms 256 KB
killer_05 WA 43 ms 256 KB
many_dup_01 WA 42 ms 256 KB
many_dup_02 WA 42 ms 256 KB
many_dup_03 WA 42 ms 256 KB
many_dup_04 WA 44 ms 256 KB
many_dup_05 WA 45 ms 256 KB
many_dup_06 WA 41 ms 256 KB
many_dup_07 WA 45 ms 432 KB
many_dup_08 WA 45 ms 512 KB
many_dup_09 WA 41 ms 512 KB
many_dup_10 WA 44 ms 640 KB
many_dup_11 WA 46 ms 640 KB
many_dup_12 WA 41 ms 512 KB
rand_max_01 WA 42 ms 256 KB
rand_max_02 WA 41 ms 256 KB
rand_max_03 WA 40 ms 256 KB
rand_max_04 WA 41 ms 256 KB
rand_max_05 WA 40 ms 256 KB
rand_max_06 WA 41 ms 256 KB
rand_max_07 WA 41 ms 256 KB
rand_max_08 WA 42 ms 256 KB
rand_max_09 WA 40 ms 256 KB
rand_max_10 WA 43 ms 256 KB
rand_max_11 WA 40 ms 256 KB
sample_01 WA 1 ms 256 KB
sample_02 AC 1 ms 256 KB
sorted_ascending WA 28 ms 892 KB
sorted_descending WA 28 ms 256 KB
unique_perm_01 WA 30 ms 256 KB
unique_perm_02 WA 30 ms 256 KB