Submission #1027112

#TimeUsernameProblemLanguageResultExecution timeMemory
1027112giorgi_pkhaladzeExhibition (JOI19_ho_t2)C++14
100 / 100
41 ms5720 KiB
#include <bits/stdc++.h> #define ll long long #define pii pair<int,int> #define pll pair<ll,ll> #define pb push_back #define ff first #define ss second using namespace std; int n,m,k,i,j,ans,a[200005]; pii p[200005]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin>>n>>m; for(k=1; k<=n; k++)cin>>p[k].ss>>p[k].ff; for(k=1; k<=m; k++)cin>>a[k]; sort(p+1,p+1+n); sort(a+1,a+m+1); int pos=m; for(k=n; k>0; k--){ if(p[k].ss<=a[pos])pos--; } ans=m-pos; cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...