제출 #721012

#제출 시각아이디문제언어결과실행 시간메모리
721012pccExhibition (JOI19_ho_t2)C++14
100 / 100
594 ms10248 KiB
#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) 메시지

joi2019_ho_t2.cpp:31:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   31 | main(){
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...