Submission #953454

#TimeUsernameProblemLanguageResultExecution timeMemory
953454irmuunExhibition (JOI19_ho_t2)C++17
100 / 100
42 ms6096 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define ff first #define ss second #define all(s) s.begin(),s.end() #define rall(s) s.rbegin(),s.rend() int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); ll n,m; cin>>n>>m; pair<ll,ll>pr[n+5]; for(ll i=1;i<=n;i++){ cin>>pr[i].ss>>pr[i].ff; } ll c[m+5]; for(ll i=1;i<=m;i++){ cin>>c[i]; } sort(pr+1,pr+n+1); sort(c+1,c+m+1); ll ans=0,cur=m; for(ll i=n;i>=1;i--){ if(cur>=1&&c[cur]>=pr[i].ss){ ans++; cur--; } } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...