Submission #167362

#TimeUsernameProblemLanguageResultExecution timeMemory
167362theStaticMindExhibition (JOI19_ho_t2)C++14
100 / 100
87 ms6768 KiB
#include<bits/stdc++.h> #define mp make_pair #define pb push_back #define ii pair<int,int> #define all(x) (x).begin(),(x).end() #define INF 100000000000000000 #define modulo 1000000007 #define mod 998244353 #define int long long int using namespace std; int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); // freopen("q.gir","r",stdin); // freopen("q.cik","w",stdout); int n,m,ans=0; cin>>n>>m; vector<ii>A; vector<int>B; int ind=0; for(int i=0;i<n;i++){ int x,y; cin>>x>>y; A.pb({y,x}); } for(int i=0;i<m;i++){ int x; cin>>x; B.pb(x); } sort(all(A),greater<ii>()); sort(all(B),greater<int>()); for(int i=0;i<m;i++){ while(ind<n){ if(A[ind].second<=B[i])break; else ind++; } if(ind<n)ans++; else break; ind++; } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...