| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1307505 | ikkyu | Exhibition (JOI19_ho_t2) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#define int long long
using namespace std;
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].second >> obr[i].first;
for (int i = 0; i < m; i++) cin >> roz[i];
sort(obr.begin(),obr.end());
sort(roz.begin(),roz.end());
for (pair<int, int> p : obr) if (ind < roz.size() and p.second <= roz[ind]) ind++;
cout << ind;
}
