Submission #1321587

#TimeUsernameProblemLanguageResultExecution timeMemory
1321587michael12Exhibition (JOI19_ho_t2)C++20
100 / 100
125 ms1572 KiB
#include<bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
using namespace std;
const int md = 1e9 + 7;
const int maxn = 5e5;
signed main(){
    int n, m;
    cin >> n >> m;
    vector<array<int, 2>> T(n);
    for(int i = 0; i < n; i++){
        cin >> T[i][1] >> T[i][0]; 
    }
    vector<int> Q(m);
    for(int i = 0; i < m; i++){
        cin >> Q[i];
    }
    sort(T.rbegin(), T.rend());
    sort(Q.rbegin(), Q.rend());
    int j = 0;
    for(int i = 0; i < n; i++){
        if(T[i][1] <= Q[j]){
            j += 1;
        }
    }
    cout << j;

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