Submission #768117

# Submission time Handle Problem Language Result Execution time Memory
768117 2023-06-27T13:24:11 Z LinkedArray Exhibition (JOI19_ho_t2) C++17
0 / 100
1 ms 212 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(0);
	cin.tie(0);
	
	int n, m, ans, pnt;
	
	cin >> n >> m;
	
	vector<pair<int, int> > picture(n);
    vector<int> frame(m);
    
	for(int i = 0; i < n; i++){
	    cin >> picture[i].first >> picture[i].second;
	}
	for(int i = 0; i < m; i++){
	    cin >> frame[i];
	}
	sort(picture.begin(), picture.end());
	sort(frame.begin(), frame.end());
	ans = 0, pnt = m - 1;
	for(int i = n - 1; i >= 0; i--){
	    if(picture[i].first <= frame[pnt]){ // If it fits in frame
	        ans++;
	        pnt--;
	    }
	}
	cout << ans << "\n";
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 0 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 0 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 0 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -