# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
562504 | dattranxxx | Exhibition (JOI19_ho_t2) | C++11 | 51 ms | 4428 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void file() {
const string FILE_NAME = "FILE_NAME";
freopen((FILE_NAME + ".inp").c_str(), "r", stdin);
freopen((FILE_NAME + ".out").c_str(), "w", stdout);
}
const int N = 1e5 + 5;
pair<int, int> a[N];
int b[N];
int n, m;
int check(int k) {
for (int i = m-k, j = 0; i < m; ++i, ++j) {
while (j < n && a[j].second > b[i]) j++;
if (j == n) return 0;
}
return 1;
}
int main() {
cin.tie(0)->sync_with_stdio(0); cout.tie(0);
cin >> n >> m;
for (int i = 0; i < n; ++i)
cin >> a[i].second >> a[i].first;
for (int i = 0; i < m; ++i)
cin >> b[i];
sort(a, a + n);
sort(b, b + m);
int lo = 0, hi = min(n, m), mid, ans = 0;
while (lo <= hi) {
mid = (lo + hi) >> 1;
if (check(mid))
ans = mid,
lo = mid + 1;
else
hi = mid - 1;
}
cout << ans;
return 0;
}
컴파일 시 표준 에러 (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... |