Submission #887993

#TimeUsernameProblemLanguageResultExecution timeMemory
887993amirhoseinfar1385Exhibition (JOI19_ho_t2)C++17
100 / 100
38 ms4696 KiB
#include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n,m; cin>>n>>m; vector<pair<int,int>>alla(n); vector<int>allb(m); for(int i=0;i<n;i++){ cin>>alla[i].second>>alla[i].first; } for(int i=0;i<m;i++){ cin>>allb[i]; } sort(alla.begin(),alla.end()); sort(allb.begin(),allb.end()); int res=0,last=m-1; for(int i=n-1;i>=0;i--){ if(last>=0&&alla[i].second<=allb[last]){ res++; last--; } } cout<<res<<"\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...