제출 #375987

#제출 시각아이디문제언어결과실행 시간메모리
375987valerikkExhibition (JOI19_ho_t2)C++17
100 / 100
68 ms4604 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    vector<pair<int, int>> p(n);
    for (int i = 0; i < n; ++i)
        cin >> p[i].second >> p[i].first;
    sort(p.begin(), p.end());
    vector<int> c(m);
    for (int i = 0; i < m; ++i)
        cin >> c[i];
    sort(c.begin(), c.end());
    int last = m - 1;
    for (int i = n - 1; i >= 0; --i) {
        if (last >= 0 && p[i].second <= c[last])
            --last;
    }
    cout << m - last - 1 << endl;
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...