이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
const int MAXM = 100010;
int N, M;
pair<int, int> VS[MAXN];
int C[MAXM];
int main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
cin >> N >> M;
for (int i = 0; i < N; i++) {
cin >> VS[i].second >> VS[i].first;
}
for (int i = 0; i < M; i++) {
cin >> C[i];
}
sort(VS, VS + N);
sort(C, C + M);
int ans = 0;
for (int i = N - 1, j = M - 1; i >= 0; i--) {
int v, s; tie(v, s) = VS[i];
if (j >= 0 && s <= C[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... |