/**
____ ____ ____ ____ ____
||a |||t |||o |||d |||o ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N_MAX = 100000;
const int M_MAX = 100000;
int N, M;
struct Artwork {
int dim, val;
};
operator < (const Artwork &a, const Artwork &b) {
return make_pair(a.val, a.dim) < make_pair(b.val, b.dim);
}
Artwork art[N_MAX + 2];
int frame[M_MAX + 2];
int minf[N_MAX + 2];
int Fen[M_MAX + N_MAX + 2];
void update (int pos, int val) {
pos += N;
for (int i = pos; i <= M + N; i += i & -i) {
Fen[i] = max(Fen[i], val);
}
}
int query (int pos) {
int val = 0;
for (int i = pos; i >= 1; i -= i & -i) {
val = max(val, Fen[i]);
}
return val;
}
int main () {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> N >> M;
for (int i = 1; i <= N; i++) {
cin >> art[i].dim >> art[i].val;
}
for (int i = 1; i <= M; i++) {
cin >> frame[i];
}
sort(art + 1, art + N + 1);
sort(frame + 1, frame + M + 1);
int answer = 0;
for (int i = N, curr = M; i >= 1 && curr >= 1; i--) {
if (frame[curr] >= art[i].dim) {
answer++;
curr--;
}
}
cout << answer << "\n";
return 0;
}
Compilation message
joi2019_ho_t2.cpp:23:1: error: ISO C++ forbids declaration of 'operator<' with no type [-fpermissive]
23 | operator < (const Artwork &a, const Artwork &b) {
| ^~~~~~~~