# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
951789 | 2024-03-22T16:08:12 Z | SmuggingSpun | Exhibition (JOI19_ho_t2) | C++14 | 0 ms | 348 KB |
#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; 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){ p++; } else{ high = mid - 1; break; } } if(high != mid - 1){ low = (ans = mid) + 1; } } cout << ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |