Submission #889674

#TimeUsernameProblemLanguageResultExecution timeMemory
889674Marco_EscandonExhibition (JOI19_ho_t2)C++11
100 / 100
127 ms7084 KiB
#include<bits/stdc++.h> using namespace std; #define optimizar_io ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);cout.setf(ios::fixed);cout.precision(15); #pragma GCC optimize("Ofast") typedef long long ll; int main() { ll n,m; cin>>n>>m; priority_queue<pair<ll,ll>> q1; priority_queue<ll> q2; for(int i=0; i<n; i++) { ll a,b; cin>>a>>b; q1.push({b,a}); } for(int i=0; i<m; i++) { ll a; cin>>a; q2.push(a); } ll cont=0; while(!q2.empty()) { while(q1.top().second>q2.top()&&q1.size()>0) { q1.pop(); } if(q1.size()!=0) { q1.pop(); cont++; } q2.pop(); } cout<<cont; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...