# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
951792 | SmuggingSpun | Exhibition (JOI19_ho_t2) | C++14 | 46 ms | 4676 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>
#define taskname "exhibition"
using namespace std;
int main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
if(fopen(taskname".inp", "r")){
freopen(taskname".inp", "r", stdin);
}
int n, m;
cin >> n >> m;
vector<pair<int, int>>a(n);
for(auto& [x, y] : a){
cin >> x >> y;
}
sort(a.begin(), a.end(), [&] (auto i, auto j) -> bool{
return i.second < j.second || (i.second == j.second && i.first < j.first);
});
vector<int>c(m);
for(int& x : c){
cin >> x;
}
sort(c.begin(), c.end(), greater<int>());
int low = 1, high = m, ans = 0;
while(low <= high){
int mid = (low + high) >> 1;
for(int i = mid - 1, p = 0; i > -1; i--){
while(p < n && a[p].first > c[i]){
p++;
}
if(p++ == n){
high = mid - 1;
break;
}
}
if(high != mid - 1){
low = (ans = mid) + 1;
}
}
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... |