Submission #200196

#TimeUsernameProblemLanguageResultExecution timeMemory
200196mdn2002Exhibition (JOI19_ho_t2)C++14
100 / 100
71 ms5132 KiB
#include<bits/stdc++.h> using namespace std; const int mod=1e9+7; int n,m,ans; vector<pair<int,int> >a; vector<int>b; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); //freopen("dec.in","r",stdin); //freopen("dec.out","w",stdout); cin>>n>>m; for(int i=0;i<n;i++) { int x,y; cin>>x>>y; a.push_back({y,x}); } for(int i=0;i<m;i++) { int x; cin>>x; b.push_back(x); } sort(a.rbegin(),a.rend()); sort(b.rbegin(),b.rend()); int j=0; for(int i=0;i<m;i++) { if(j<n) { while(a[j].second>b[i]) { j++; if(j==n)break; } } if(j==n)break; ans++; j++; } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...