# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1151007 | nguyn | Exhibition (JOI19_ho_t2) | C++20 | 51 ms | 1608 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define F first
#define S second
#define pb push_back
#define pii pair<int,int>
const int N = 1e5 + 5;
int n, m;
pii a[N];
int b[N];
signed main(){
ios_base::sync_with_stdio(false) ;
cin.tie(0) ; cout.tie(0) ;
if (fopen("INP.INP" ,"r")) {
freopen("INP.INP" ,"r" , stdin) ;
freopen("OUT.OUT" , "w" , stdout) ;
}
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> a[i].S >> a[i].F;
}
sort(a + 1, a + 1 + n);
for (int i = 1; i <= m; i++) {
cin >> b[i];
}
sort(b + 1, b + 1 + m);
int j = m;
for (int i = n; i >= 1; i--) {
if (j && a[i].S <= b[j]) {
j--;
}
}
cout << m - j;
}
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... |