이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define ppb pop_back
#define eb emplace_back
typedef long double ld;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
int N, M, O, S[100005], V[100005], C[100005];
pair<int, int> T[100005];
main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> N >> M;
for (int i = 1; i <= N; i++) {
cin >> S[i] >> V[i];
T[i] = mp(V[i], S[i]);
}
for (int i = 1; i <= M; i++) cin >> C[i];
sort(C + 1, C + 1 + M, greater<int>());
sort(T + 1, T + 1 + N);
for (int i = 1; i <= N; i++)
tie(V[i], S[i]) = T[i];
for (int i = N, idx = 1; i >= 1; i--) {
while (idx <= M && C[idx] < S[i]) idx++;
if (idx > M) break;
O++;
idx++;
}
cout << O << '\n';
}
컴파일 시 표준 에러 (stderr) 메시지
joi2019_ho_t2.cpp:18:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
main() {
^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |