题目链接:​​传送门​

用最大的画框配最大的画
显然是最优的
那么挨个匹配就行

#include <bits/stdc++.h>
#define

using namespace std;
typedef long long ll;
pair<int, int> a[A];
int b[A], n, m, ans;

int main(int argc, char const *argv[]) {
cin >> n >> m;
for (int i = 1; i <= n; i++) scanf("%d%d", &a[i].second, &a[i].first);
for (int i = 1; i <= m; i++) scanf("%d", &b[i]);
sort(a + 1, a + n + 1); sort(b + 1, b + m + 1);
for (int i = n, j = m; i and j; i--)
if (b[j] >= a[i].second) ans++, j--;
cout << ans << endl;
}