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

const int MC = 111;
int N;
P2 r[MC],b[MC];
bool c[MC*2];
 
int main(){
	cin >> N;
	repp(i,0,N){
		int x,y;
		cin >> x >> y;
		r[i] = MP(x,y);
	}
	repp(i,0,N){
		int x,y;
		cin >> x >> y;
		b[i] = MP(x,y);
	}
	sort(r,r+N); sort(b,b+N);
	int ans = 0;
	int pr = 0 , pb = 0;
	r[N] = b[N] = MP(1234567,1234567);
	while(pr < N || pb < N){
		if(r[pr].first < b[pb].first){
			c[r[pr].second] = 1;
			++pr;
		} else {
			repm(k,b[pb].second-1,-1){
				if(c[k]){
					c[k] = 0;
					++ans;
					break;
				}
			}
			++pb;
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:3:1: error: 'P2' does not name a type
    3 | P2 r[MC],b[MC];
      | ^~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> N;
      |         ^~~
a.cc:8:14: error: 'i' was not declared in this scope
    8 |         repp(i,0,N){
      |              ^
a.cc:8:9: error: 'repp' was not declared in this scope
    8 |         repp(i,0,N){
      |         ^~~~
a.cc:18:14: error: 'r' was not declared in this scope
   18 |         sort(r,r+N); sort(b,b+N);
      |              ^
a.cc:18:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   18 |         sort(r,r+N); sort(b,b+N);
      |         ^~~~
      |         short
a.cc:18:27: error: 'b' was not declared in this scope
   18 |         sort(r,r+N); sort(b,b+N);
      |                           ^
a.cc:21:23: error: 'MP' was not declared in this scope; did you mean 'MC'?
   21 |         r[N] = b[N] = MP(1234567,1234567);
      |                       ^~
      |                       MC
a.cc:27:30: error: 'k' was not declared in this scope
   27 |                         repm(k,b[pb].second-1,-1){
      |                              ^
a.cc:27:25: error: 'repm' was not declared in this scope
   27 |                         repm(k,b[pb].second-1,-1){
      |                         ^~~~
a.cc:37:9: error: 'cout' was not declared in this scope
   37 |         cout << ans << endl;
      |         ^~~~
a.cc:37:24: error: 'endl' was not declared in this scope
   37 |         cout << ans << endl;
      |                        ^~~~
Language: C++

#include<bits/stdc++.h>
#define ll long long
const int N=100005;
using namespace std;
struct red{
	int a;
	int b;
}x[105];
struct blue{
	int c;
	int d;
}y[105];
int cmp1(red a1,red a2)
{
	if(a1.a==a2.a) return a1.b>a2.b;
	else return a1.a>a2.a;
}
int cmp2(blue b1,blue b2)
{
	if(b1.c==b2.c) return b1.d>b2.d;
	else return b1.c>b2.c;
}
int n,ans,f[105];
int main(){
	cin>>n;
	for(int i=1;i<=n;i++) cin>>x[i].a>>x[i].b;
	for(int i=1;i<=n;i++) cin>>y[i].c>>y[i].d;
	sort(x+1,x+1+n,cmp1);
	sort(y+1,y+1+n,cmp2);
	for(int i=1;i<=n;i++)
	{
		int j=1;
		for(;j<=n;j++)
		    if(x[i].a<y[j].c&&x[i].b<y[j].d&&f[j]==0) {ans++,j++f[j]=1;;break;}
	}
	cout<<ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:73: error: expected ';' before 'f'
   34 |                     if(x[i].a<y[j].c&&x[i].b<y[j].d&&f[j]==0) {ans++,j++f[j]=1;;break;}
      |                                                                         ^
      |                                                                         ;
Language: C++

#include<bits/stdc++.h>
#define ll long long
const int N=100005;
using namespace std;
struct red{
	int a;
	int b;
}x[105];
struct blue{
	int c;
	int d;
}y[105];
int cmp1(red a1,red a2)
{
	if(a1.a==a2.a) return a1.b>a2.b;
	else return a1.a>a2.b;
}
int cmp2(blue b1,blue b2)
{
	if(b1.a==b2.a) return b1.b>b2.b;
	else return b1.a>b2.b;
}
int n,ans,j=1;
int main(){
	cin>>n;
	for(int i=1;i<=n;i++) cin>>x[i].a>>x[i].b;
	for(int i=1;i<=n;i++) cin>>y[i].c>>y[i].d;
	sort(x+1,x+1+n,cmp1);
	sort(y+1,y+1+n,cmp2);
	for(int i=1;i<=n;i++)
		for(;j<=n;j++)
		    if(x[i].a<y[j].c&&x[i].b<y[i].d) {ans++;break;}
	cout<<ans;
    return 0;
}

Compiler output:
a.cc: In function 'int cmp2(blue, blue)':
a.cc:20:15: error: 'struct blue' has no member named 'a'
   20 |         if(b1.a==b2.a) return b1.b>b2.b;
      |               ^
a.cc:20:21: error: 'struct blue' has no member named 'a'
   20 |         if(b1.a==b2.a) return b1.b>b2.b;
      |                     ^
a.cc:20:34: error: 'struct blue' has no member named 'b'
   20 |         if(b1.a==b2.a) return b1.b>b2.b;
      |                                  ^
a.cc:20:39: error: 'struct blue' has no member named 'b'
   20 |         if(b1.a==b2.a) return b1.b>b2.b;
      |                                       ^
a.cc:21:24: error: 'struct blue' has no member named 'a'
   21 |         else return b1.a>b2.b;
      |                        ^
a.cc:21:29: error: 'struct blue' has no member named 'b'
   21 |         else return b1.a>b2.b;
      |                             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define COUT(x) cout<<(x)<<endl
#define dump(x)  cout << #x << " = " << (x) << endl;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
using M = map<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main() {
  int n; cin >> n;
  vector<P> red(n), blue(n);
  int a,b,ans=0;
  REP(i,n) { cin >> a >> b; red[i] = {a, b}; }
  REP(i,n) { cin >> a >> b; blue[i] = {a, b}; }
  sort(blue.begin(), blue.end());

  REP(i,n) {
    int res = -1;
    REP(j,n) {
      if (red[j].first < blue[i].first && red[j].second < blue[i].second) {
        if (res == -1 || r.second < r.second) res = j;
      }
    }
    if (res != -1) {
      ans++;
      red[res] = { INF, INF };
    }
  }

  COUT(ans);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:26: error: 'r' was not declared in this scope
   28 |         if (res == -1 || r.second < r.second) res = j;
      |                          ^
Language: C++

#include <bits/stdc++.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <algorithm>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define print(s) cout << s << endl
#define acc(v) accumulate(v.begin(), v.end(), 0)

using namespace std;
typedef long long ll;
const int INF = 1e9;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
typedef pair<int, int> pii;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vchar;

int used[110];

int main()
{
	int n;
	cin >> n;
	vector<pii> x(n), y(n);
	rep(i, n)
	{
		int a, b;
		cin >> a >> b;
		x[i] = make_pair(a, b);
	}
	rep(i, n)
	{
		int a, b;
		cin >> a >> b;
		y[i] = make_pair(a, b);
	}
	sort(all(x));
	sort(all(y));
	int ans = 0;
	rep(i, n)
	{
		int m = -1;
		int index = -1;
		rep(k, n)
		{
			if (yused[k])
				continue;
			if (x[k].first < y[i].first && x[k].second < y[i].second && x[k].second > m)
			{
				m = x[k].second;
				index = k;
			}
		}
		if(index >= 0){
			used[index] = 1;
			ans++;
		}
		}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:29: error: 'yused' was not declared in this scope; did you mean 'used'?
   49 |                         if (yused[k])
      |                             ^~~~~
      |                             used
Language: C++

#include <bits/stdc++.h>

#define debug(x) cout <<"DEBUG"<<" "<< #x << ":" << x << '\n'
#define rep(i,n) for(int_fast32_t i = 0; i < ((int_fast32_t)(n)); i++)   // 0-indexed昇順
#define rep1(i,n) for(int_fast32_t i = 1; i <= ((int_fast32_t)(n)); i++) // 1-indexed昇順
#define rrep(i,n) for(int_fast32_t i = ((int_fast32_t)(n)-1); i >= 0; i--)  // 0-indexed降順
#define rrep1(i,n) for(int_fast32_t i = ((int_fast32_t)(n)); i >= 1; i--)   // 1-indexed降順
#define all(x) (x).begin(),(x).end()

using namespace std;

template<typename T>
using vec = vector<T>;
using i32 = int_fast32_t;
using i64 = int_fast64_t;
using u32 = uint_fast32_t;
using u64 = uint_fast64_t;
using ll = long long;
using ld = long double;
using vi = vec<int_fast32_t>;
using vl = vec<int_fast64_t>;
using vld = vec<ld>;
using vii = vec<vi>;  // 2次元配列
using PII = pair<int_fast32_t, int_fast32_t>;

template<class T>
using maxheap = std::priority_queue<T>;
template<class T>
using minheap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template<class T,class U> inline bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U> inline bool chmin(T &a, const U &b){if(a>b){a=b;return 1;}return 0;}

const ld Pi = std::acos(-1.0L);
constexpr ll infll = (1LL<<62)-1;
constexpr int inf = (1<<30)-1;
const int mod = 1000000007;
// const int mod = 998244353;


/*FUNCs=================================================*/


/*MAIN==================================================*/
signed main(){
    int START_TIME = clock();
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化
//    cout << fixed << setprecision(15);

    i32 n; cin >> n;
    vec<PII> red(n), blue(n);
    rep(i,n) cin >> red[i].first >> red[i].second;
    rep(i,n) cin >> blue[i].first >> blue[i].second;
//    sort(rbegin(red), rend(red));
    sort(rbegin(blue), rend(blue));

    set<PII> reds;
    for(auto p : red) reds.insert(p);
//    vec<bool> red_seen(n);
    for(auto bluePair : blue) {
        auto iter = upper_bound(all(reds), bluePair);
        if(iter != reds.begin()) --iter;
        if(*iter.first < bluePair.first && *iter.second < bluePair.second) reds.erase(iter);
    }
    i32 cnt = n-reds.size();

    cout << cnt << '\n';

    // printf("ExecutionTime: %d /ms\n",1000*(int)((clock()-START_TIME)/CLOCKS_PER_SEC));
}


Compiler output:
a.cc: In function 'int main()':
a.cc:64:18: error: 'struct std::_Rb_tree_const_iterator<std::pair<long int, long int> >' has no member named 'first'
   64 |         if(*iter.first < bluePair.first && *iter.second < bluePair.second) reds.erase(iter);
      |                  ^~~~~
a.cc:64:50: error: 'struct std::_Rb_tree_const_iterator<std::pair<long int, long int> >' has no member named 'second'
   64 |         if(*iter.first < bluePair.first && *iter.second < bluePair.second) reds.erase(iter);
      |                                                  ^~~~~~
Language: Java


import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		
		Point []R = new Point [n];
		Point []B = new Point [n];
		for(int i = 0 ; i < n ;i++) {
			int x = Integer.parseInt(sc.next());
			int y = Integer.parseInt(sc.next());
			R[i] = new Point(x,y);
		}
		Arrays.sort(R);
		
		for(int i = 0 ; i < n ;i++) {
			int x = Integer.parseInt(sc.next());
			int y = Integer.parseInt(sc.next());
			B[i] = new Point(x,y);
		}
		Arrays.sort(B);
		boolean []cheak = new boolean [n];
		int ans = 0;
		
		
		for(int i = 0 ; i < n ;i++) { //青
			for(int j = 0 ; j < n ; j++) {//赤
				if(cheak[j]) {
					continue;
				}
				if(R[j].getX() < B[i].getX() && R[j].getY() < B[i].getY()) {
					ans++;
					cheak[j] = true;
					break;
				}
			}
		}
		
		System.out.println(ans);
	
	}

}

class Point implements Comparable <Point> {
	private int x;
	private int y;
	
	public Point (int x , int y) {
		this.x = x;
		this.y = y;
	}
	
	public int getX() {
		return x;
	}
	public int getY() {
		return y;
	}
	@Override
	public int compareTo(Point o) {
		if(Integer.compare(o.getX(),x) != 0) {
		return Integer.compare(x, o.getX());
		}
		return Integer.compare(y,o.getY());
	}
	



Compiler output:
Main.java:71: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java


import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		
		Point []R = new Point [n];
		Point []B = new Point [n];
		for(int i = 0 ; i < n ;i++) {
			int x = Integer.parseInt(sc.next());
			int y = Integer.parseInt(sc.next());
			R[i] = new Point(x,y);
		}
		Arrays.sort(R);
		
		for(int i = 0 ; i < n ;i++) {
			int x = Integer.parseInt(sc.next());
			int y = Integer.parseInt(sc.next());
			B[i] = new Point(x,y);
		}
		Arrays.sort(B);
		boolean []cheak = new boolean [n];
		int ans = 0;
		
		for(int i = 0 ; i < n ;i++) { //青
			for(int j = 0 ; j < n ; j++) {//赤
				if(cheak[j]) {
					continue;
				}
				if(R[j].getX() < B[i].getX() && R[j].getY() < B[i].getY()) {
					ans++;
					cheak[j] = true;
					break;
				}
			}
		}
		
		System.out.println(ans);
	
	}

}

class Point implements Comparable <Point> {
	private int x;
	private int y;
	
	public Point (int x , int y) {
		this.x = x;
		this.y = y;
	}
	
	public int getX() {
		return x;
	}
	public int getY() {
		return y;
	}
	@Override
	public int compareTo(Point o) {
		if(Integer.compare(o.getX(),x) != 0) {
		return Integer.compare(o.getX(), x);
		}
		return Integer.compare(o.getY(), y);
	}
	



Compiler output:
Main.java:70: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define pb push_back
using namespace std;
typedef long long ll;

struct p{
  int x; int y; char c;
  bool operator<(const p &a)const{
    return x < a.x;
  }
};

int main(){
  int n;
  cin>>n;
  vector<p> s(2*n);
  rep(i,n){
    int x,y;
    cin>>x>>y;
    s[i].x = x; s[i].y = y; s[i].c = 'r';
  }
  rep(i,n){
    int x,y;
    cin>>x>>y;
    s[n+i].x = x; s[n+i].y = y; s[n+i].c = 'b';
  }
  sort(s.begin(),s.end());
  
  vector<pair<int,int>> res;
  int ans = 0;
  
  rep(i,2*n){
    if(s[i].c == 'r'){
      res.pb({s[i].y,s[i].x});
      sort(res.begin(),res.end());
    }else{
      for(int j = res.size()-1;j>=0;j--){
        if(res[j].first < s[i].y){
          ans++;
          res[j].first = n+1;
          break;
        }
      }
    }
  }
  cout << ans << endl;
}#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define pb push_back
using namespace std;
typedef long long ll;

struct p{
  int x; int y; char c;
  bool operator<(const p &a)const{
    return x < a.x;
  }
};

int main(){
  int n;
  cin>>n;
  vector<p> s(2*n);
  rep(i,n){
    int x,y;
    cin>>x>>y;
    s[i].x = x; s[i].y = y; s[i].c = 'r';
  }
  rep(i,n){
    int x,y;
    cin>>x>>y;
    s[n+i].x = x; s[n+i].y = y; s[n+i].c = 'b';
  }
  sort(s.begin(),s.end());
  
  vector<pair<int,int>> res;
  int ans = 0;
  
  rep(i,2*n){
    if(s[i].c == 'r'){
      res.pb({s[i].y,s[i].x});
      sort(res.begin(),res.end());
    }else{
      for(int j = res.size()-1;j>=0;j--){
        if(res[j].first < s[i].y){
          ans++;
          res[j].first = n+1;
          break;
        }
      }
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc:48:2: error: stray '#' in program
   48 | }#include<bits/stdc++.h>
      |  ^
a.cc:48:3: error: 'include' does not name a type
   48 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:54:8: error: redefinition of 'struct p'
   54 | struct p{
      |        ^
a.cc:7:8: note: previous definition of 'struct p'
    7 | struct p{
      |        ^
a.cc:61:5: error: redefinition of 'int main()'
   61 | int main(){
      |     ^~~~
a.cc:14:5: note: 'int main()' previously defined here
   14 | int main(){
      |     ^~~~
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int> a(N);
  vector<int> b(N);
  vector<int> c(N);
  vector<int> d(N);
  vector<pair<int,int>> red(N);
  vector<pair<int,int>> blue(N);
  for(int i = 0; i < N; i++){
    cin >> a[i] >> b[i];
    red[i] = make_pair(a[i],b[i]);
  }

  for(int i = 0; i < N; i++){
    cin >> c[i] >> d[i];
    blue[i] = make_pair(c[i],d[i]);
  }

  int num = 0;
  int ans = 0;
  sort(red.begin(),red.end());
  sort(blue.begin(),blue.end());
  int aka[N],ao[N];

  for(int i = 0; i < N; i++){
    aka[i] = 0;
    ao[i] = 0;
  }
  int flag = 0;
  for(int i = 0; i < N; i++){
    int mita = 0;
    int max = 0;
    int mita = 0;
    for(int j = 0; j < i; j++){
      if(red[j].second < blue[i].second && aka[j] == 0 && ao[i] == 0){ max = red[j].second; flag = j; ans++; mita = 1; }
    }
    if(mita == 1){
    aka[flag] = 1;
    ao[i] = 1;
    }
    }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:9: error: redeclaration of 'int mita'
   37 |     int mita = 0;
      |         ^~~~
a.cc:35:9: note: 'int mita' previously declared here
   35 |     int mita = 0;
      |         ^~~~
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int> a(N);
  vector<int> b(N);
  vector<int> c(N);
  vector<int> d(N);
  vector<pair<int,int>> red(N);
  vector<pair<int,int>> blue(N);
  for(int i = 0; i < N; i++){
    cin >> a[i] >> b[i];
    red[i] = make_pair(a[i],b[i]);
  }

  for(int i = 0; i < N; i++){
    cin >> c[i] >> d[i];
    blue[i] = make_pair(c[i],d[i]);
  }

  int num = 0;
  int ans = 0;
  sort(red.begin(),red.end());
  sort(blue.begin(),blue.end());
  int aka[N],ao[N];

  for(int i = 0; i < N; i++){
    aka[i] = 0;
    ao[i] = 0;
  }
  int flag = 0;
  for(int i = 0; i < N; i++){
    mita = 0;
    int max = 0;
    int mita = 0;
    for(int j = 0; j < i; j++){
      if(red[j].second < blue[i].second && aka[j] == 0 && ao[i] == 0){ max = red[j].second; flag = j; ans++; mita = 1; }
    }
    if(mita == 1){
    aka[flag] = 1;
    ao[i] = 1;
    }
    }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:5: error: 'mita' was not declared in this scope
   35 |     mita = 0;
      |     ^~~~
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int> a(N);
  vector<int> b(N);
  vector<int> c(N);
  vector<int> d(N);
  vector<pair<int,int>> red(N);
  vector<pair<int,int>> blue(N);
  for(int i = 0; i < N; i++){
    cin >> a[i] >> b[i];
    red[i] = make_pair(a[i],b[i]);
  }

  for(int i = 0; i < N; i++){
    cin >> c[i] >> d[i];
    blue[i] = make_pair(c[i],d[i]);
  }

  int num = 0;
  int ans = 0;
  sort(red.begin(),red.end());
  sort(blue.begin(),blue.end());
  int aka[N],ao[N];

  for(int i = 0; i < N; i++){
    aka[i] = 0;
    ao[i] = 0;
  }
  int flag = 0;
  for(int i = 0; i < N; i++){
    int max = 0;
    for(int j = 0; j < i; j++){
      if(red[j].second < blue[i].second && aka[j] == 0 && ao[i] == 0){ max = red[j].second; flag = j; ans++; }
    }
    aka[j] = 1;
    ao[i] = 1;
    }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:9: error: 'j' was not declared in this scope
   39 |     aka[j] = 1;
      |         ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int> a(N);
  vector<int> b(N);
  vector<int> c(N);
  vector<int> d(N);
  vector<pair<int,int>> red(N);
  vector<pair<int,int>> blue(N);
  for(int i = 0; i < N; i++){
    cin >> a[i] >> b[i];
    red[i] = make_pair(a[i],-b[i]);
  }

  for(int i = 0; i < N; i++){
    cin >> c[i] >> d[i];
    blue[i] = make_pair(c[i],-d[i]);
  }

  int num = 0;
  int ans = 0;
  sort(red.begin(),red.end());
  sort(blue.begin(),blue.end());
  int aka[N],ao[N];

  for(int i = 0; i < N; i++){
    aka[i] = 0;
    ao[i] = 0;
  }
  for(int i = 0; i < N; i++){
    for(int j = 0; j < N; j++){
    if(red[i].first < blue[j].first && aka[i] == 0 && ao[j] == 0 && (-) * red[i].second < (-1) * blue[j].second){
      ans++;
      aka[i] = 1;
      ao[j] = 1;
    }
    }
    }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:71: error: expected primary-expression before ')' token
   35 |     if(red[i].first < blue[j].first && aka[i] == 0 && ao[j] == 0 && (-) * red[i].second < (-1) * blue[j].second){
      |                                                                       ^
Language: C++

#include<bits/stdc++.h>
#include<utility>
using namespace std;
int main () {
  int N;
  cin >> N;
  vector<pair<int, int>>A(N);
  vector<pair<int, int>>B(N);
  for (int i = 0; i < N; i ++) {
    int a, b;
    cin >> a >> b;
    A[i] = make_pair(a, b);
  }
  for (int i = 0; i < N; i ++) {
    int a, b;
    cin >> a >> b;
    B[i] = make_pair(a, b);
  }
  sort(A.begin(), A.end());
  sort(B.begin(), B.end());
  vector<int>B_n(N);
  int as = N;
  for (int i = 0; i <= N; i ++) {
    A_n[i] = i;
    B_n[i] = i;
  }
  int ans = 0;
  for (int i = 0; i < N; i ++) {
    int bu = B_n[0];
    int pre = 0;
    for (int j = 0; j < as; j ++) {
      if(A[i].first < B[bu].first && A[i].second < B[bu].second) {
        int k = B_n[bu];
        B_n[pre] = k;
        as --;
        ans ++;
        break;
      }
      pre = bu;
      bu = B_n[bu];
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: 'A_n' was not declared in this scope; did you mean 'B_n'?
   24 |     A_n[i] = i;
      |     ^~~
      |     B_n
Language: C

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

#define MAX(a,b) (a > b ? a : b)
#define MIN(a,b) (a < b ? a : b)
const int inf = 1000000000; // 10^9

int main(){
   int n;scanf("%d",&n);
   int a[2][100];
   for(int i = 0;i < n;i++)scanf("%d%d",&a[0][i],&a[1][i]);
   int b[2][100];
   for(int i = 0;i < n;i++)scanf("%d%d",&b[0][i],&b[1][i]);
   int ans[2]=0;
   int _ans[2]=inf;
   for(int i = 0;i < n;i++){
      for(int j = 0;j < n;j++){
         if(a[0][i]<b[0][i]&&a[1][i]<b[1][i]){
            ans[0]++;
            a[0][i]=inf;
            a[1][i]=inf;
            b[0][i]=0;
            b[1][i]=0;
            
         }
      }
   }
   for(int i = n-1;i >= 0;i++){
      for(int j = n-1;j >= 0;j++){
         if(a[0][i]<b[0][i]&&a[1][i]<b[1][i]){
            ans[1]++;
            a[0][i]=inf;
            a[1][i]=inf;
            b[0][i]=0;
            b[1][i]=0;
            
         }
      }
   }
   printf("%d",MAX(ans[1],ans[0]));
}


Compiler output:
main.c: In function 'main':
main.c:15:15: error: invalid initializer
   15 |    int ans[2]=0;
      |               ^
main.c:16:16: error: invalid initializer
   16 |    int _ans[2]=inf;
      |                ^~~
Language: C

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

#define MAX(a,b) (a > b ? a : b)
#define MIN(a,b) (a < b ? a : b)
const int inf = 1000000000; // 10^9

int main(){
   int n;scanf("%d",&n);
   int a[2][100];
   for(int i = 0;i < n;i++)scanf("%d%d",&a[0][i],&a[1][i]);
   int b[2][100];
   for(int i = 0;i < n;i++)scanf("%d%d",&b[0][i],&b[1][i]);
   int ans=0;
   for(int i = 0;i < n;i++){
      for(int j = 0;j < n;j++){
         if(a[0][i]<b[0][i]&&a[1][i]<b[1][i]){
            ans++;
            ans[0][i]=inf;
            ans[1][i]=inf;
         }
      }
   }
   printf("%d",ans);
}

Compiler output:
main.c: In function 'main':
main.c:20:16: error: subscripted value is neither array nor pointer nor vector
   20 |             ans[0][i]=inf;
      |                ^
main.c:21:16: error: subscripted value is neither array nor pointer nor vector
   21 |             ans[1][i]=inf;
      |                ^
Language: C

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

#define MAX(a,b) (a > b ? a : b)
#define MIN(a,b) (a < b ? a : b)
const int inf = 1000000000; // 10^9

int main(){
   int n;
   int a[2][100];
   for(int i = 0;i < n;i++)scanf("%d%d",a[0][i],a[1][i]);
   int b[2][100];
   for(int i = 0;i < n;i++)scanf("%d%d",b[0][i],b[1][i]);
   int ans=0;
   for(int i = 0;i < n;i++){
      for(int j = 0;j < n;j++){
         if(a[0][i]<b[0][i]&&a[1][i]<b[1][i]){
            ans++;
            ans[0][i]=inf;
            ans[1][i]=inf;
         }
      }
   }
   printf("%d",ans);
}

Compiler output:
main.c: In function 'main':
main.c:20:16: error: subscripted value is neither array nor pointer nor vector
   20 |             ans[0][i]=inf;
      |                ^
main.c:21:16: error: subscripted value is neither array nor pointer nor vector
   21 |             ans[1][i]=inf;
      |                ^
Language: C++

#include <iostream>
#include <Algorithm>
using namespace std;
typedef pair<int ,int > pp;

int N;

void swap(pp *kr,pp *kl){
    pp t=*kr;
    *kr=*kl;
    *kl=t;
}

void sortF( pp *a)
{  
    for(int i=0;i<N-1;i++){
        for(int j=i+1;j<N;j++){
            if(a[i].first>a[j].first){
                swap(&a[i],&a[j]);
            }
        }
    }
}

void sortS(pp *a)
{   
    for(int i=0;i<N-1;i++){
        for(int j=i+1;j<N;j++){
            if(a[i].second<a[j].second){
                swap(&a[i],&a[j]);
            }
        }
    }
}

int main()
{
    cin >> N;
    pp red[N], blue[N];
    for (int i = 0; i < N; i++)
    {
        cin >> red[i].first >> red[i].second;
    }
    for (int i = 0; i < N; i++)
    {
        cin >> blue[i].first >> blue[i].second;
    }
    sortS(red);
    sortF(blue);
    bool isUsed[N]={};
    int count =0;
    int MaxY=-1;
    int Max=0;
    for(int i=0;i<N;i++){
        MaxY=-1;
        Max=0;
        for(int j=0;j<N;j++){
            if((blue[i].first<=red[j].first)||(blue[i].second<=red[j].second)){
                continue;
            }
            if(isUsed[j]){
                continue;
            }
            count++;
            isUsed[j]=true;
            break;
        }
    }
    cout << count <<endl;
    return 0;
}

Compiler output:
a.cc:2:10: fatal error: Algorithm: No such file or directory
    2 | #include <Algorithm>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include <algorithm>
#include<stdio.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <stack>
#include <queue>
#include<map>
#include <set>
#include<math.h>
using namespace std;
#define int long long
#define ll long long
#define double long double
#define rep(i,n) for(ll i=0;i<n;++i)
#define Rep(i,n) for(ll i=1;i<=n;++i)
#define loop(i,m,n) for(ll i=m;i<n;++i)
#define ggr getchar(); getchar();return 0;
#define pie 3.141592653589793238462643383279
#define elif else if
#define P pair<ll,ll>
#define prique priority_queue<ll>
#define ALL(a)  (a).begin(),(a).end()
const int mod = 1000000007;
const int mod2 = 998244353;
int bin(int bina) {
	int ans = 0;
	for (int i = 0; bina > 0; i++)
	{
		ans = ans + (bina % 2) * pow(10, i);
		bina = bina / 2;
	}
	return ans;
}
bool prime(int n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int kai(int x) {
	if (x == 0)return 1;
	return kai(x - 1) * x % mod;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int n, int r) {
	int ans = 1;
	for (ll i = n; i > n - r; --i) {
		ans = ans * i;
	}
	for (ll i = 1; i < r + 1; ++i) {
		ans = ans / i;
	}
	return ans;
}
int per(int n, int r) {
	r = n - r;
	int sum = 1;
	int i;
	for (i = n; i >= r + 1; i--)sum *= i;
	return sum;
}
struct union_find {
	int par[200010], size_[200010];
	void init(int x) {
		rep(i, x) { par[i] = i; size_[i] = 1; }
	}
	int find(int x) {
		if (par[x] == x)return x;
		return par[x] = find(par[x]);
	}
	void unite(int x, int y) {
		x = find(x); y = find(y);
		if (x == y)return;
		if (size_[x] < size_[y]) {
			par[x] = y;
			size_[y] += size_[x];
		}
		else {
			par[y] = x;
			size_[x] += size_[y];
		}
	}
};

int ctoi(const char c) {
	return c - '0';
}
int keta(int a) {
	return to_string(a).size();
}
const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
P a[110],b[110];
signed main() {
	int n;
	cin>>m;
	rep(i,n){
		cin>>a[i].first>>a[i].second;
	}
	rep(i,n){
		cin>>b[i].second>>b[i].first;
	}
	sort(a,a+n);
	sort(b,b+n);
	reverse(b,b+n);
	
}





Compiler output:
a.cc: In function 'int main()':
a.cc:139:14: error: 'm' was not declared in this scope
  139 |         cin>>m;
      |              ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
#define MAX_N 105
bool seen[MAX_N];

bool compare_by_b(pair<int, int> a, pair<int, int> b) {
  if (a.second != b.second) {
    return a.second < b.second;
  } else {
    return a.first < b.first;
  }
}

int main() {
  int N;
  cin >> N;
  vector<pair<int, int> > p, q;
  for (int i = 0; i < N; i++) {
    int a, b;
    cin >> a >> b;
    p.push_back(make_pair(a, b));
  }

  for (int i = 0; i < N; i++) {
    int c, d;
    cin >> c >> d;
    q.push_back(make_pair(c, d));
  }

  sort(p.begin(), p.end());
  sort(q.begin(), q.end());
  sort(p.begin(), p.end(), compare_by_b);
  sort(q.begin(), q.end(), compare_by_b);

  int ans = 0;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (seen[i]) break;
      if (seen[j]) continue;
      if (p[i].first < q[j].first && p[i].second < q[j].second) {
        ans++;
        seen[j] = true, seen[i] = true;
      }
    }
  }

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

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

#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> pi;
#define f first
#define s second

int N, ans;
pi a[110], b[110];
bool bt[110];

int32_t main () {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> a[i].f >> a[i].s;
	}
	for (int i = 0; i < N; i++) {
		cin >> b[i].f >> b[i].s;
	}
	ans =0;
	memset(bt, 0, sizeof bt);
	sort(a, a+N);
	sort(b, b+N);
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			if (a[i].f < b[j].f && a[i].s < b[j].s && (!bt[j]) && B) {
				bt[j] = 1;
				ans++;
				break;
			}
		}
	}
	cout << ans;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:28:79: error: 'B' was not declared in this scope
   28 |                         if (a[i].f < b[j].f && a[i].s < b[j].s && (!bt[j]) && B) {
      |                                                                               ^
Language: C++

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

int main(){
  int n; cin >> n;
  vector<pair<int,int>> red;
  vector<pair<int,int>> blue;
  int a,b;
  for(int i=0;i<n;i++){
    cin >> a >> b;
    red.at(i) = make_pair(a,b);
  }
  for(int i=0;i<n;i++){
    cin >> a >> b;
    blue.at(i) = make_pair(a,b);
  }
  bool update=true;
  int ans = 0;
  vector<bool> use_red(n,true);
  vector<bool> use_blue(n,true);
  while(update){
    update=false;
    for(int i=0; i<n; i++){
      if(use_red.at(i)){
        vector<pair<int,int>> goodpair;
        for(int j=0; j<n; j++){
          if(use_blue.at(j)){
            if(red.at(i).first<blue.at(j).first&&red.at(i)<blue.at(j))goodpair.push_back(make_pair(i,j));
          }
        }
        if((int)(goodpair.size())==1){
          I = goodpair.at(0).first;
          J = goodpair.at(0).second;
          use_red.at(I) = false;
          use_blue.at(J) = false;
          update = true;
          ans++;
        }
      }
    }
  }
  cout << ans << endl;
}
  
      
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:32:11: error: 'I' was not declared in this scope
   32 |           I = goodpair.at(0).first;
      |           ^
a.cc:33:11: error: 'J' was not declared in this scope
   33 |           J = goodpair.at(0).second;
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using INF = 0x3f3f3f3f;
const int maxn = 110;
int a[maxn], b[maxn], a1[maxn], b1[maxn];
int  v[maxn], match[maxn];
int n;
vector < int > g[maxn];
bool dfs(int x)
{
	int y;
	for(int i = 0; i < g[x].size(); i++){
		y = g[x][i];
		if(!v[y]){
			v[y] = 1;
			if(!match[y] || dfs(match[y])){
				match[y] = x;
				return true;
			}
		}
	}
	return false;
}
int main()
{
	scanf("%d", &n);
	for(int i = 1; i <= n; i++){
		scanf("%d %d", a + i, b + i);
	}
	for(int i = 1; i <= n; i++){
		scanf("%d %d", a1 + i, b1 + i);
	}
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= n; j++){
			if(a[i] < a1[j] && b[i] < b1[j]){
				g[i].push_back(j);
			}
		}
	}
	int ans = 0;
	for(int i  = 1; i <= n; i++){
		memset(v, 0, sizeof(v));
		if(dfs(i))ans++;
	}
	printf("%d", ans);
	return 0;
}

Compiler output:
a.cc:3:13: error: expected type-specifier before numeric constant
    3 | using INF = 0x3f3f3f3f;
      |             ^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#define MAX_V 100000
#define INF 1<<29
using namespace std;
struct edge{int to,cap,rev;};
vector<edge>G[MAX_V];
int level[MAX_V];
int iter[MAX_V];
#typedef long long int ll;
void add_edge(int from,int to,int cap){
  G[from].push_back((edge){to,cap,ll(G[to].size())});
  G[to].push_back((edge){from,0,ll(G[from].size()-1)});
}
void bfs(int s){
  memset(level,-1,sizeof(level));
  queue<int>q;
  level[s]=0;
  q.push(s);
  while(!q.empty()){
    int v=q.front();q.pop();
    for(int i=0;i<G[v].size();i++){
      edge &e=G[v][i];
      if(e.cap>0&&level[e.to]<0){
        level[e.to]=level[v]+1;
        q.push(e.to);
      }
    }
  }
}
int dfs(int v,int t,int f){
  if(v==t)return f;
  for(int &i=iter[v];i<G[v].size();i++){
    edge &e=G[v][i];
    if(e.cap>0&&level[v]<level[e.to]){
      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;
  while(1){
    bfs(s);
    if(level[t]<0)return flow;
    memset(iter,0,sizeof(iter));
    int f;
    while((f=dfs(s,t,INF))>0){
      flow+=f;
    }
  }
}
int main(){
  int x,y,m;
  cin>>x>>y>>m;
  while(m--){
    int a,b;
    cin>>a>>b;
    add_edge(a+1,b+x+1,1);
  }
  for(int i=0;i<x;i++){
  	add_edge(0,i+1,1);
  }
  for(int i=0;i<y;i++){
  	add_edge(x+i+1,x+y+1,1);
  }
  cout<<max_flow(0,x+y+1)<<endl;
}

Compiler output:
a.cc:9:2: error: invalid preprocessing directive #typedef
    9 | #typedef long long int ll;
      |  ^~~~~~~
a.cc: In function 'void add_edge(int, int, int)':
a.cc:11:35: error: 'll' was not declared in this scope
   11 |   G[from].push_back((edge){to,cap,ll(G[to].size())});
      |                                   ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,e) for(int i= 0; i< (int)(e); i++)
#define reps(i,s,e) for(int i = s; i < (int)(e); i++)
#define repr(i,s,e) for(int i = s; i > (int)(e); i--)
#define pb push_back
typedef long long ll;
const ll INF = 1LL << 60;

bool augment(const Graph& g, int u,vector<int>& matchTo, vector<bool>& visited) {
    if (u < 0) return true;
    for(auto to : g[u]){
        if (!visited[to]) {
            visited[to] = true;
            if (augment(g, matchTo[to], matchTo, visited)) {
                matchTo[u] = to;
                matchTo[to] = u;
                return true;
            }
        }
    }
    return false;
}

int bipartiteMatching(const Graph& g, int L, vector<pair<int,int>> &matching) {
    const int n = g.size();
    vector<int> matchTo(n, -1);
    int match = 0;
    rep(u,L) {
        vector<bool> visited(n);
        if (augment(g, u, matchTo, visited)) ++match;
    }
    rep(u, L) if (matchTo[u] >= 0) // make explicit matching
    matching.push_back(make_pair(u,matchTo[u]));
    return match;
}

int main()
{
    int n;
    cin >> n;
    vector<int> a(n),b(n),c(n),d(n);
    rep(i,n){
        cin >> a[i] >> b[i];
    }
    rep(i,n){
        cin >> c[i] >> d[i];
    }
    vector<vector<int>> g(2*n);
    rep(i,n){
        rep(j,n){
            if(a[i]<c[j] && b[i]<d[j]){
                g[i].pb(n+j);
                g[n+j].pb(i);
            }
        }
    }
    //print2(g);
    vector<pair<int,int>> matching;
    //print(bipartiteMatching(g, n, matching));
    //printvt(matching);
    cout << bipartiteMatching(g, n, matching);
}

Compiler output:
a.cc:10:20: error: 'Graph' does not name a type
   10 | bool augment(const Graph& g, int u,vector<int>& matchTo, vector<bool>& visited) {
      |                    ^~~~~
a.cc: In function 'bool augment(const int&, int, std::vector<int>&, std::vector<bool>&)':
a.cc:12:20: error: invalid types 'const int[int]' for array subscript
   12 |     for(auto to : g[u]){
      |                    ^
a.cc: At global scope:
a.cc:25:29: error: 'Graph' does not name a type
   25 | int bipartiteMatching(const Graph& g, int L, vector<pair<int,int>> &matching) {
      |                             ^~~~~
a.cc: In function 'int bipartiteMatching(const int&, int, std::vector<std::pair<int, int> >&)':
a.cc:26:21: error: request for member 'size' in 'g', which is of non-class type 'const int'
   26 |     const int n = g.size();
      |                     ^~~~
a.cc: In function 'int main()':
a.cc:62:31: error: invalid initialization of reference of type 'const int&' from expression of type 'std::vector<std::vector<int> >'
   62 |     cout << bipartiteMatching(g, n, matching);
      |                               ^
a.cc:25:36: note: in passing argument 1 of 'int bipartiteMatching(const int&, int, std::vector<std::pair<int, int> >&)'
   25 | int bipartiteMatching(const Graph& g, int L, vector<pair<int,int>> &matching) {
      |                       ~~~~~~~~~~~~~^
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      Map<Integer,Integer> red = new HashMap<Integer,Integer>();
      Map<Integer,Integer> blue = new HashMap<Integer,Integer>();
      for(int i = 0;i < n;i++)red.put(sc.nextInt(),sc.nextInt());
      for(int i = 0;i < n;i++)blue.put(sc.nextInt(),sc.nextInt());
      Object[] blueKey = blue.keySet().toArray();
      Arrays.sort(blueKey);
      int cnt = 0;
      for(Integer b : blue.keySet()){
        int max = -1;
        int z = 0;
      	for(Integer a : red.keySet()){
        	if(b>a&&blue.get(b)>red.get(a)){
            	max = Math.max(max,red.get(a));
                if(max = red.get(a))z = a;
            }
        }
        if(max>=0){
        	cnt++;
            red.remove(z);
        }
      }
      System.out.println(cnt);
    }
}


Compiler output:
Main.java:19: error: incompatible types: int cannot be converted to boolean
                if(max = red.get(a))z = a;
                       ^
1 error
Language: C++

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

using namespace std;

struct Coor{
    int x;
    int y;
};

bool comp_x(const Coor &a, const Coor &b) {
    if(a.x!=b.x) return a.x < b.x;
    else return a.y < b.y;
}

bool comp_y(const Coor &a, const Coor &b) {
    if(a.y!=b.y) return a.y < b.y;
    else return a.x < b.x;
}

int main() {
    int n;
    cin >> n;
    vector<Coor> red(n), blue(n);
    for(int i=0; i<n; i++) {
        int a, b;
        cin >> a >> b;
        red[i].x = a;
        red[i].y = b;
    }
    for(int i=0; i<n; i++) {
        int a, b;
        cin >> a >> b;
        blue[i].x = a;
        blue[i].y = b;
    }

    sort(red.begin(), red.end(), comp_x);
    sort(blue.begin(), blue.end(), comp_y);

    bool used[n];
    for(int i=0; i<n; i++) used[i] = false;

    int cnt=0, i=0, j;
    while(i<n) {
        j=0;
        while(j<n && (red[i].x>=blue[j].x || red[i].y>=blue[j].y || used[j])) {
            j++;
        }

        if(j<n && red[i].x<blue[j].x && red[i].y<blue[j].y && !used[j])) {
            used[j]=true;
            cnt++;
        }
        i++;
    }
    cout << cnt << endl;


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:72: error: expected primary-expression before ')' token
   52 |         if(j<n && red[i].x<blue[j].x && red[i].y<blue[j].y && !used[j])) {
      |                                                                        ^
Language: C++

#include <iostream>
#include <vector>
#include <queue>
using namespace std;

typedef pair<int, int> P;

int main() {
    int N;
    cin >> N;
    vector<P> red(N);
    priority_queue<P, vector<P>, greater<P>> blue;
    for (int i = 0; i < N; i++) {
        int a, b;
        cin >> a >> b;
        red[i] = (P(b, a));
    }
    for (int i = 0; i < N; i++) {
        int c, d;
        cin >> c >> d;
        blue.push(P(c, d));
    }

    sort(red.begin(), red.end(), greater<P>());
    vector<bool> used(N);

    int res = 0;
    while (!blue.empty()) {
        P b = blue.top(); blue.pop();
        for (int i = 0; i < N; i++) {
            if (red[i].second < b.first && red[i].first < b.second && !used[i]) {
                res++;
                used[i] = true;
                break;
            }
        }
    }

    cout << res << endl;
    return 0;
}

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

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

int main(){
  int N;
  cin >> N;
  map <int,int> m;
  int A,B;
  for(int i=0;i<N;i++){
    cin >> A >> B;
    m[A]=B;
  }
  int n=0;
  vector <int> v;
  for(auto p : m){
    v.push_back(p.second);
  }
  for(int i=0;i<N/2;i++){
    for(int j=N/2;j<N;j++){
      if((v.at(i)<v.at(j)){
        n++;
        v.at(i)=-1;
        v.at(j)=-1;
        break;
      }
    }
  }
  cout << n << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:27: error: expected ')' before '{' token
   20 |       if((v.at(i)<v.at(j)){
      |         ~                 ^
      |                           )
a.cc:26:5: error: expected primary-expression before '}' token
   26 |     }
      |     ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;

class point{
public:	
	int x;
	int y;
	bool exist;
	point(){
		this->x = 0;
		this->y = 0;
		this->exist = true;
	}
	static bool sortx(const point& left, const point& right){
		return left.x < right.x;
	}
	static bool sorty(const point& left, const point& right){
		return left.y < right.y;
	}
};

int main(){
	/*input*/
	int n;	cin >> n;
	vector<point>red(n);
	vector<point>blue(n);
	for(int i = 0; i < n; i++){
		cin >> red[i].x >> red[i].y;
	}
	for(int i = 0; i < n; i++){
		cin >> blue[i].x >> blue[i].y;
	}
	/*calculation*/
	int ans = 0;
	sort(blue.begin(), blue.end(), point::sortx());
	sort(red.rbegin(), red.rend(), point::sorty());
	for(int i = 0; i < n; i++){	//blue
		for(int j = 0; j < n; j++){	//red
			if(blue[i].x >= red[j].x && blue[i].y >= red[j].y && blue[i].exist && red[j].exist){
				ans++;
				blue[i].exist = false;
				red[j].exist = false;
			}
		}
	}
	/*output*/
	cout << ans << endl;
	/*debug*/
	/*
	for(int i = 0; i < n; i++){
		printf("blue[%d]:(%d, %d, %d), red[%d]:(%d, %d, %d)\n", i, blue[i].x, blue[i].y, (blue[i].exist)?1:0, i, red[i].x, red[i].y, (red[i].exist)?1:0);
	}
	*/
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:52: error: no matching function for call to 'point::sortx()'
   37 |         sort(blue.begin(), blue.end(), point::sortx());
      |                                        ~~~~~~~~~~~~^~
a.cc:16:21: note: candidate: 'static bool point::sortx(const point&, const point&)'
   16 |         static bool sortx(const point& left, const point& right){
      |                     ^~~~~
a.cc:16:21: note:   candidate expects 2 arguments, 0 provided
a.cc:37:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   37 |         sort(blue.begin(), blue.end(), point::sortx());
      |         ^~~~
      |         short
a.cc:38:52: error: no matching function for call to 'point::sorty()'
   38 |         sort(red.rbegin(), red.rend(), point::sorty());
      |                                        ~~~~~~~~~~~~^~
a.cc:19:21: note: candidate: 'static bool point::sorty(const point&, const point&)'
   19 |         static bool sorty(const point& left, const point& right){
      |                     ^~~~~
a.cc:19:21: note:   candidate expects 2 arguments, 0 provided
Language: C++

#include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;

class point{
public:	
	int x;
	int y;
	bool exist;
	point(){
		this->x = 0;
		this->y = 0;
		this->exist = true;
	}
	static bool sortx(const point& left, const point& right){
		return left.x < right.x;
	}
	static bool sorty(const point& left, const point& right){
		return left.y < right.y;
	}
};

int main(){
	/*input*/
	int n;	cin >> n;
	vector<point>red(n);
	vector<point>blue(n);
	for(int i = 0; i < n; i++){
		cin >> red[i].x >> red[i].y;
	}
	for(int i = 0; i < n; i++){
		cin >> blue[i].x >> blue[i].y;
	}
	/*calculation*/
	int ans = 0;
	sort(blue.begin(), blue.end(), point::sortx);
	sort(red.rbegin(), red.rend(), point::sorty);
	for(int i = 0; i < n; i++){	//blue
		for(int j = 0; j < n; j++){	//red
			if(blue[i].x >= red[j].x && blue[i].y >= red[j].y && blue[i].exist && red[j].exist){
				ans++;
				blue[i].exist = false;
				red[j].exist = false;
			}
		}
	}
	/*output*/
	cout << ans << endl;
	/*debug*/
	/*
	for(int i = 0; i < n; i++){
		printf("blue[%d]:(%d, %d, %d), red[%d]:(%d, %d, %d)\n", i, blue[i].x, blue[i].y, (blue[i].exist)?1:0, i, red[i].x, red[i].y, (red[i].exist)?1:0);
	}
	*/
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,ans;
  cin>>n;
  ans=0;
  vector<pair<int,int>> r(n);
  vector<pair<int,int>> b(n);
  vector<bool> af(n,true);
  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;
  }
  sort(r.begin(),r.end());
  sort(b.begin(),b.end());
  for(int j=n-1;j>=0;j--){
    for(int i=n-1;i>=0;i--){
      if(r[i].first<b[j].first&&af[i]){
        int ymax=r[i].second;
        int yindex=i;
        int f=0;
        for(int k=i;k>=0;k--){
          if(r[k].second<b[j].second){
            if(r[k].second>ymax){yindex=k;ymax=r[k].second;f=1;}
        }
        if(f){ans++;af[yindex]=false;break;}
      }
      else{continue;}
    }
  }
  cout<<ans;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:7: error: expected '}' before 'else'
   32 |       else{continue;}
      |       ^~~~
a.cc:22:39: note: to match this '{'
   22 |       if(r[i].first<b[j].first&&af[i]){
      |                                       ^
a.cc: At global scope:
a.cc:37:1: error: expected declaration before '}' token
   37 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,ans;
  cin>>n;
  ans=0;
  vector<pair<int,int>> r(n);
  vector<pair<int,int>> b(n);
  vector<bool> af(n,true);
  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;
  }
  sort(r.begin(),r.end());
  sort(b.begin(),b.end());
  for(int j=n-1;j>=0;j--){
    for(int i=n-1;i>=0;i--){
      if(r[i].first<b[j].first&&af[i]){
        int ymax=r[i].second;
        int yindex=i;
        int f=0;
        for(int k=i;k>=0;k--){
          if(r[k].second<b[j].second){
            if(r[k].second>ymax){yindex=k;ymax=r[k].second;f=1;}
        }
        if(f){ans++;af[yindex]=false;break;}
      }
      else{continue;}
    }
  }
  cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:7: error: expected '}' before 'else'
   32 |       else{continue;}
      |       ^~~~
a.cc:22:39: note: to match this '{'
   22 |       if(r[i].first<b[j].first&&af[i]){
      |                                       ^