Submission #164178

#TimeUsernameProblemLanguageResultExecution timeMemory
164178mat_vExhibition (JOI19_ho_t2)C++14
100 / 100
78 ms4544 KiB
#include <bits/stdc++.h> #define xx first #define yy second #define maxn 100005 using namespace std; typedef pair<int,int> pii; int n,m; pii niz[maxn]; int ram[maxn]; int main() { ios_base::sync_with_stdio(false); cin >> n >> m; for(int i=0; i<n; i++)cin >> niz[i].yy >> niz[i].xx; sort(niz, niz + n); for(int i=0; i<m; i++)cin >> ram[i]; sort(ram, ram + m); int br = m-1; int br2 = n-1; int res = 0; while(br >= 0 && br2 >= 0){ if(ram[br] >= niz[br2].yy){ br--; res++; } br2--; } cout << res << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...