Submission #1165557

#TimeUsernameProblemLanguageResultExecution timeMemory
1165557TsaganaExhibition (JOI19_ho_t2)C++20
0 / 100
0 ms324 KiB
#include<bits/stdc++.h>

#define IOS ios_base::sync_with_stdio(false);cin.tie();cout.tie();
#define all(x) x.begin(), x.end()
#define int long long
#define pq priority_queue
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define pp pop_back
#define F first
#define S second

using namespace std;

void solve () {
	int n, m; cin >> n >> m;

	vector<pair<int, int>> v(n);
	vector<int> c(m);

	for (auto &i: v) cin >> i.S >> i.F;
	for (int &i: c) cin >> i;

	sort(v.rbegin(), v.rend());
	sort(c.rbegin(), c.rend());
	c.pb(-1);

	int j = 0;
	for (int i = 0; i < n; i++)
		if (v[i].F <= c[j]) j++;
	cout << j << '\n';
}
signed main() {IOS solve(); return 0;}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...