230962026-01-16 11:58:36MagyarKendeSZLGKártyajátékcpp17Accepted 30/3032ms4016 KiB
#include <bits/stdc++.h>
using namespace std;
#define int int64_t

int32_t main() {
    cin.tie(0), ios::sync_with_stdio(0);
    int n;
    cin >> n >> n;
    vector<int> a(n), b;
    for (int& x : a) cin >> x;
    vector<bool> point(n);
    for (int i = 0; i < n; i++) {
        if (b.empty() || b.back() <= a[i]) {
            b.push_back(a[i]);
        } else {
            int j = upper_bound(b.begin(), b.end(), a[i]) -
                    b.begin();
            point[j] = 1;
        }
    }
    int result = 0;
    for (int i = 0; i < n; i++) result += point[i];
    cout << result << "\n";
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/01ms500 KiB
2Accepted0/032ms3636 KiB
3Accepted1/11ms508 KiB
4Accepted1/11ms316 KiB
5Accepted1/11ms316 KiB
6Accepted2/21ms316 KiB
7Accepted2/21ms316 KiB
8Accepted2/21ms316 KiB
9Accepted1/114ms988 KiB
10Accepted2/221ms1708 KiB
11Accepted3/318ms1856 KiB
12Accepted3/319ms1716 KiB
13Accepted1/132ms3088 KiB
14Accepted2/232ms3396 KiB
15Accepted3/330ms4016 KiB
16Accepted3/332ms3512 KiB
17Accepted3/332ms3636 KiB