Submission #1291249

#TimeUsernameProblemLanguageResultExecution timeMemory
1291249blackscreen1Exhibition (JOI19_ho_t2)C++20
100 / 100
38 ms2792 KiB
#include <bits//stdc++.h>
using namespace std;
#define ll long long
#define iloop(m, h) for (auto i = m; i != h; i += (m<h?1:-1))
#define jloop(m, h) for (auto j = m; j != h; j += (m<h?1:-1))
#define pll pair<ll, ll>
#define INF 1000000000000000
int main() {
	ios_base::sync_with_stdio(false); 
	cin.tie(0);
	ll n, m;
	cin >> n >> m;
	pll v[n];
	ll a[m];
	iloop(0, n) cin >> v[i].second >> v[i].first;
	sort(v, v+n, greater<pll>());
	iloop(0, m) cin >> a[i];
	sort(a, a+m, greater<ll>());
	ll ans = 0;
	iloop(0, n) {
		if (v[i].second <= a[ans]) ans++;
		if (ans == m) break;
	}
	cout << ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...