criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

int main(){
  int N;
  cin >> N;
  vector<pair<int, int>> red(N);
  vector<pair<int, int>> blue(N);
  for(int i = 0; i < N; i++){
    int x, y;
    cin >> x >> y;
    red[i] = make_pair(x, y);
  }
  for(int i = 0; i < N; i++){
    int x, y;
    cin >> x >> y;
    blue[i] = make_pair(x, y);
  }
  vector<bool> is_ckecked(N, false);
  sort(red.begin(), red.end());
  sort(blue.begin(), blue.end());
  int cnt = 0;
  for(int i = 0; i < N; i++){
    for(int j = 0; j < N; j++){
      if(red[j].first < blue[i].first && red[j].second < blue[i].second && !is_checked[j]){
        int maxk = 0;
        int maxr = 0;
        for(int k = j; k < N; k++){
          if(red[k].second > maxr) maxk = k;
        }
        is_checked[maxk] = true;
        cnt++;
      }else{
        is_checked[j] = true;
      }
    }
  }
  cout << cnt;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:77: error: 'is_checked' was not declared in this scope; did you mean 'is_ckecked'?
   29 |       if(red[j].first < blue[i].first && red[j].second < blue[i].second && !is_checked[j]){
      |                                                                             ^~~~~~~~~~
      |                                                                             is_ckecked
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

bool first_less(pair<int,int> l, pair<int,int> r){
  if(l.first == r.first) return l.second > r.second;
  else return l.first > r.first;
  
}

bool second_less(pair<int,int> l, pair<int,int> r){
  if(l.second == r.second) return l.first > r.first;
  else return l.second > r.second;
}

int main(){
  int N;
  cin >> N;
  vector<pair<int, int>> B(N);
  vector<pair<int, int>> R(N);
  vector<bool> checked_x(N,false);
  vector<bool> checked_y(N,false);
  for(int i = 0; i < N; i++){
    int x, y;
    cin >> x >> y;
    B[i] = make_pair(x,y);
  }
  for(int i = 0; i < N; i++){
    int x, y;
    cin >> x >> y;
    R[i] = make_pair(x,y);
  }
  int tmp_x = 0;
  sort(B.begin(),B.end(),first_greater);
  sort(R.begin(),R.end(),first_greater);
  for(int i = 0; i < N; i++){
    for(int j = 1; j < N; j++){
      if(B[i].first < R[j].first && B[i].second < R[j].second && !checked_x[j-1]){
        tmp_x++;
        checked_x[j-1] = true;
        break;
      }
    }
  } 
  int tmp_y = 0;
  sort(B.begin(),B.end(),second_greater);
  sort(R.begin(),R.end(),second_greater);
  for(int i = 0; i < N; i++){
    for(int j = 1; j < N; j++){
      if(B[i].first < R[j].first && B[i].second < R[j].second && !checked_y[j-1]){
        tmp_y++;
        checked_y[j-1] = true;
        break;
      }
    }
  }
  cout << min(tmp_x,tmp_y);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:26: error: 'first_greater' was not declared in this scope
   37 |   sort(B.begin(),B.end(),first_greater);
      |                          ^~~~~~~~~~~~~
a.cc:49:26: error: 'second_greater' was not declared in this scope
   49 |   sort(B.begin(),B.end(),second_greater);
      |                          ^~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

bool first_greater(pair<int,int> l, pair<int,int> r){
  return l.first > r.first;
}

bool second_greater(pair<int,int> l, pair<int,int> r){
  return l.second > r.second;
}

int main(){
  int N;
  cin >> N;
  vector<pair<int, int>> B(N);
  vector<pair<int, int>> R(N);
  vector<bool> cheked(N,false);
  for(int i = 0; i < N; i++){
    int x, y;
    cin >> x >> y;
    B[i] = make_pair(x,y);
  }
  for(int i = 0; i < N; i++){
    int x, y;
    cin >> x >> y;
    R[i] = make_pair(x,y);
  }
  int tmp_x = 0;
  sort(B.begin(),B.end(),first_greater);
  sort(R.begin(),R.end(),first_greater);
  for(int i = 0; i < N; i++){
    for(int j = 0; j < N; j++){
      if(B[i].first < R[j].first && B[i].second < R[j].second && !checked[j]){
        tmp_x++;
        checked[j] = true;
        break;
      }
    }
  }
  cout << tmp_x;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:67: error: 'checked' was not declared in this scope; did you mean 'cheked'?
   37 |       if(B[i].first < R[j].first && B[i].second < R[j].second && !checked[j]){
      |                                                                   ^~~~~~~
      |                                                                   cheked
Language: C++

N = int(input())

alist = []
blist = []
for _ in range(N):
    a, b = map(int, input().split())
    alist.append((a, b))

for _ in range(N):
    c, d = map(int, input().split())
    blist.append((c, d))

alist.sort(reverse=1)
blist.sort()
ans = 0
for i in range(N):
    for j in range(len(alist)):
        if blist[i][0] > alist[j][0] and blist[i][1] > alist[j][0]:
            ans += 1
            alist = alist[:j] + alist[j:]
            break

print(ans)


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#define repp(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define repm(i,a,b) for(int i=(int)a;i>(int)b;--i)
using ll=long long;
static const ll mod = 1e9 + 7;
static const ll INF = 1LL << 50;
using namespace std;

int main() {
	int n;
	cin >> n;
	vector<pair<int, int>>pr(n),pb(n);
	int a, b,ans=0;
	vector<bool>flagr(n),flagb(n);
	repp(i, 0, n) {
		flagr[i] = true;
		flagb[i]= true;
	}
	repp(i, 0, n) {
		cin >> a >> b;
		pr[i] = make_pair(b,a);
	}
	repp(i, 0, n) {
		cin >> a >> b;
		pb[i] = make_pair(a, b);
	}
	sort(pr.begin(), pr.end()); reverse(pr.begin(), pr.end());
	sort(pb.begin(), pb.end());
	repp(i, 0, n)swap(pr[i].first, pr[i].second);
	repp(i, 0, n)repp(j, 0, n) {
		if (pr[i].first < pb[j].first && pr1[i].second < pb1[j].second && flagr[i] == true && flagb[j] == true) {
			++ans;
			flagr[i] = false; flagb[j] = false;
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:50: error: 'pr1' was not declared in this scope; did you mean 'pr'?
   41 |                 if (pr[i].first < pb[j].first && pr1[i].second < pb1[j].second && flagr[i] == true && flagb[j] == true) {
      |                                                  ^~~
      |                                                  pr
a.cc:41:66: error: 'pb1' was not declared in this scope; did you mean 'pb'?
   41 |                 if (pr[i].first < pb[j].first && pr1[i].second < pb1[j].second && flagr[i] == true && flagb[j] == true) {
      |                                                                  ^~~
      |                                                                  pb
Language: C++

#include <bits/stdc++.h>
using namespace std;

struct BipartiteMatching {
  vector<vector<int>> graph;
  vector<int> match, alive, used;  int timestamp;

  BipartiteMatching(int n){
    graph=vector<vector<int>>(n);
    alive=vector<int>(n,1);
    used=vector<int>(n,0);
    match=vector<int>(n,-1);
    timestamp=0;
  }

  void add_edge(int u, int v) {
    graph[u].push_back(v);
    graph[v].push_back(u);
  }

  bool dfs(int idx) {
    used[idx] = timestamp;
    for(auto &to : graph[idx]) {
      int to_match = match[to];
      if(alive[to] == 0) continue;
      if(to_match==-1 || (used[to_match]!=timestamp && dfs(to_match))) {
        match[idx]=to;  match[to]=idx;
        return true;
      }
    }
    return false;
  }

  int bipartite_matching() {
    int ret = 0;
    for(int i=0; i<graph.size(); i++) {
      if(alive[i]==0) continue;
      if(match[i]==-1){++timestamp; ret+=dfs(i);}
    }
    return ret;
  }

  void output() {
    for(int i = 0; i < graph.size(); i++) {
      if(i < match[i]) {cout << i << "-" << match[i] << endl;}
    }
  }
};

int main() {
  int N; cin >> N;
  BipartiteMatching bm(2*N);
  vector<int> a(N),b(N),c(N),d(N);
  for(int i=0;i<N;i++)cin >> a[i] >> b[i];
  for(int i=0;i<N;i++)cin >> c[i] >> d[i];
  for(int i=0;i<N;i++){
    for(int j=0;j<N;j++){
      if(a[i]<c[j] && b[i]<d[j]){bm.add_edge(i,j);}
    }
  }
  cout << bm.bipartite_matching() << endl;
  bm.output();

Compiler output:
a.cc: In function 'int main()':
a.cc:62:15: error: expected '}' at end of input
   62 |   bm.output();
      |               ^
a.cc:50:12: note: to match this '{'
   50 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <set> 
#include <map>
#include <bitset>
#include <cctype>
#include <cmath>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
typedef long long ll;
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
const int MAX_V = 210;

struct edge {int to, cap, rev; };

vector<edge> G[MAX_V];
bool used[MAX_V];

void add_edge(int from, int to, int cap) {
    G[from].push_back((edge){to, cap, (int)G[to].size()});
    G[to].push_back((edge){from, 0, (int)G[from].size()-1});
}

int dfs(int v, int t, int f) {
    if (v==t) return f;
    used[v] = true;
    for (int i = 0; i < G[v].size(); i++) {
        edge &e =  G[v][i];
        if(!used[e.to] && e.cap > 0) {
            int d = dfs(e.to, t, min(f, e.cap));
            if(d > 0) {
                e.cap -= d;
                G[e.to][e.rev].cap += d;
                return d;
            } 
        }  
    }
    return 0;
}

int max_flow(int s, int t) {
    int flow = 0;
    for (;;) {
        memset(used, 0, (int)sizeof(used));
        int f = dfs(s, t, INF);
        if (f==0) return flow;
        flow += f;
    }
}

int main () {

    int n; cin >> n;
    vector<int> a(n), b(n), c(n), d(n);

    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
    }
    for (int i = 0; i < n; i++) {
        cin >> c[i] >> d[i];
    }

    int s = 2*n, t = s + 1;

    for (int i = 0; i < n; i++) {
        add_edge(s, i, 1);
    }

    for (int i = 0; i < n; i++) {
        add_edge(n+i, t, 1);
    }

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if(a[i] < c[j] && b[i] < d[j]) {
                add_edge(i, n+j, 1);
            }
        }
    }

    cout << max_flow(s, t) << endl;

    return 0;
}



Compiler output:
a.cc: In function 'int max_flow(int, int)':
a.cc:50:9: error: 'memset' was not declared in this scope
   50 |         memset(used, 0, (int)sizeof(used));
      |         ^~~~~~
a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <cmath>
  +++ |+#include <cstring>
   11 | using namespace std;
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <set> 
#include <map>
#include <bitset>
#include <cctype>
#include <cmath>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
typedef long long ll;
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
const int MAX_V = 210;

struct edge {int to, cap, rev; };

vector<edge> G[MAX_V];
bool used[MAX_V];

void add_edge(int from, int to, int cap) {
    G[from].push_back((edge){to, cap, G[to].size()});
    G[to].push_back((edge){from, 0, G[from].size()-1});
}

int dfs(int v, int t, int f) {
    if (v==t) return f;
    used[v] = true;
    for (int i = 0; i < G[v].size(); i++) {
        edge &e =  G[v][i];
        if(!used[e.to] && e.cap > 0) {
            int d = dfs(e.to, t, min(f, e.cap));
            if(d > 0) {
                e.cap -= d;
                G[e.to][e.rev].cap += d;
                return d;
            } 
        }  
    }
    return 0;
}

int max_flow(int s, int t) {
    int flow = 0;
    for (;;) {
        memset(used, 0, sizeof(used));
        int f = dfs(s, t, INF);
        if (f==0) return flow;
        flow += f;
    }
}

int main () {

    int n; cin >> n;
    vector<int> a(n), b(n), c(n), d(n);

    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
    }
    for (int i = 0; i < n; i++) {
        cin >> c[i] >> d[i];
    }

    int s = 2*n, t = s + 1;

    for (int i = 0; i < n; i++) {
        add_edge(s, i, 1);
    }

    for (int i = 0; i < n; i++) {
        add_edge(n+i, t, 1);
    }

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if(a[i] < c[j] && b[i] < d[j]) {
                add_edge(i, n+j, 1);
            }
        }
    }

    cout << max_flow(s, t) << endl;

    return 0;
}



Compiler output:
a.cc: In function 'void add_edge(int, int, int)':
a.cc:26:49: warning: narrowing conversion of 'G[to].std::vector<edge>::size()' from 'std::vector<edge>::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing]
   26 |     G[from].push_back((edge){to, cap, G[to].size()});
      |                                       ~~~~~~~~~~^~
a.cc:27:51: warning: narrowing conversion of '(G[from].std::vector<edge>::size() - 1)' from 'std::vector<edge>::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing]
   27 |     G[to].push_back((edge){from, 0, G[from].size()-1});
      |                                     ~~~~~~~~~~~~~~^~
a.cc: In function 'int max_flow(int, int)':
a.cc:50:9: error: 'memset' was not declared in this scope
   50 |         memset(used, 0, sizeof(used));
      |         ^~~~~~
a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <cmath>
  +++ |+#include <cstring>
   11 | using namespace std;
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin >> n;
    array<int,2> red[n*2],blue[n*2];
    for(int i=0;i<n;i++)cin >> red[i][0] >> red[i][1];
    for(int i=0;i<n;i++)cin >> blue[i][0] >> blue[i][1];
    sort(red.begin(),red.end());
    sort(blue.begin(),red.end());

    int ans;
    int red_max_y=0;
    int i,j;
    for(i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
        {
            if(red[j][0]<blue[i][0]&&red[j][1]<blue[i][1])
            {
                if(red_max_y<red[j][1])ans=j;
                red_max_y=max(red_max_y,red[j][1]);
            }
        }
        blue[ans][1]=-1;
    }

    ans=0
    for(i=0;i<n;i++)
    {
        if(blue[i]==-1)
        {
        ans++;
        }
    }

    cout << ans << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: request for member 'begin' in 'red', which is of non-class type 'std::array<int, 2> [(n * 2)]'
   10 |     sort(red.begin(),red.end());
      |              ^~~~~
a.cc:10:26: error: request for member 'end' in 'red', which is of non-class type 'std::array<int, 2> [(n * 2)]'
   10 |     sort(red.begin(),red.end());
      |                          ^~~
a.cc:11:15: error: request for member 'begin' in 'blue', which is of non-class type 'std::array<int, 2> [(n * 2)]'
   11 |     sort(blue.begin(),red.end());
      |               ^~~~~
a.cc:11:27: error: request for member 'end' in 'red', which is of non-class type 'std::array<int, 2> [(n * 2)]'
   11 |     sort(blue.begin(),red.end());
      |                           ^~~
a.cc:29:10: error: expected ';' before 'for'
   29 |     ans=0
      |          ^
      |          ;
   30 |     for(i=0;i<n;i++)
      |     ~~~   
a.cc:30:20: error: expected ';' before ')' token
   30 |     for(i=0;i<n;i++)
      |                    ^
      |                    ;
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(void){
    int n;
    cin >>n;
    vector<vector<int>> red(2*n),blue(2*n);
    for(int i=0;i<n;i++)cin >> red[i][0] >> red[i][1];
    for(int i=0;i<n;i++)cin >> blue[i][1] >> blue[i][1];

    //queue<int> check(n*n);//redの具体的な候補
    vector<int> check_(n,0),blue_num(n,0);//redの候補のかずとblueの候補にされてる数
    int a=0;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++){
        if(red[i][0]<blue[j][0]&&red[i][1]<blue[j][1])
        {
            check_[i]++;
            blue_num[j]++;
            //check.push(j);
            a++;
        }
        }
    }
    sort(check_.begin(),check_.end());
    reverse(check_.begin(),check_.end());
    sort(blue_num.begin(),blue_num.end());
    reverse(blue_num.begin(),blue_num.end());
    a*=2;
    int ans=0;
    int i,j;
    i=j=0;
    while(a>0)
    {
        if(check_[i]==0)
        {
            i++;
            continue;
        }
        if(blue_num[j]==0)
        {
            j++;
            continue;
        }
        a=a-check_[i]-blue_num[j];
        i++;
        j++;
    }
    if(a<0)a=a+check[i]+blue_num[j];

    cout << ans << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:50:16: error: 'check' was not declared in this scope; did you mean 'check_'?
   50 |     if(a<0)a=a+check[i]+blue_num[j];
      |                ^~~~~
      |                check_
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    //入力
    int n;
    cin >> n;
    vector<int> a(n*2);
    vector<int> b(n*2);
    for(int i=0;i<n;i++)cin >> a[i][0] >> a[i][1];
    for(int i=0;i<n;i++)cin >> b[i][0] >> b[i][1];
    for(int i=0;i<n;i++){

    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:36: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
    9 |     for(int i=0;i<n;i++)cin >> a[i][0] >> a[i][1];
      |                                    ^
a.cc:9:47: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
    9 |     for(int i=0;i<n;i++)cin >> a[i][0] >> a[i][1];
      |                                               ^
a.cc:10:36: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   10 |     for(int i=0;i<n;i++)cin >> b[i][0] >> b[i][1];
      |                                    ^
a.cc:10:47: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   10 |     for(int i=0;i<n;i++)cin >> b[i][0] >> b[i][1];
      |                                               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pint;

int main(){
  int n;
  cin>>n;
  vector<pint> a(n),b(n);
  for(int i=0;i<n;++i)cin>>a[i].first>>a[i].second;
  for(int i=0;i<n;++i)cin>>b[i].first>>b[i].second;
  
  sort(a.begin(),a.end());
  sort(b,begin(),b.end());
  int ans=0;
  multiset<int> st;
  int j=0;
  for(int i=0;i<n;++i){
    while(a[j].first<b[i].first||j<n)st.insert(b[j++].second);
    auto it=st.lower_bound(a[i].second);
    if(it!=st.begin()){
      ans++;
      st.erase(it--);
    }
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: no matching function for call to 'begin()'
   13 |   sort(b,begin(),b.end());
      |          ~~~~~^~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/range_access.h:52:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)'
   52 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:52:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:63:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)'
   63 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:63:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:95:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])'
   95 |     begin(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:95:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1227:5: note: candidate: 'template<class _Tp> _Tp* std::begin(valarray<_Tp>&)'
 1227 |     begin(valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/valarray:1227:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/valarray:1238:5: note: candidate: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/valarray:1238:5: note:   candidate expects 1 argument, 0 provided
Language: C++

#include <iostream>
#include <vector>
#include <utility>
#include <unordered_set>


int main() {
    int n;
    std::cin >> n;
    std::vector<std::pair<int, int>> red_points, blue_points;
    red_points.reserve(n);
    blue_points.reserve(n);
    for(int i = 0; i < n; i++) {
        int x, y;
        std::cin >> x >> y;
        red_points.emplace_back(x, y);
    }
    std::sort(
        red_points.begin(), red_points.end(),
        [](const std::pair<int, int>& p, const std::pair<int, int>& q) {
            return p.second != q.second? p.second < q.second : p.first < q.first;
        }
    );
    for(int i = 0; i < n; i++) {
        int x, y;
        std::cin >> x >> y;
        blue_points.emplace_back(x, y);
    }
    std::sort(
        blue_points.begin(), blue_points.end(),
        [](const std::pair<int, int>& p, const std::pair<int, int>& q) {
            return p.second != q.second? p.second < q.second : p.first < q.first;
        }
    );
    int ans = 0;
    for(const auto& blue_point : blue_points) {
        auto red_itr = red_points.begin();
        auto red_begin = red_points.begin();
        auto red_end = red_points.end();
        while(red_itr != red_end) {
            if(red_itr->first < blue_point.first && red_itr->second < blue_point.second) {
                ans++;
                red_points.erase(red_itr);
                break;
            }
            if(red_itr->first >= blue_point.first) {
                while(red_itr != red_end && red_itr->first >= blue_point.first) {
                    red_itr++;
                }
            }
            if(red_itr->second >= blue_point.second) {
                break;
            }

        }
    }
    std::cout << ans << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   18 |     std::sort(
      |          ^~~~
      |          qsort
a.cc:29:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   29 |     std::sort(
      |          ^~~~
      |          qsort
Language: C++

#include <algorithm>
#include <chrono>
#include <climits>
#include <cmath>
#include <deque>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include <vector>

using namespace std;

using llong = long long;
using ullong = unsigned long long;

#ifndef __MACRO_H__
#define __MACRO_H__

#define all(collection)  (collection).begin(), (collection).end()
#define loop(i, times) for(llong i = 0; i < times; i++)
#define rloop(i, times) for(llong i = times -1; 0 <= i; i--)

std::chrono::system_clock::time_point  start;

void TimeStart(void)
{
	start = std::chrono::system_clock::now();
}

void TimeEnd(void)
{
	auto time = std::chrono::system_clock::now() - start;
	auto msec = std::chrono::duration_cast<std::chrono::milliseconds>(time).count();
	cerr << msec << " msec" << std::endl;
}

#endif

struct Grid
{
	llong x_;
	llong y_;
	llong region_;
	bool operator > (const Grid& g) const
	{
		return (region_ > g.region_);
	}
	bool operator < (const Grid& g) const
	{
		return (region_ < g.region_);
	}
};

class ABC91C
{
public:
	ABC91C()
	{
		cin >> n_;
		count_pair_ = 0;
		r_grid_collection_.resize(n_);
		loop(i, n_)
		{
			cin >> r_grid_collection_[i].x_;
			cin >> r_grid_collection_[i].y_;
			r_grid_collection_[i].region_ = max(r_grid_collection_[i].x_, r_grid_collection_[i].y_);
		}
		sort(all(r_grid_collection_));
		b_grid_collection_.resize(n_);
		loop(i, n_)
		{
			cin >> b_grid_collection_[i].x_;
			cin >> b_grid_collection_[i].y_;
			b_grid_collection_[i].region_ = max(b_grid_collection_[i].x_, b_grid_collection_[i].y_);
		}
		sort(all(b_grid_collection_)));
	}
	void Run(void)
	{
		loop(i, (llong)r_grid_collection_.size())
			CompareAllBlue(r_grid_collection_[i]);

		cout << count_pair_;
	}
private:
	llong n_;
	llong count_pair_;
	vector<Grid> r_grid_collection_;
	vector<Grid> b_grid_collection_;
	void CompareAllBlue(Grid r)
	{
		if (b_grid_collection_.size() == 0)
			return;

		loop(i, (llong)b_grid_collection_.size())
		{
			if (r.x_ < b_grid_collection_[i].x_ && r.y_ < b_grid_collection_[i].y_)
			{
				b_grid_collection_.erase(b_grid_collection_.begin() + i);
				count_pair_++;
				break;
			}
		}
	}
	void Region(Grid g)
	{
		g.region_ = min(g.x_, g.y_);
	}
};

int main()
{
	ABC91C abc91c;
  
	TimeStart();
	abc91c.Run();
	TimeEnd();

  return 0;
}


Compiler output:
a.cc: In constructor 'ABC91C::ABC91C()':
a.cc:80:46: error: expected ';' before ')' token
   80 |                 sort(all(b_grid_collection_)));
      |                                              ^
Language: C++

#include <algorithm>
#include <chrono>
#include <climits>
#include <cmath>
#include <deque>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include <vector>

using namespace std;

using llong = long long;
using ullong = unsigned long long;

#ifndef __MACRO_H__
#define __MACRO_H__

#define all(collection)  (collection).begin(), (collection).end()
#define loop(i, times) for(llong i = 0; i < times; i++)
#define rloop(i, times) for(llong i = times -1; 0 <= i; i--)

std::chrono::system_clock::time_point  start;

void TimeStart(void)
{
	start = std::chrono::system_clock::now();
}

void TimeEnd(void)
{
	auto time = std::chrono::system_clock::now() - start;
	auto msec = std::chrono::duration_cast<std::chrono::milliseconds>(time).count();
	cerr << msec << " msec" << std::endl;
}

#endif

struct Grid
{
	llong x_;
	llong y_;
	llong region_;
	bool operator > (const Grid& g) const
	{
		return (region_ > g.region_);
	}
	bool operator < (const Grid& g) const
	{
		return (region_ < g.region_);
	}
};

#pragma once
#include "Macro.h"

struct Grid
{
	llong x_;
	llong y_;
	llong region_;
	bool operator > (const Grid& g) const
	{
		return (region_ > g.region_);
	}
	bool operator < (const Grid& g) const
	{
		return (region_ < g.region_);
	}
};


struct Grid
{
	llong x_;
	llong y_;
	llong region_;
	bool operator > (const Grid& g) const
	{
		return (region_ > g.region_);
	}
	bool operator < (const Grid& g) const
	{
		return (region_ < g.region_);
	}
};

class ABC91C
{
public:
	ABC91C()
	{
		cin >> n_;
		count_pair_ = 0;
		r_grid_collection_.resize(n_);
		loop(i, n_)
		{
			cin >> r_grid_collection_[i].x_;
			cin >> r_grid_collection_[i].y_;
			r_grid_collection_[i].region_ = max(r_grid_collection_[i].x_, r_grid_collection_[i].y_);
		}
		sort(all(r_grid_collection_));
		b_grid_collection_.resize(n_);
		loop(i, n_)
		{
			cin >> b_grid_collection_[i].x_;
			cin >> b_grid_collection_[i].y_;
			b_grid_collection_[i].region_ = max(b_grid_collection_[i].x_, b_grid_collection_[i].y_);
		}
		sort(all(b_grid_collection_)));
	}
	void Run(void)
	{
		loop(i, (llong)r_grid_collection_.size())
			CompareAllBlue(r_grid_collection_[i]);

		cout << count_pair_;
	}
private:
	llong n_;
	llong count_pair_;
	vector<Grid> r_grid_collection_;
	vector<Grid> b_grid_collection_;
	void CompareAllBlue(Grid r)
	{
		if (b_grid_collection_.size() == 0)
			return;

		loop(i, (llong)b_grid_collection_.size())
		{
			if (r.x_ < b_grid_collection_[i].x_ && r.y_ < b_grid_collection_[i].y_)
			{
				b_grid_collection_.erase(b_grid_collection_.begin() + i);
				count_pair_++;
				break;
			}
		}
	}
	void Region(Grid g)
	{
		g.region_ = min(g.x_, g.y_);
	}
};


int main()
{
	ABC91C abc91c;
  
	TimeStart();
	abc91c.Run();
	TimeEnd();

  return 0;
}


Compiler output:
a.cc:58:9: warning: #pragma once in main file
   58 | #pragma once
      |         ^~~~
a.cc:59:10: fatal error: Macro.h: No such file or directory
   59 | #include "Macro.h"
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <algorithm>
#include <chrono>
#include <climits>
#include <cmath>
#include <deque>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include <vector>

using namespace std;

using llong = long long;
using ullong = unsigned long long;

#ifndef __MACRO_H__
#define __MACRO_H__

#define all(collection)  (collection).begin(), (collection).end()
#define loop(i, times) for(llong i = 0; i < times; i++)
#define rloop(i, times) for(llong i = times -1; 0 <= i; i--)

std::chrono::system_clock::time_point  start;

void TimeStart(void)
{
	start = std::chrono::system_clock::now();
}

void TimeEnd(void)
{
	auto time = std::chrono::system_clock::now() - start;
	auto msec = std::chrono::duration_cast<std::chrono::milliseconds>(time).count();
	cerr << msec << " msec" << std::endl;
}

#endif

struct Grid
{
	llong x_;
	llong y_;
	llong region_;
	bool operator > (const Grid& g) const
	{
		return (region_ > g.region_);
	}
	bool operator < (const Grid& g) const
	{
		return (region_ < g.region_);
	}
};

#pragma once
#include "Macro.h"

struct Grid
{
	llong x_;
	llong y_;
	llong region_;
	bool operator > (const Grid& g) const
	{
		return (region_ > g.region_);
	}
	bool operator < (const Grid& g) const
	{
		return (region_ < g.region_);
	}
};

#pragma once
#include "Macro.h"

struct Grid
{
	llong x_;
	llong y_;
	llong region_;
	bool operator > (const Grid& g) const
	{
		return (region_ > g.region_);
	}
	bool operator < (const Grid& g) const
	{
		return (region_ < g.region_);
	}
};

class ABC91C
{
public:
	ABC91C()
	{
		cin >> n_;
		count_pair_ = 0;
		r_grid_collection_.resize(n_);
		loop(i, n_)
		{
			cin >> r_grid_collection_[i].x_;
			cin >> r_grid_collection_[i].y_;
			r_grid_collection_[i].region_ = max(r_grid_collection_[i].x_, r_grid_collection_[i].y_);
		}
		sort(all(r_grid_collection_));
		b_grid_collection_.resize(n_);
		loop(i, n_)
		{
			cin >> b_grid_collection_[i].x_;
			cin >> b_grid_collection_[i].y_;
			b_grid_collection_[i].region_ = max(b_grid_collection_[i].x_, b_grid_collection_[i].y_);
		}
		sort(all(b_grid_collection_)));
	}
	void Run(void)
	{
		loop(i, (llong)r_grid_collection_.size())
			CompareAllBlue(r_grid_collection_[i]);

		cout << count_pair_;
	}
private:
	llong n_;
	llong count_pair_;
	vector<Grid> r_grid_collection_;
	vector<Grid> b_grid_collection_;
	void CompareAllBlue(Grid r)
	{
		if (b_grid_collection_.size() == 0)
			return;

		loop(i, (llong)b_grid_collection_.size())
		{
			if (r.x_ < b_grid_collection_[i].x_ && r.y_ < b_grid_collection_[i].y_)
			{
				b_grid_collection_.erase(b_grid_collection_.begin() + i);
				count_pair_++;
				break;
			}
		}
	}
	void Region(Grid g)
	{
		g.region_ = min(g.x_, g.y_);
	}
};


int main()
{
	ABC91C abc91c;
  
	TimeStart();
	abc91c.Run();
	TimeEnd();

  return 0;
}


Compiler output:
a.cc:58:9: warning: #pragma once in main file
   58 | #pragma once
      |         ^~~~
a.cc:59:10: fatal error: Macro.h: No such file or directory
   59 | #include "Macro.h"
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <algorithm>
#include <chrono>
#include <climits>
#include <cmath>
#include <deque>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include <vector>

using namespace std;

using llong = long long;
using ullong = unsigned long long;

#ifndef __MACRO_H__
#define __MACRO_H__

#define all(collection)  (collection).begin(), (collection).end()
#define loop(i, times) for(llong i = 0; i < times; i++)
#define rloop(i, times) for(llong i = times -1; 0 <= i; i--)

std::chrono::system_clock::time_point  start;

void TimeStart(void)
{
	start = std::chrono::system_clock::now();
}

void TimeEnd(void)
{
	auto time = std::chrono::system_clock::now() - start;
	auto msec = std::chrono::duration_cast<std::chrono::milliseconds>(time).count();
	cerr << msec << " msec" << std::endl;
}

#endif

struct Grid
{
	llong x_;
	llong y_;
	llong region_;
	bool operator > (const Grid& g) const
	{
		return (region_ > g.region_);
	}
	bool operator < (const Grid& g) const
	{
		return (region_ < g.region_);
	}
};

#pragma once
#include "Macro.h"

struct Grid
{
	llong x_;
	llong y_;
	llong region_;
	bool operator > (const Grid& g) const
	{
		return (region_ > g.region_);
	}
	bool operator < (const Grid& g) const
	{
		return (region_ < g.region_);
	}
};

class ABC91C
{
public:
	ABC91C()
	{
		cin >> n_;
		count_pair_ = 0;
		r_grid_collection_.resize(n_);
		loop(i, n_)
		{
			cin >> r_grid_collection_[i].x_;
			cin >> r_grid_collection_[i].y_;
			r_grid_collection_[i].region_ = max(r_grid_collection_[i].x_, r_grid_collection_[i].y_);
		}
		sort(all(r_grid_collection_), greater<Grid>());
		b_grid_collection_.resize(n_);
		loop(i, n_)
		{
			cin >> b_grid_collection_[i].x_;
			cin >> b_grid_collection_[i].y_;
			b_grid_collection_[i].region_ = max(b_grid_collection_[i].x_, b_grid_collection_[i].y_);
		}
		sort(all(b_grid_collection_), greater<Grid>());
	}
	void Run(void)
	{
		loop(i, (llong)r_grid_collection_.size())
			CompareAllBlue(r_grid_collection_[i]);

		cout << count_pair_;
	}
private:
	llong n_;
	llong count_pair_;
	vector<Grid> r_grid_collection_;
	vector<Grid> b_grid_collection_;
	void CompareAllBlue(Grid r)
	{
		if (b_grid_collection_.size() == 0)
			return;

		loop(i, (llong)b_grid_collection_.size())
		{
			if (r.x_ < b_grid_collection_[i].x_ && r.y_ < b_grid_collection_[i].y_)
			{
				b_grid_collection_.erase(b_grid_collection_.begin() + i);
				count_pair_++;
				break;
			}
		}
	}
	void Region(Grid g)
	{
		g.region_ = min(g.x_, g.y_);
	}
};


int main()
{
	ABC91C abc91c;
  
	TimeStart();
	abc91c.Run();
	TimeEnd();

  return 0;
}


Compiler output:
a.cc:58:9: warning: #pragma once in main file
   58 | #pragma once
      |         ^~~~
a.cc:59:10: fatal error: Macro.h: No such file or directory
   59 | #include "Macro.h"
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <algorithm>
#include <chrono>
#include <climits>
#include <cmath>
#include <deque>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include <vector>

using namespace std;

using llong = long long;
using ullong = unsigned long long;

#ifndef __MACRO_H__
#define __MACRO_H__

#define all(collection)  (collection).begin(), (collection).end()
#define loop(i, times) for(llong i = 0; i < times; i++)
#define rloop(i, times) for(llong i = times -1; 0 <= i; i--)

std::chrono::system_clock::time_point  start;

void TimeStart(void)
{
	start = std::chrono::system_clock::now();
}

void TimeEnd(void)
{
	auto time = std::chrono::system_clock::now() - start;
	auto msec = std::chrono::duration_cast<std::chrono::milliseconds>(time).count();
	cerr << msec << " msec" << std::endl;
}

#endif

#pragma once
#include "Macro.h"

struct Grid
{
	llong x_;
	llong y_;
	llong region_;
	bool operator > (const Grid& g) const
	{
		return (region_ > g.region_);
	}
	bool operator < (const Grid& g) const
	{
		return (region_ < g.region_);
	}
};

class ABC91C
{
public:
	ABC91C()
	{
		cin >> n_;
		count_pair_ = 0;
		r_grid_collection_.resize(n_);
		loop(i, n_)
		{
			cin >> r_grid_collection_[i].x_;
			cin >> r_grid_collection_[i].y_;
			r_grid_collection_[i].region_ = min(r_grid_collection_[i].x_, r_grid_collection_[i].y_);
		}
		sort(all(r_grid_collection_), greater<Grid>());
		b_grid_collection_.resize(n_);
		loop(i, n_)
		{
			cin >> b_grid_collection_[i].x_;
			cin >> b_grid_collection_[i].y_;
			b_grid_collection_[i].region_ = min(b_grid_collection_[i].x_, b_grid_collection_[i].y_);
		}
		sort(all(b_grid_collection_), greater<Grid>());
	}
	void Run(void)
	{
		loop(i, (llong)r_grid_collection_.size())
			CompareAllBlue(r_grid_collection_[i]);

		cout << count_pair_;
	}
private:
	llong n_;
	llong count_pair_;
	vector<Grid> r_grid_collection_;
	vector<Grid> b_grid_collection_;
	void CompareAllBlue(Grid r)
	{
		if (b_grid_collection_.size() == 0)
			return;

		loop(i, (llong)b_grid_collection_.size())
		{
			if (r.x_ < b_grid_collection_[i].x_ && r.y_ < b_grid_collection_[i].y_)
			{
				b_grid_collection_.erase(b_grid_collection_.begin() + i);
				count_pair_++;
				break;
			}
		}
	}
	void Region(Grid g)
	{
		g.region_ = min(g.x_, g.y_);
	}
};


int main()
{
	ABC91C abc91c;
  
	TimeStart();
	abc91c.Run();
	TimeEnd();

  return 0;
}


Compiler output:
a.cc:43:9: warning: #pragma once in main file
   43 | #pragma once
      |         ^~~~
a.cc:44:10: fatal error: Macro.h: No such file or directory
   44 | #include "Macro.h"
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MM 1000000000
#define MOD MM+7
#define MAX 10100000
#define INF 1e15
#define MAP 110
#define initial_value -1
#define LINF 1LL << 60
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
ll n,a,b,ans,ch[101];
vector<Pair> r,br;
int main(){
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> a >> b;
        r.push_back(Pair(b,a));
    }
    for(int i = 0; i < n; i++){
        cin >> a >> b;
        br.push_back(Pair(a,b));
    }
    sort(r.begin(),r.end());
    sort(br.begin(),br.end());
    sort(r.begin(),r.end());
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(br[i].second > r[j].first && br[i].first > r[j].second && ch[j] == 0){
                ch[j] = 1;
                break;
            }
        }
    }
    for(int i = 0; i < 100; i++){
        ans+ = ch[i];
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:14: error: expected primary-expression before '=' token
   40 |         ans+ = ch[i];
      |              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MM 1000000000
#define MOD MM+7
#define MAX 10100000
#define INF 1e15
#define MAP 110
#define initial_value -1
#define LINF 1LL << 60
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
int dx[4] = {-1,0,1,0,1,-1,-1,1};
int dy[4] = {0,-1,0,1,1,-1,1,-1};
ll n,a,b,ans,ch[101];
vector<Pair> r,br;
int main(){
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> a >> b;
        r.push_back(Pair(b,a));
    }
    for(int i = 0; i < n; i++){
        cin >> a >> b;
        br.push_back(Pair(a,b));
    }
    sort(r.begin(),r.end());
    sort(br.begin(),br.end());
    sort(r.begin(),r.end());
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(br[i].second > r[j].first && br[i].first > r[j].second && ch[j] == 0){
                ch[j] = 1;
                break;
            }
        }
    }
    for(int i = 0; i < 100; i++){
        if(ch[i]) ans++;
    }
    cout << ans << endl;
}


Compiler output:
a.cc:14:32: error: too many initializers for 'int [4]'
   14 | int dx[4] = {-1,0,1,0,1,-1,-1,1};
      |                                ^
a.cc:15:32: error: too many initializers for 'int [4]'
   15 | int dy[4] = {0,-1,0,1,1,-1,1,-1};
      |                                ^
Language: C++

#include <vector>
#include <utility>
using namespace std;


int main()
{
    int N;
    cin >> N;
    vector<pair<int,int>> R(N), B(N);
    for( int i = 0; i < N; i++ ) cin >> R[i].first >> R[i].second;
    for( int i = 0; i < N; i++ ) cin >> B[i].first >> B[i].second;
    
    // まず first が小さい順にソートされ、
    // さらにその中で second の小さい順にソートされる
    sort( R.begin(), R.end() );
    sort( B.begin(), B.end() );
    
    int ans = 0;

    for( int i = 0; i < N; i++ ){
        for( int j = (int) R.size()-1; j >= 0; --j ){
            if( B[i].first > R[j].second && B[i].second > R[j].first ){
                R.erase( R.begin() + j );
                ans++;
                break;
            }
        }
    }

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin >> N;
      |     ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <utility>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |     sort( R.begin(), R.end() );
      |     ^~~~
      |     short
a.cc:31:5: error: 'cout' was not declared in this scope
   31 |     cout << ans << endl;
      |     ^~~~
a.cc:31:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:20: error: 'endl' was not declared in this scope
   31 |     cout << ans << endl;
      |                    ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <utility>
  +++ |+#include <ostream>
    3 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main () {
  int N;
  cin >> N;
  vector<pair<int, int>> red(N), blue(N);
  for(int i = 0; i < N; i++) {
    cin >> red.at(i).first >> red.at(i).second;
  }
  for(int i = 0; i < N; i++) {
    cin >> blue.at(i).first >> blue.at(i).second;
  }
  sort(red.begin(), red.end());
  sort(blue.begin(), blue.end());
  int count = 0;
  for(int i = N; i >= 0; i--) {
    for(int j = red.size(); j >= 0; j--) {
      if(blue.at(i).first == red.at(j).first && blue.at(i).second == red.at(j).second) {
        count++;
        red.erase(j);
        break;
      }
    }
  }
  
  cout << count << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:18: error: no matching function for call to 'std::vector<std::pair<int, int> >::erase(int&)'
   20 |         red.erase(j);
      |         ~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; iterator = std::vector<std::pair<int, int> >::iterator; const_iterator = std::vector<std::pair<int, int> >::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:28: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::pair<int, int> >::const_iterator'
 1536 |       erase(const_iterator __position)
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; iterator = std::vector<std::pair<int, int> >::iterator; const_iterator = std::vector<std::pair<int, int> >::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main() {
    int n; cin >> n;
    vector<pair<pair<int, int>, bool> > a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i].first.first >> a[i].first.second;
        a[i].second = 0;
    }
    vector<pair<int, int> > c(n);
    for (int i = 0; i < n; ++i) {
        cin >> c[i].first >> c[i].second;
    }
    sort(c.begin(), c.end());
    int cnt = 0;
    using pii = pair<int, int>;
    for (int i = 0; i < n; ++i) { //c
        int ymax = -1;
        int key = -1;
        for (int j = 0; j < n; ++j) {
            if (c[i].first > a[j].first.first && c[i].second > a[j].first.second && a[j].second == 0) {
                if (a[j].first.second > ymax) {
                    ymax = a[j].first.second;
                    key = j;
                }
            }
        }
        if (key != -1) {
            cnt++;
            a[key].second = 1;
        }
        /*
        cout << endl;
        for (int j = 0; j < n; ++j) {
            cout << a[j].first.first << " " << a[j].first.second << " " << a[j].second << endl;
        }*/
    }
    cout << cnt << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |     sort(c.begin(), c.end());
      |     ^~~~
      |     short
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>


using namespace std;
string yn(bool a)
{
  if (a){return "Yes";}
  else{return "No";}
}

bool nakayoshi(vector<int> a,vector<int> b)
{
  return a[0]<b[0] and a[1]<b[1];
}

int main()
{
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<vector<int>> p(n,vector<int>(2)),q(n,vector<int>(2));;
  for(int i=0;i<n;i++)
  {
    cin >> p[i][0]>>p[i][1];
  }
  for(int i=0;i<n;i++)
  {
    cin >> q[i][0]>>q[i][1];
  }
  vector<vector<int>> f(n,vector<int>(n));
  for(int i=0;i<n;i++)
  {
    for(int j=0;j<n;j++)
    {
      f[i][j]=nakayoshi(p[i],q[j]);
    }
  }
  int res=0;
  for(int i=0;i<n;i++)
  {
    int j=0;
    while(j<n)
    {
      if(f[i][j]){for(int k=0;k<n;k++){f[k][j]=false;}res++;break;}
      j++;
    }

  }
  cout<<res;

Compiler output:
a.cc: In function 'int main()':
a.cc:55:13: error: expected '}' at end of input
   55 |   cout<<res;
      |             ^
a.cc:23:1: note: to match this '{'
   23 | {
      | ^
Language: C++

#include <stdlib.h>
#include <string.h>
#include <iostream>

const int maxn = 500 + 5;
int mp[maxn][maxn], vis[maxn];
int match[maxn]; //表示match[1]=2表示女1和男2约上了(不一定最后是在一起的)
int n;
struct node {
	int a, b;
} p[105], q[105];
int Find(int x) //这里x表示男生
		{
	for (int i = 1; i <= n; i++) //这里的i表示女生
		if (!vis[i] && mp[i][x]) //如果这个女生没有询问过而且你和这个男生认识
				{
			vis[i] = 1; //标记询问过了
			if (match[i] == -1 || Find(match[i])) //如果当前男孩纸是来直接找约会对象，或者是要抛弃当前女孩去找下一个女孩的(而且找到了)
					{
				match[i] = x; //当前男生和女生约上了(x男i女)
				return 1; //返回找到了~~~
			}
		}
	return 0;
}

int TwoDPlane2NPoints(void) {
	std::cin >> n;
	memset(mp, 0, sizeof(mp));
	memset(match, -1, sizeof(match));
	for (int i = 1; i <= n; i++)
		std::cin >> p[i].a >> p[i].b;
	for (int i = 1; i <= n; i++)
		std::cin >> q[i].a >> q[i].b;
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= n; j++)
			if (p[i].a < q[j].a && p[i].b < q[j].b)
				mp[i][j] = 1;
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		memset(vis, 0, sizeof(vis));
		if (Find(i))
			ans++;
	}
	std::cout << ans;
	return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status