이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
pair<int, int> paint[n + 1];
int frame[m + 1];
for (int i = 1; i <= n; i++) {
cin >> paint[i].second >> paint[i].first;
}
for (int i = 1; i <= m; i++) {
cin >> frame[i];
}
sort(paint + 1, paint + n + 1);
sort(frame + 1, frame + m + 1);
int paint_i = n;
int answer = 0;
for (int i = m; i >= 1; i--) {
int size = frame[i];
while (paint_i >= 1 && paint[paint_i].second > size) {
paint_i--;
}
if (paint_i < 1) {
cout << answer << '\n';
return 0;
}
paint_i--;
answer++;
}
cout << answer << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |