# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
951792 | SmuggingSpun | Exhibition (JOI19_ho_t2) | C++14 | 46 ms | 4676 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
컴파일 시 표준 에러 (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... |