This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define all(i) (i).begin(), (i).end()
using namespace std;
template<typename T1, typename ...T2>
void debug(bool _split, T1 i, T2 ...j) {
if (_split)
cerr << ", ";
cerr << i;
debug(true, j...);
}
#define debug(args...) cout << "Line" << __LINE__ << " : [" << #args << << "] is [" << debug(false, args) << "]" << endl;
typedef pair<int, int> pi;
typedef long long ll;
const int inf = 0x3f3f3f3f, lg = 20;
const ll mod = 1e9 + 7, INF = 0x3f3f3f3f;
signed main() {
ios::sync_with_stdio(0), cin.tie(0);
int n, m;
cin >> n >> m;
pi a[n];
for (pi &i : a)
cin >> i.first >> i.second;
sort(a, a + n, [](pi i, pi j) {
if (i.second != j.second)
return i.second > j.second;
return i.first > j.first;
});
int b[m];
for (int &i : b)
cin >> i;
sort(b, b + m, [](int i, int j) {return i > j;});
int tmp = 0;
for (auto [x, y] : a) {
if (tmp < m && b[tmp] >= x)
++tmp;
}
cout << tmp;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |