Submission #1091729

# Submission time Handle Problem Language Result Execution time Memory
1091729 2024-09-22T01:03:21 Z BlueGlaucus1 Exhibition (JOI19_ho_t2) C++17
0 / 100
1 ms 348 KB
#include <iostream>
#include <algorithm>
using namespace std;

int main(){
    int n,m; cin >> n >> m;
    pair<int, int> paint[n];
    int frame[m];
    for(int i =0; i <n;i++){
        cin >> paint[i].second >> paint[i].first;
    }
    for(int i = 0; i <m;i++){
        cin >> frame[i];
    }
    sort(paint, paint+n);
    sort(frame, frame+m);
    int frame_ind = 0;
    int answer = 0;
    for(int i = 0; i <n;i++){
        int size = paint[i].second;
        while(frame_ind < m && frame[frame_ind] < size){
            frame_ind++;
        }
        if(frame_ind>=m){
            cout << answer <<'\n';
            return 0;
        }
        frame_ind+=1;
        answer +=1;
    }
    cout << answer <<'\n';
    return 0 ;

}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -