Submission #1175484

#TimeUsernameProblemLanguageResultExecution timeMemory
1175484NomioKralj (COCI16_kralj)C++20
56 / 140
286 ms29840 KiB
#include<bits/stdc++.h>
using namespace std;
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	int a[n], p[n], v[n];
	for(int i = 0; i < n; i++) {
		cin >> a[i];
	}
	for(int i = 0; i < n; i++) {
		cin >> p[i];
	}
	multiset<int> s;
	for(int i = 0; i < n; i++) {
		cin >> v[i];
		s.insert(v[i]);
	}
	sort(p, p + n);
	int ans = 0;
	for(int i = 0; i < n; i++) {
		if(*--s.end() > p[i]) {
			ans++;
			int x = *s.lower_bound(p[i]);
			s.erase(s.find(x));
		}
	}
	cout << ans << '\n';
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...