이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main(void){
int n,m; cin >> n >> m;
vector<pair<int,int>> pic(n);
vector<int> frame(m);
for(auto &[a, b] : pic) cin >> b >> a;
for(int &a : frame) cin >> a;
sort(pic.begin(), pic.end()), sort(frame.begin(), frame.end());
int ans = 0;
for(int i = n-1, j = m-1; i >= 0 and j >= 0; i--){
if (pic[i].second <= frame[j]){
ans++;
j--;
}
}
cout << ans << "\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... |