이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define size second
#define value first
int N, M;
pair<int,int> picture[100100];
int frame[100100];
int ans;
int main() {
cin >> N >> M;
for(int i=1; i<=N; i++) {
cin >> picture[i].size >> picture[i].value;
}
sort(picture+1, picture+N+1);
for(int i=1; i<=M; i++) {
cin >> frame[i];
}
sort(frame+1, frame+M+1);
int i=N;
int j=M;
while(i>=1 && j>=1) {
if (picture[i].size <= frame[j]) {
ans++;
i--;
j--;
} else {
i--;
}
}
cout << ans << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |