제출 #1305241

#제출 시각아이디문제언어결과실행 시간메모리
1305241polishprogrammerExhibition (JOI19_ho_t2)C++20
100 / 100
35 ms1608 KiB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define fi first
#define se second

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, m, x, ind = 0;
    cin >> n >> m;
    vector<pair<int, int>> obr(n);
    vector<int> roz(m);
    for (int i = 0; i < n; i++) cin >> obr[i].se >> obr[i].fi;
    for (int i = 0; i < m; i++) cin >> roz[i];
    sort(obr.rbegin(), obr.rend());
    sort(roz.rbegin(), roz.rend());
    for (pair<int, int> p : obr) if (ind < roz.size() and p.se <= roz[ind]) ind++;
    cout << ind;
}

#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...