답안 #768113

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
768113 2023-06-27T13:18:58 Z LinkedArray Exhibition (JOI19_ho_t2) C++17
0 / 100
1 ms 340 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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Incorrect 1 ms 320 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Incorrect 1 ms 320 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Incorrect 1 ms 320 KB Output isn't correct
6 Halted 0 ms 0 KB -