This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/**
__author__ : FireGhost
problems_ID: JOI19_ho_t2
*/
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) x.begin(), x.end()
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
const int N = 1e5 + 3;
const int MOD = 1e9 + 7;
int n, m;
vector<int> c;
vector<pii> a;
void solve() {
cin >> n >> m;
a.resize(n), c.resize(m);
for (int i = 0; i < n; ++i)
cin >> a[i].se >> a[i].fi;
for (int i = 0; i < m; ++i)
cin >> c[i];
sort(a.rbegin(), a.rend());
sort(c.rbegin(), c.rend());
int j = 0;
for (int i = 0; i < n && j < m; ++i) {
if (a[i].se > c[j]) continue;
++j;
}
cout << j;
}
int main() {
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int t = 1;
while (t--)
solve();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |