# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
721012 | pcc | Exhibition (JOI19_ho_t2) | C++14 | 594 ms | 10248 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int ll
#define pll pair<ll,ll>
#define fs first
#define sc second
const ll mxn = 1e5+10;
ll n,m;
pll arr[mxn];
ll brr[mxn];
bool f(ll k){
multiset<ll> st;
int p = 0;
int pre = 0;
for(int i = m-k;i<m;i++){
while(p<n&&arr[p].fs<=brr[i]){
st.insert(arr[p].sc);
p++;
}
auto it = st.lower_bound(pre);
if(it == st.end())return false;
pre = *it;
st.erase(st.find(*it));
}
return true;
}
main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>>n>>m;
for(int i = 0;i<n;i++)cin>>arr[i].fs>>arr[i].sc;
for(int i = 0;i<m;i++)cin>>brr[i];
sort(arr,arr+n);
sort(brr,brr+m);
int l = 0,r = m;
while(l != r){
int mid = (l+r+1)>>1;
if(f(mid))l = mid;
else r = mid-1;
}
cout<<l;
}
컴파일 시 표준 에러 (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... |