Submission #99172

#TimeUsernameProblemLanguageResultExecution timeMemory
99172dongwon0427Exhibition (JOI19_ho_t2)C++11
100 / 100
97 ms1660 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; int n,m; pii A[100005]; int B[100005]; int main() { ios_base::sync_with_stdio(0); cin.tie(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(B,B+m); sort(A,A+n); int s = 0, e = m; int ans = 0; while(s<=e) { int mid = (s+e)/2; int p = m - mid; for(int i=0;i<n;i++) { if(p < m && A[i].second <= B[p]) p++; } if(p == m) { ans = max(ans, mid); s = mid + 1; } else e = mid - 1; } cout<<ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...