제출 #1124907

#제출 시각아이디문제언어결과실행 시간메모리
1124907njoopExhibition (JOI19_ho_t2)C++17
100 / 100
108 ms1588 KiB
#include <bits/stdc++.h> using namespace std; int n, m, f[100010], p1, p2, ans; pair<int, int> art[100010]; int main() { cin >> n >> m; for(int i=1; i<=n; i++) { cin >> art[i].second >> art[i].first; } for(int i=1; i<=m; i++) { cin >> f[i]; } sort(art+1, art+n+1); sort(f+1, f+m+1); p1 = n; p2 = m; while(p1 >= 1 && p2 >= 1) { if(art[p1].second <= f[p2]) { ans++; p1--; p2--; } else { p1--; } } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...