Submission #237010

#TimeUsernameProblemLanguageResultExecution timeMemory
237010priyansh5525Exhibition (JOI19_ho_t2)C++17
100 / 100
66 ms5752 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long int #define pii pair<long long int,long long int> #define vi vector<long long int > #define vvi vector<vector< long long int>> #define MP make_pair #define PB push_back #define pb pop_back #define PF push_front #define pf pop_front #define MOD 1000000007 #define MT make_tuple ll n,m; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin>>n>>m; pii a[n]; ll b[m]; for(ll i=0;i<n;i++) { cin>>a[i].second>>a[i].first; } for(ll i=0;i<m;i++) cin>>b[i]; sort(a,a+n); sort(b,b+m); ll j=n-1; ll ans=0; for(ll i=m-1;i>=0 && j>=0;i--) { while(j>=0 && a[j].second>b[i]) j--; if(j>=0) { ans++; j--; } } cout<<ans<<"\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...