# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
293415 | BeanZ | Exhibition (JOI19_ho_t2) | C++14 | 56 ms | 5632 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 endl '\n'
const int N = 1e5 + 5;
pair<ll, ll> a[N];
ll b[N];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
if (fopen("balance.in", "r")){
freopen("balance.in", "r", stdin);
freopen("balance.out", "w", stdout);
}
ll n, m;
cin >> n >> m;
for (int i = 1; i <= n; i++){
ll s, v;
cin >> s >> v;
a[i] = {v, s};
}
sort(a + 1, a + n + 1);
for (int i = 1; i <= m; i++) cin >> b[i];
sort(b + 1, b + m + 1);
ll now = m;
ll ans = 0;
for (int i = n; i >= 1; i--){
if (a[i].second <= b[now]){
ans++;
now--;
}
}
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... |