# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
99090 | gs14004 | Exhibition (JOI19_ho_t2) | C++17 | 99 ms | 1572 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;
const int MAXN = 300005;
using lint = long long;
using pi = pair<int, int>;
int n, m, c[MAXN];
pi a[MAXN];
int main(){
scanf("%d %d",&n,&m);
for(int i=1; i<=n; i++) scanf("%d %d",&a[i].second,&a[i].first);
sort(a + 1, a + n + 1);
for(int i=1; i<=m; i++) scanf("%d",&c[i]);
sort(c + 1, c + m + 1);
int dap = 0;
int ptr = n;
for(int i=m; i; i--){
while(ptr > 0 && a[ptr].second > c[i]) ptr--;
if(ptr > 0){
ptr--;
dap++;
}
}
cout << dap << endl;
}
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... |