제출 #209202

#제출 시각아이디문제언어결과실행 시간메모리
209202kostia244Exhibition (JOI19_ho_t2)C++17
100 / 100
73 ms2936 KiB
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define pb push_back
using namespace std;
using ll = long long;
using vi = vector<ll>;
using pi = pair<ll, ll>;
const int maxn= 1e5 + 55;
int n, m;
vector<pi> a;
vi b;
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m;
	a.resize(n);
	b.resize(m);
	for(int i = 0; i < n; i++) cin >> a[i].second >> a[i].first;
	for(int i = 0; i < m; i++) cin >> b[i];
	sort(all(a));
	sort(all(b));
	int j = n-1, ans = 0;
	for(int i = m; i--;) {
		while(j>=0&&a[j].second>b[i]) j--;
		if(j<0) break;
		ans++;
		j--;
	}
	cout << ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...