# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
106199 | Hideo | Exhibition (JOI19_ho_t2) | C++14 | 109 ms | 4716 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mk make_pair
#define fr first
#define sc second
#define vi vector < int >
#define vl vector < ll >
#define pi pair < int, int >
#define pii pair < int, pi >
#define vii vector < pi >
const int N = 1e5 + 7;
const int INF = 1e9 + 7;
int c[N];
int n, m, ans;
priority_queue < pi > pq;
main(){
cin >> n >> m;
for (int i = 1; i <= n; i++){
int a, b;
scanf("%d%d", &a, &b);
pq.push(mk(b, a));
}
for (int i = 1; i <= m; i++)
scanf("%d", &c[i]);
sort(c + 1, c + m + 1);
int it = m;
while (it > 0 && !pq.empty()){
if (pq.top().sc <= c[it]){
it--;
ans++;
}
pq.pop();
}
cout << ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |