이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <algorithm>
#define pii pair<int, int>
#define fst first
#define snd second
using namespace std;
int N, M;
pii A[100001]; int B[100001];
int main()
{
ios :: sync_with_stdio(0); cin.tie(0);
cin >> N >> M;
for (int i = 0; i < N; i++) cin >> A[i].snd >> A[i].fst;
for (int i = 0; i < M; i++) cin >> B[i];
sort(A, A + N, greater<pii>());
sort(B, B + M, greater<int>());
int i = 0, j = 0;
for (i = 0; i < M; i++)
{
for (; j < N; j++)
{
if (A[j].snd <= B[i]) {break;}
}
if (j == N) {break;}
else {j++;}
}
cout << i << "\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... |