Language: C++

/* ----------------------------
 * ABC 91 C
 * ---------------------------- */
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;

using point pair<int, int>;
int main(){
	int n;
	cin >> n;
	vector<point> a;
	vector<point> b;
	for(int i = 0; i < n; i++){
		int x, y;
		cin >> x >> y;
		a.push_back({x, y});
	}
	for(int i = 0; i < n; i++){
		int x, y;
		cin >> x >> y;
		b.push_back({x, y});
	}
	int ans = 0;
	auto x_sorter = [](point a, point b) -> bool {
		return a.first < b.first;
	};
	auto y_sorter = [](point a, point b) -> bool {
		return a.second < b.second;
	};
	// a, b を x座標で昇順にソート
	sort(a.begin(), a.end(), x_sorter);
	sort(b.begin(), b.end(), x_sorter);
	
	for(auto p: b){
		int target = -1;
		int max_y = -1;
		for(int i = 0; i < a.size(); i++){
			if(a[i].x >= p.x) break;
			if(a[i].y >= p.y) continue;
			int before = max_y;
			max_y = max(max_y, a[i].y);
			if(before != max_y) target = i;
		}
		if(target == -1) continue;
		a.erase(a.begin() + target);
		++ans;
	}
	cout << ans << endl;
	return 0;
}



Compiler output:
a.cc:10:7: error: expected nested-name-specifier before 'point'
   10 | using point pair<int, int>;
      |       ^~~~~
a.cc: In function 'int main()':
a.cc:14:16: error: 'point' was not declared in this scope
   14 |         vector<point> a;
      |                ^~~~~
a.cc:14:21: error: template argument 1 is invalid
   14 |         vector<point> a;
      |                     ^
a.cc:14:21: error: template argument 2 is invalid
a.cc:15:21: error: template argument 2 is invalid
   15 |         vector<point> b;
      |                     ^
a.cc:19:19: error: request for member 'push_back' in 'a', which is of non-class type 'int'
   19 |                 a.push_back({x, y});
      |                   ^~~~~~~~~
a.cc:24:19: error: request for member 'push_back' in 'b', which is of non-class type 'int'
   24 |                 b.push_back({x, y});
      |                   ^~~~~~~~~
a.cc:27:28: error: 'point' is not a type
   27 |         auto x_sorter = [](point a, point b) -> bool {
      |                            ^~~~~
a.cc:27:37: error: 'point' is not a type
   27 |         auto x_sorter = [](point a, point b) -> bool {
      |                                     ^~~~~
a.cc: In lambda function:
a.cc:28:26: error: request for member 'first' in 'a', which is of non-class type 'int'
   28 |                 return a.first < b.first;
      |                          ^~~~~
a.cc:28:36: error: request for member 'first' in 'b', which is of non-class type 'int'
   28 |                 return a.first < b.first;
      |                                    ^~~~~
a.cc: In function 'int main()':
a.cc:30:28: error: 'point' is not a type
   30 |         auto y_sorter = [](point a, point b) -> bool {
      |                            ^~~~~
a.cc:30:37: error: 'point' is not a type
   30 |         auto y_sorter = [](point a, point b) -> bool {
      |                                     ^~~~~
a.cc: In lambda function:
a.cc:31:26: error: request for member 'second' in 'a', which is of non-class type 'int'
   31 |                 return a.second < b.second;
      |                          ^~~~~~
a.cc:31:37: error: request for member 'second' in 'b', which is of non-class type 'int'
   31 |                 return a.second < b.second;
      |                                     ^~~~~~
a.cc: In function 'int main()':
a.cc:34:16: error: request for member 'begin' in 'a', which is of non-class type 'int'
   34 |         sort(a.begin(), a.end(), x_sorter);
      |                ^~~~~
a.cc:34:27: error: request for member 'end' in 'a', which is of non-class type 'int'
   34 |         sort(a.begin(), a.end(), x_sorter);
      |                           ^~~
a.cc:35:16: error: request for member 'begin' in 'b', which is of non-class type 'int'
   35 |         sort(b.begin(), b.end(), x_sorter);
      |                ^~~~~
a.cc:35:27: error: request for member 'end' in 'b', which is of non-class type 'int'
   35 |         sort(b.begin(), b.end(), x_sorter);
      |                           ^~~
a.cc:37:21: error: 'begin' was not declared in this scope; did you mean 'std::begin'?
   37 |         for(auto p: b){
      |                     ^
      |                     std::begin
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:4:
/usr/include/c++/14/bits/range_access.h:114:37: note: 'std::begin' declared here
  114 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept;
      |                                     ^~~~~
a.cc:37:21: error: 'end' was not declared in this scope; did you mean 'std::end'?
   37 |         for(auto p: b){
      |                     ^
      |                     std::end
/usr/include/c++/14/bits/range_access.h:116:37: note: 'std::end' declared here
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
a.cc:40:38: error: request for member 'size' in 'a', which is of non-class type 'int'
   40 |                 for(int i = 0; i < a.size(); i++){
      |                                      ^~~~
a.cc:41:29: error: invalid types 'int[int]' for array subscript
   41 |                         if(a[i].x >= p.x) break;
      |                             ^
a.cc:42:29: error: invalid types 'int[int]' for array subscript
   42 |                         if(a[i].y >= p.y) continue;
      |                             ^
a.cc:44:45: error: invalid types 'int[int]' for array subscript
   44 |                         max_y = max(max_y, a[i].y);
      |                                             ^
a.cc:48:19: error: request for member 'erase' in 'a', which is of non-class type 'int'
   48 |                 a.erase(a.begin() + target);
      |                   ^~~~~
a.cc:48:27: error: request for member 'begin' in 'a', which is of non-class type 'int'
   48 |                 a.erase(a.begin() + target);
      |                           ^~~~~