제출 #919545

#제출 시각아이디문제언어결과실행 시간메모리
919545iskhakkutbilimExhibition (JOI19_ho_t2)C++17
0 / 100
1 ms348 KiB
#include <bits/stdc++.h>
using namespace std;
 
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
const int mod = 1e9 + 7;
const int N = 1e5;
#define int long long
 
 
 
 
 
 
 
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, m; cin >> n >> m;
	vector< array<int, 2> > a(n);
	for(int i = 0;i < n; i++){
		cin >> a[i][0] >> a[i][1];
	}
	sort(all(a), [&](auto A, auto B){
		return A[1] < B[1];
	});
	vector<int> frame(m);
	for(auto &e : frame) cin >> e; 
	sort(all(frame));
	reverse(all(frame));
	
	
	
	int ans = 0;
	for(int i = 0;i < m; i++){
		while(a.empty() == false && a.back()[0] > frame[i]) a.pop_back();
		if(a.empty()) break;
		ans++;
		a.pop_back();
	}
	cout << ans;
		
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...