Submission #799699

#TimeUsernameProblemLanguageResultExecution timeMemory
799699AlkaratExhibition (JOI19_ho_t2)C++14
100 / 100
44 ms4432 KiB
#include <bits/stdc++.h> #define ll long long #define f first #define s second const int N=1e5+10; using namespace std; int n,m,sz[N]; pair<int,int>a[N]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>n>>m; for(int i=1; i<=n; i++) cin>>a[i].s>>a[i].f; for(int i=1; i<=m; i++) cin>>sz[i]; sort(a+1,a+n+1); sort(sz+1,sz+m+1,greater<int>()); int run=n,kq=0; for(int i=1; i<=m; i++) { while(run>0&&a[run].s>sz[i]) run--; if(!run) return cout<<kq,0; run--; kq++; } cout<<kq; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...