Submission #1127219

#TimeUsernameProblemLanguageResultExecution timeMemory
1127219khangrlExhibition (JOI19_ho_t2)C++20
100 / 100
98 ms3768 KiB
#include<bits/stdc++.h> #define ff first #define ss second #define pb push_back #define int long long using namespace std; signed main(){ vector <int> v1; vector <pair <int, int> > v; int n, m; cin>>n>>m; for(int i=1; i<=n; i++){ int a, b; cin>>a>>b; v.pb({b, a}); } for(int i=1; i<=m; i++){ int a; cin>>a; v1.pb(a); } sort(v1.begin(), v1.end()); sort(v.begin(), v.end()); int ans=0, j=m-1; for(int i=n-1; i>=0; i--){ if(v[i].ss<=v1[j]){ ans++; j--; } if(j==-1){ break; } } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...