제출 #487322

#제출 시각아이디문제언어결과실행 시간메모리
487322JooExhibition (JOI19_ho_t2)C++17
100 / 100
132 ms4392 KiB
#include <bits/stdc++.h>
using namespace std;


int main(void){
    int n,m; cin >> n >> m;
    vector<pair<int,int>> pic(n); 
    vector<int> frame(m);

    for(auto &[a, b] : pic) cin >> b >> a;
    for(int &a : frame) cin >> a;

    sort(pic.begin(), pic.end()), sort(frame.begin(), frame.end());

    int ans = 0;
    for(int i = n-1, j = m-1; i >= 0 and j >= 0; i--){
        if (pic[i].second <= frame[j]){
            ans++;
            j--;
        }
    }
    
    cout << ans << "\n";

    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...