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

#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>

using namespace std;
using LLONG = long long;
const LLONG MOD = 1000000007;

int Cin()
{
    int n;
    cin >> n;
    return n;
}

class MaxFlowCalc
{
private:
    // 辺を表す構造体
    struct Edge
    {
        int To;     // 行き先
        int Cap;    // 容量
        int Rev;    // 逆辺
    };

    vector<vector<Edge>> m_graph;
    vector<bool> m_usedFlags;

    const int DFS(const int v, const int t, const int f)
    {
        if (v == t) return f;
        m_usedFlags[v] = true;
        for (Edge &edge : m_graph[v])
        {
            if (!m_usedFlags[edge.To] && edge.Cap > 0)
            {
                const int d = DFS(edge.To, t, min(f, edge.Cap));
                if (d > 0)
                {
                    edge.Cap -= d;
                    m_graph[edge.To][edge.Rev].Cap += d;
                    return d;
                }
            }
        }
        return 0;
    }

public:
    MaxFlowCalc(const int N)
    {
        m_graph = vector<vector<Edge>>(N);
        m_usedFlags = vector<bool>(N);
    }

    void AddEdge(const int from, const int to, const int capacity)
    {
        Edge F, T;
        F.To = to;
        F.Cap = capacity;
        F.Rev = m_graph[to].size();
        m_graph[from].push_back(F);
        T.To = from;
        T.Cap = 0;
        T.Rev = m_graph[from].size() - 1;
        m_graph[to].push_back(T);
    }

    const int MaxFlow(const int source, const int target)
    {
        int flow = 0;
        for (;;)
        {
            for (auto &flag : m_usedFlags) flag = false;
            int f = DFS(source, target, 1e9);
            if (f == 0) return flow;
            flow += f;
        }
    }
};

int main()
{
    // 二部グラフの最大マッチング問題
    // 最大流問題として解く
    int N = Cin();
    vector<int> as(N), bs(N), cs(N), ds(N);
    for (int i = 0; i < N; ++i) cin >> as[i] >> bs[i];
    for (int i = 0; i < N; ++i) cin >> cs[i] >> ds[i];
    // Flow Networkを構築：ソース→赤→青→ターゲットとつなぐ
    MaxFlowCalc mfc(2 * N + 2);
    for (int r = 0; r < N; ++r) mfc.AddEdge(0, r + 1, 1);
    for (int b = 0; b < N; ++b) mfc.AddEdge(N + b + 1, 2 * N + 1, 1);
    for (int r = 0; r < N; ++r)
    {
        for (int b = 0; b < N; ++b)
        {
            if (as[r] < cs[b] && bs[r] < ds[b])
            {
                mfc.AddEdge(r + 1, N + b + 1, 1);
            }
        }
    }
    // 最大流＝最大マッチング数
    cout << mfc.MaxFlow(0, 2 * N + 1) << endl;
}


Compiler output:
a.cc: In member function 'const int MaxFlowCalc::MaxFlow(int, int)':
a.cc:82:31: error: cannot bind non-const lvalue reference of type 'std::_Bit_reference&' to an rvalue of type 'std::_Bit_iterator::reference'
   82 |             for (auto &flag : m_usedFlags) flag = false;
      |                               ^~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  ll n;
  cin>>n;
  vvll a(n,vll(2)),b(n,vll(2));
  rep(i,n){
    cin>>a[i][0]>>a[i][1];
  }
  rep(i,n){
    cin>>b[i][0]>>b[i][1];
  }
  sort(all(a));
  sort(all(b));
  ll ans=0;
  ll cu=0;
  rep(i,n){
    ll f=b[i][0];
    ll d=-1;
    ll s=0;
    for(int j=0;j<a.size();j++){
      if(a[j][0]>b[i][0]) break;
      if(d<a[j][1]&&a[j][1]<b[i][1]){
       d=a[j][0];
       s=j;
      }
    }
    if(d!=-1){
      erase(a[s]);
      ans++;
    }
  }
  COUT(ans);
}
    
    
      
      


Compiler output:
a.cc: In function 'int main()':
a.cc:60:7: error: 'erase' was not declared in this scope
   60 |       erase(a[s]);
      |       ^~~~~
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  ll n;
  cin>>n;
  vvll a(n,vll(2)),b(n,vll(2));
  rep(i,n){
    cin>>a[i][0]>>a[i][1];
  }
  rep(i,n){
    cin>>b[i][0]>>b[i][1];
  }
  sort(all(a));
  sort(all(b));
  ll ans=0;
  ll cu=0;
  rep(i,n){
    ll f=b[i][0];
    ll d=-1;
    ll s=0;
    for(int j=0;j<a.size();j++){
      if(a[j][0]>b[i][0]) break;
      if(d<a[j][1]&&a[j][1]<b[i][1]){
       d=a[j][0];
       s=j;
      }
    }
    if(d!=-1){
      erase(a[s]);
      ans++;
    }
  }
  COUT(ans);
}
    
    
      
      

Compiler output:
a.cc: In function 'int main()':
a.cc:59:7: error: 'erase' was not declared in this scope
   59 |       erase(a[s]);
      |       ^~~~~
Language: C++

#include <bits/stdc++.h>
#include <algorithm>

using namespace std;

int main(){
  int N;
  
  int a[110],b[110],c[110],d[110];
  
  cin >> N;
  
   vector<pair<int,int>> p1(N);
  
  vector<pair<int,int>> p2(N);
  
  for(int i=0;i<N;i++){
  cin >> a[i] >> b[i] ;
    
    p1[i] = make_pair(b[i],a[i]);
  }
  
  for(int i=0;i<N;i++){
    cin >> c[i] >> d[i] ;
    
    p2[i] = make_pair(c[i],d[i]);
  }
  
 sort(p1.begin(),p1.end(),greater<pair<int,int>>());
  
  sort(p2.begin(),p2.end());
  
  int ans = 0;
  
  for(int i=0;i<n;i++){
    
    for(int j=0;j<n;j++){
      
      if(p1[i].second<p2[j].first&&p1[i].first<p2[j].second){
        
        ans++;
        p2[j]=make_pair(-1e9,-1e9);
        
        break;
      }
    }
  }
  
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:17: error: 'n' was not declared in this scope
   35 |   for(int i=0;i<n;i++){
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  int a[n],b[n],c[n],d[n];
  int e=0;
  for (int iii = 0; iii < n; iii++) {
    cin >> a[iii];
    cin >> b[iii];
  }
  for (int ii = 0; ii < n; ii++) {
    cin >> c[ii];
    cin >> d[ii];
  }
  int tmp;
  for (i=0; i<n; ++i) {
    for (j=i+1; j<n; ++j) {
      if (a[i] < a[j]) {
        tmp =  a[i];
        a[i] = a[j];
        a[j] = tmp;
      }
    }
  }
  for (i=0; i<n; ++i) {
    for (j=i+1; j<n; ++j) {
      if (b[i] < b[j]) {
        tmp =  b[i];
        b[i] = b[j];
        b[j] = tmp;
      }
    }
  }
  for (i=0; i<n; ++i) {
    for (j=i+1; j<n; ++j) {
      if (c[i] < c[j]) {
        tmp =  c[i];
        c[i] = c[j];
        c[j] = tmp;
      }
    }
  }
  for (i=0; i<n; ++i) {
    for (j=i+1; j<n; ++j) {
      if (d[i] < d[j]) {
        tmp =  d[i];
        d[i] = d[j];
        d[j] = tmp;
      }
    }
  }
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      if(a[i]<c[i]&&b[j]<d[j]){
        b[j]=-1;
        d[j]=-1;
        e++;
        break;
      }
    }
  }
  cout << e << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:8: error: 'i' was not declared in this scope
   17 |   for (i=0; i<n; ++i) {
      |        ^
a.cc:18:10: error: 'j' was not declared in this scope
   18 |     for (j=i+1; j<n; ++j) {
      |          ^
a.cc:26:8: error: 'i' was not declared in this scope
   26 |   for (i=0; i<n; ++i) {
      |        ^
a.cc:27:10: error: 'j' was not declared in this scope
   27 |     for (j=i+1; j<n; ++j) {
      |          ^
a.cc:35:8: error: 'i' was not declared in this scope
   35 |   for (i=0; i<n; ++i) {
      |        ^
a.cc:36:10: error: 'j' was not declared in this scope
   36 |     for (j=i+1; j<n; ++j) {
      |          ^
a.cc:44:8: error: 'i' was not declared in this scope
   44 |   for (i=0; i<n; ++i) {
      |        ^
a.cc:45:10: error: 'j' was not declared in this scope
   45 |     for (j=i+1; j<n; ++j) {
      |          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
constexpr int64_t mod=1e9+7;

int main()
{
  int n;
  cin>>n;
  vector<tuple<int, int, bool>> red(n), blue(n);
  for (int i = 0; i < n; ++i)
  {
    cin>>get<0>(red[i])>>get<1>(red[i]);
    get<2>(red[i])=true;
  }
  for(int i=0; i < n; ++i) {
    cin>>get<0>(blue[i])>>get<1>(blue[i]);
    get<2>(blue[i])=true;
  }

  int cnt=0,cnt2=0;
  sort(red.begin(), red.end());
  sort(blue.begin(), blue.end());
  reverse(blue.begin(), blue.end());
  for (int i = 0; i < n; ++i)
  {
    for (int j = 0; j < n; ++j)
    {
      if(get<0>(blue[i]) > get<0>(red[j]) && 
        get<1>(blue[i]) > get<1>(red[j]) &&
        get<2>(blue[i]) && get<2>(red[j]) )
      {
        get<2>(blue[i])=false;
        get<2>(red[j])=false;
        cnt++;
      }
    }
  }

  for (int i = 0; i < n; ++i)
  {
    get<2>(red[i])=true;
    get<2>(blue[i])=true;
    swap(get<0>(red[i]),get<1>(red[i]));
    swap(get<0>(blue[i]),get<1>(blue[i]));
  }


  sort(red.begin(), red.end());
  sort(blue.begin(), blue.end());
  reverse(blue.begin(), blue.end())
  for (int i = 0; i < n; ++i)
  {
    for (int j = 0; j < n; ++j)
    {
      if(get<0>(blue[i]) > get<0>(red[j]) && 
        get<1>(blue[i]) > get<1>(red[j]) &&
        get<2>(blue[i]) && get<2>(red[j]) )
      {
        get<2>(blue[i])=false;
        get<2>(red[j])=false;
        cnt2++;
      }
    }
  }


  cout<<max(cnt,cnt2);
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:36: error: expected ';' before 'for'
   50 |   reverse(blue.begin(), blue.end())
      |                                    ^
      |                                    ;
   51 |   for (int i = 0; i < n; ++i)
      |   ~~~                               
a.cc:51:19: error: 'i' was not declared in this scope
   51 |   for (int i = 0; i < n; ++i)
      |                   ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int main(){
  int n;
  cin>>n;
  vector<pair<int,int>> red,blue;
  int a,b,c,d;
  REP(i,n){
    cin>>a>>b;
    red.push_back(make_pair(a,b));
  }
  REP(i,n){
    cin>>c>>d;
    blue.push_back(make_pair(c,d));
  }
  vector<bool> used(n,false);
  sort(red.begin(),red.end());
  sort(blue.begin(),blue.end());
  
  int l=200,d=200;
  int opt=-1;
  REP(i,n){
    REP(j,n){
      if(red[i].first>=blue[j].first || red[i].second>=blue[j].second){
        continue;
      }else{
        if(used[j]){
          continue;
        }else{
          if(blue[j].first<=l && blue[j].second<=d){
            l=blue[j].first;
            d=blue[j].second;
            opt=j;
          }
        }
      }
    }
    l=d=200;
    if(opt==-1){
      continue;
    }else{
      used[j]=true;
      opt=-1;
    }
  }
  int ans=0;
  REP(i,n){
    if(used[i]){
      ans++;
    }
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:106:13: error: redeclaration of 'int d'
  106 |   int l=200,d=200;
      |             ^
a.cc:93:13: note: 'int d' previously declared here
   93 |   int a,b,c,d;
      |             ^
a.cc:128:12: error: 'j' was not declared in this scope
  128 |       used[j]=true;
      |            ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

int V;
const int MAX_V=200;
vector<int> G[MAX_V];
vector<int> match1, match2;
bool used[MAX_V];
int n,m;

void add_edge(int u, int v){
    G[u].pb(v); G[v].pb(u);
}

bool dfs(int v){
    if(used[v]) return false;
    used[v]=true;
    for(int &to : G[v]){
        if(match2[to]==-1||dfs(match2[to])){
            match1[v]=to;
            match2[to]=v;
            return true;
        }
    }
    return false;
}

int bipartite_matching(){
    int res=0;
    match1(n,-1); match2(m,-1);
    bool upd=true;
    while(upd){
        upd=false;
        rep(v,0,n) if(match1[v]==-1 && dfs(v)) upd=true, ++res;
        if(upd) fill(used,used+V,false);
    }
    return res;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N;
    cin>>N;
    n=N; m=N;
    int a[N], b[N], c[N], d[N];
    rep(i,0,N) cin>>a[i]>>b[i];
    rep(i,0,N) cin>>c[i]>>d[i];
    rep(i,0,N){
        rep(j,0,N){
            if(a[i]<c[j]&&b[i]<d[j]) add_edge(i,j+N);
        }
    }
    cout <<bipartite_matching()<<"\n";
}

Compiler output:
a.cc: In function 'int bipartite_matching()':
a.cc:43:11: error: no match for call to '(std::vector<int>) (int&, int)'
   43 |     match1(n,-1); match2(m,-1);
      |     ~~~~~~^~~~~~
a.cc:43:25: error: no match for call to '(std::vector<int>) (int&, int)'
   43 |     match1(n,-1); match2(m,-1);
      |                   ~~~~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

int V;
const int MAX_V=200;
vector<int> G[MAX_V];
int match1[MAX_V], match2[MAX_V];
bool used[MAX_V];
void add_edge(int u, int v){
    G[u].pb(v); G[v].pb(u);
}

bool dfs(int v){
    if(used[v]) return false;
    used[v]=true;
    for(int &to : G[v]){
        if(match2[to]==-1||dfs(match2[to])){
            match1[v]=to;
            match2[to]=v;
            return true;
        }
    }
    return false;
}

int bipartite_matching(){
    int res=0;
    memset(match1, -1, sizeof(match1));
    memset(match2, -1, sizeof(match2));
    bool upd=true;
    while(upd){
        upd=false;
        rep(v,0,V) if(match1[v]==-1 && dfs(v)) upd=true, ++res;
        if(upd) fill(used,used+V, false;);
    }
    return res;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N;
    cin>>N;
    V=2*N;
    int a[N], b[N], c[N], d[N];
    rep(i,0,N) cin>>a[i]>>b[i];
    rep(i,0,N) cin>>c[i]>>d[i];
    rep(i,0,N){
        rep(j,0,N){
            if(a[i]<c[j]&&b[i]<d[j]) add_edge(i,j+N);
        }
    }
    cout <<bipartite_matching()<<"\n";
}

Compiler output:
a.cc: In function 'int bipartite_matching()':
a.cc:47:40: error: expected ')' before ';' token
   47 |         if(upd) fill(used,used+V, false;);
      |                     ~                  ^
      |                                        )
a.cc:47:41: error: expected primary-expression before ')' token
   47 |         if(upd) fill(used,used+V, false;);
      |                                         ^
Language: C++

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

using namespace std;

int main(void) {
	int num, i = 0, a, b, ans = 0;
	cin >> num;
	vector<int> d(2 * num), red(num), blue(num);
	vector<bool> ok(num, true);
	for (; i < num; i++) {
		scanf("%d%d", &a, &b);
		d[a] = b;
		red[i] = a;
	}
	for (i = 0; i < num; i++) {
		scanf_s("%d%d", &a, &b);
		d[a] = b;
		blue[i] = a;
	}
	sort(red.begin(), red.end());
	sort(blue.begin(), blue.end());
	for (b = 0; b < num; b++) {
		for (a = 0; a < num && red[a] < blue[b]; a++) {
			if (ok[a] && d[red[a]] < d[blue[b]]) {
				ok[a] = false;
				ans++;
				break;
			}
		}
	}
	cout << ans << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   18 |                 scanf_s("%d%d", &a, &b);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

struct BipartiteMatching {
    vector<vector<int>> E; int n, m; vector<int> match, dist;
    void init(int _n,int _m){n=_n,m=_m;E.resize(n+m+2);match.resize(n+m+2);dist.resize(n+m+2);}
    bool bfs() {
        queue<int> que;
        rep(i, 1, n + 1) {
            if (!match[i]) dist[i] = 0, que.push(i);
            else dist[i] = inf;
        }
        dist[0] = inf;
        while (!que.empty()) {
            int u = que.front(); que.pop();
            if (u) fore(v, E[u]) if (dist[match[v]] == inf) {
                dist[match[v]] = dist[u] + 1;
                que.push(match[v]);
            }
        }
        return (dist[0] != inf);
    }
    bool dfs(int u) {
        if (u) {
            fore(v, E[u]) if (dist[match[v]] == dist[u] + 1) if (dfs(match[v])) {
                match[v] = u; match[u] = v;
                return true;
            }
            dist[u] = inf;
            return false;
        }
        return true;
    }
    void add(int a, int b) { b += n; E[a + 1].push_back(b + 1); E[b + 1].push_back(a + 1); }
    int whois(int x) { return match[x + 1] - 1; }
    int solve() {
        rep(i, 0, n + m + 1) match[i] = 0;
        int res = 0;
        while (bfs()) rep(i, 1, n + 1) if (!match[i] && dfs(i)) res++;
        return res;
    }
};

int N, A[101], B[101], C[101], D[101];

void _main() {
    cin >> N;
    rep(i, 0, N) cin >> A[i] >> B[i];
    rep(i, 0, N) cin >> C[i] >> D[i];

    BipartiteMatching bm;
    bm.init(N, N);
    rep(i, 0, N) rep(j, 0, N) {
        if (A[i] < C[j] and B[i] < D[j]) bm.add(i, j);
    }
    cout << bm.solve() << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'void _main()':
a.cc:66:10: error: return-statement with a value, in function returning 'void' [-fpermissive]
   66 |   return 0;
      |          ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

struct BipartiteMatching {
    vector<vector<int>> E; int n, m; vector<int> match, dist;
    void init(int _n,int _m){n=_n,m=_m;E.resize(n+m+2);match.resize(n+m+2);dist.resize(n+m+2);}
    bool bfs() {
        queue<int> que;
        rep(i, 1, n + 1) {
            if (!match[i]) dist[i] = 0, que.push(i);
            else dist[i] = inf;
        }
        dist[0] = inf;
        while (!que.empty()) {
            int u = que.front(); que.pop();
            if (u) fore(v, E[u]) if (dist[match[v]] == inf) {
                dist[match[v]] = dist[u] + 1;
                que.push(match[v]);
            }
        }
        return (dist[0] != inf);
    }
    bool dfs(int u) {
        if (u) {
            fore(v, E[u]) if (dist[match[v]] == dist[u] + 1) if (dfs(match[v])) {
                match[v] = u; match[u] = v;
                return true;
            }
            dist[u] = inf;
            return false;
        }
        return true;
    }
    void add(int a, int b) { b += n; E[a + 1].push_back(b + 1); E[b + 1].push_back(a + 1); }
    int whois(int x) { return match[x + 1] - 1; }
    int solve() {
        rep(i, 0, n + m + 1) match[i] = 0;
        int res = 0;
        while (bfs()) rep(i, 1, n + 1) if (!match[i] && dfs(i)) res++;
        return res;
    }
};

int N, A[101], B[101], C[101], D[101];

int main() {
    cin >> N;
    rep(i, 0, N) cin >> A[i] >> B[i];
    rep(i, 0, N) cin >> C[i] >> D[i];

    BipartiteMatching bm;
    bm.init(N, N);
    rep(i, 0, N) rep(j, 0, N) {
        if (A[i] < C[j] and B[i] < D[j]) bm.add(i, j);
    }
    cout << bm.solve() << endl;
  
  return 0;
}


Compiler output:
a.cc:54:5: error: redefinition of 'int main()'
   54 | int main() {
      |     ^~~~
a.cc:7:40: note: 'int main()' previously defined here
    7 | using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
      |                                        ^~~~
Language: C

#include<bits/stdc++.h>
#define x2 (r[i].x-b[j].x)*(r[i].x-b[j].x)
#define y2 (r[i].y-b[j].y)*(r[i].y-b[j].y)
#define INF 1000000
using namespace std;
struct tb{
	int x,y;
}r[110],b[110];
int n,ans;
bool f[110];
double d[110][110];
bool cmp1(tb c,tb d){
	return c.y<d.y;
}
bool cmp2(tb c,tb d){
	return c.x<d.x;
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d %d",&r[i].x,&r[i].y);
	for(int i=1;i<=n;i++)scanf("%d %d",&b[i].x,&b[i].y);
	sort(r,r+n+1,cmp1);
	sort(r,r+n+1,cmp2);
	for(int i=1;i<=n;i++){
 		int minn=1;
		for(int j=1;j<=n;j++){
			if(f[j])d[i][j]=INF;
			else 
			d[i][j]=sqrt(x2+y2);
			if(r[i].x>b[j].x||r[i].y>b[j].y)d[i][j]=INF;
			if(d[i][j]<d[i][minn]&&!f[j])minn=j;
		}
		if(d[i][minn]==INF);
		else {
			ans++;
			f[minn]=1;
		}
	}
	printf("%d",ans);
	return 0;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
struct node{
	int x,y;
}a[100005],b[100005];
int p[10005];
int cmp1(node a,node b){
	return a.x>b.x;
}
int cmp1(node a,node b){
	return a.y<b.y;
}
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>a[i].x>>a[i].y;
	for(int i=0;i<n;i++)
		cin>>b[i].x>>b[i].y;
	sort(a,a+n,cmp1);
	sort(b,b+n,cmp2);
	int sum=0;
	int cnt=0;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			if(a[i].x<b[j].x&&a[i].y<b[j].y&&p[j]==0){
				sum++;
				p[j]=1;
				break;
			}
		}
	}
	cout<<sum<<endl;
	
}

Compiler output:
a.cc:10:5: error: redefinition of 'int cmp1(node, node)'
   10 | int cmp1(node a,node b){
      |     ^~~~
a.cc:7:5: note: 'int cmp1(node, node)' previously defined here
    7 | int cmp1(node a,node b){
      |     ^~~~
a.cc: In function 'int main()':
a.cc:21:20: error: 'cmp2' was not declared in this scope; did you mean 'cmp1'?
   21 |         sort(b,b+n,cmp2);
      |                    ^~~~
      |                    cmp1
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <map>
#include <deque>
using namespace std;

#define REP(i,n) for(int i = 0; i < n; i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef pair<string,string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pi> vpi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

double EPS = 1e-9;
int INFi = 1000000005;
long long INFll = 1000000000000000005ll;
double PI = acos(-1);
int dirx[8] = {-1,0,0,1,-1,-1,1,1};
int diry[8] = {0,1,-1,0,-1,1,-1,1};
ll MOD = 1000000007;

// ford-fulkerson O(FE) F:Flow
// maximum flow problem
// 1. init G[V] by add_edge
// 2. max_flow(s, t) return the max flow

const int MAX_V = 100000;

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, sizeof(used));
    int f = dfs(s, t, INFi);
    if(f == 0) return flow;
    flow += f;
  }
}

const int MAX_N = 100;
int n;
int a[MAX_N], b[MAX_N], c[MAX_N], d[MAX_N];

int main(){
  cin >> n;
  REP(i, n) cin >> a[i] >> b[i];
  REP(i, n) cin >> c[i] >> d[i];

  int src = 2 * n;
  int dst = 2 * n + 1;

  REP(i, n) add_edge(src, i, 1);
  REP(i, n) add_edge(n + i, dst, 1);

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

  cout << max_flow(src, dst) << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int max_flow(int, int)':
a.cc:68:5: error: 'memset' was not declared in this scope
   68 |     memset(used, 0, sizeof(used));
      |     ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <map>
  +++ |+#include <cstring>
    8 | #include <deque>
Language: C++

n = int(input())
red =[]
blue =[]
for i in range(n):
    x, y = map(int, input().split(' '))
    red.append(x + y*1000)
for i in range(n):
    x, y = map(int, input().split(' '))
    blue.append(x*1000 + y)
red.sort()
blue.sort()
ans = 0
red = red[::-1]
for b in blue:
    flag = True
    for r in red:
        if (r%1000 < b//1000) and (r//1000 < b%1000) and flag:
            flag = False
            red[red.index(r)]=9999999999
            ans +=1
print(ans)

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

#include "pch.h"
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <limits.h>
using namespace std;
typedef pair<int, int> P;
#define INF LLONG_MAX/3
#define inf INT_MAX/3
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
int gcd(int a, int b) {
	if (b == 0)return a;
	return gcd(b, a%b);
}
int lcm(int a, int b) {
	return a / gcd(a, b)*b;
}
bool prime(int p) {
	for (int i = 2;i <= sqrt(p);i++) {
		if (p%i == 0)return false;
	}
	return true;
}
int modpow(int a, int b) {
	if (b == 0)return 1;
	if (b == 1)return a % MOD;
	if (b % 2)return modpow(a, b - 1)*a%MOD;
	else return modpow(a, b / 2)*modpow(a, b / 2) % MOD;
}
int comb(int a, int b) {
	if (b == 0 || a == b)return 1;
	if (b == 1)return a % MOD;
	return (comb(a - 1, b - 1) + comb(a - 1, b)) % MOD;
}
// Library End !
int n, ans = 0;
pair<int, int>red[114];
pair<int, int>blue[114];
bool a[114];
int main() {
	cin >> n;
	rep(i, n)cin >> red[i].first >> red[i].second;
	rep(i, n)cin >> blue[i].first >> blue[i].second;
	sort(blue, blue + n);
	rep(i, n)a[i] = true;
	rep(i, n) {
		int p = -114514;
		int ma = -114514;
		rep(j, n) {
			if (red[j].first < blue[i].first&&red[j].second < blue[i].second&&ma <= red[j].second&&a[j] == true) {
				p = j;
				ma = red[j].second;
			}
		}
		if (p != -114514) {
			a[p] = false;
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>

using namespace std;

typedef pair<int, int> p;

int main(void) {
    int N;
    cin >> N;
    vector<p> red, blue;
    for (int i = 0; i < N; ++i) {
        int a, b;
        cin >> a >> b;
        red.push_back(make_pair(a, b));
    }
    for (int i = 0; i < N; ++i) {
        int c, d;
        cin >> c >> d;
        blue.push_back(make_pair(c, d));
    }

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

    int cnt = 0;
    bool flag[N];
    for (auto b:blue) {
        int maxtmp = -1;
        int argmax = -1;
        for (int i = 0; i < N; ++i) {
            if (red[i].first > b.first) break;
            if (red[i].second < b.second && !flag[i]) {
                if (red[i].second > maxtmp) {
                    argmax = i;
                    maxtmp = red[i].second;
                }
            }
        }
        if (argmax >= 0) {
            flag[argmax] = true;
            cnt++;
        }
    }

    cout << cnt << endl;
    return 0;
}

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

#include<cstdio>
#include<queue>
using namespace std;

const int N=100,inf=0x5FFFFFFF;
struct node
{
	int x,y;
}R[N+5],B[N+5];
int n,ans;
bool vis[N+5];
int Ma[N+5][N+5],fa[N+5];

int Dfs(int u)
{
	for(int v=1;v<=n;v++)
		if(Ma[u][v]&&!vis[v])
		{
			vis[v]=1;
			if(fa[v]==-1||Dfs(fa[v]))
			{
				fa[v]=u;
				return true;
			}
		}
	return false;
}

void Solve()
{
	memset(fa,-1,sizeof(fa));
	for(int i=1;i<=n;i++)
	{
		memset(vis,0,sizeof(vis));
		ans+=Dfs(i);
	}
}

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d %d",&R[i].x,&R[i].y);
	for(int i=1;i<=n;i++)
	{
		scanf("%d %d",&B[i].x,&B[i].y);
		for(int j=1;j<=n;j++)
			if(R[j].x<B[i].x&&R[j].y<B[i].y)
				Ma[j][i]=1;
	}
	Solve();
	printf("%d\n",ans);
	return 0;
}

Compiler output:
a.cc: In function 'void Solve()':
a.cc:31:9: error: 'memset' was not declared in this scope
   31 |         memset(fa,-1,sizeof(fa));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<queue>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
vector<int>g[205];
int m,n,ans,mat[205];
bool vis[205];
struct mzls
{
	int x,y;
}a[205],b;
inline bool dfs(int x)
{
	for(int i=0;i<g[x].size();i++)
	{
		int v=g[x][i];
		if(vis[v])
			continue;
		vis[v]=1;
		if(!mat[v]||dfs(mat[v]))
		{
			mat[v]=x;
			return 1;
		}
	}
	return 0;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=2*n;i++)
		scanf("%d%d",&a[i].x,&a[i].y);
	for(int i=1;i<=n;i++)
		for(int j=n+1;j<=2*n;j++)
			if(a[i].x<a[j].x&&a[i].y<a[j].y)
			{
				g[i].push_back(j);
				g[j].push_back(i);
			}
	for(int i=1;i<=n;i++)
	{
		memset(vis,0,sizeof(vis));
		ans+=dfs(i);
	}
	printf("%d",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:17: error: 'memset' was not declared in this scope
   42 |                 memset(vis,0,sizeof(vis));
      |                 ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cctype>
#include <functional>
#include <map>
using namespace std;
typedef long long ll;

#define reps(i,s,n) for(int (i) = (s); (i) < (n); (i)++)
#define rep(i,n) reps(i,0,n)
const int INF = 1e9;

struct edge{int to,cap,rev;};
const int MAX_V = 1e4;
vector<edge> G[MAX_V];
bool used[MAX_V];

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

int dfs(int v,int t,int f){
    if(v == t) return f;
    used[v] = true;
    rep(i,G[v].size()){
        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 n;
vector<int> X,Y;

int main(){
    cin >> n;
    X.resize(2*n);
    Y.resize(2*n);
    rep(i,2*n){
        cin >> X[i] >> Y[i];
    }
    int s = 2*n+1 ,t = 2*n+2;
    rep(i,n){
        add_edge(s,i,1);//s -> 赤い点
        add_edge(i+n,t,1);//青い点-> t
    }
    rep(i,n){
        rep(j,n){
            if(X[i] < X[j+n] && Y[i] < Y[j+n]){
                add_edge(i,j+n,1);
            }
        }
    }
    cout << max_flow(s,t) << endl;

    return 0;
}

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

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

int main(){
    int n,tx,ty;
    cin >> n;

    vector<pii> ab(n),cd(n);
    for(int i = 0; i < n; i++){
        cin >> tx >> ty;
        ab[i].first = tx;
        ab[i].second = ty;
    }
    for(int i = 0; i < n; i++){
        cin >> tx >> ty;
        cd[i].first = tx;
        cd[i].second = ty;
    }
    sort(ab.begin(),ab.end());
    sort(cd.begin(),cd.end());
    int ans = 0;
    int x, y, ymax, idx;
    for(int i = 0; i < n; i++){
        ymax = -1;
        for(int j = 0; j < n; j++){
            x = cd[i].first - ab[j].first;
            y = cd[i].second - ab[j].second;
            if(x>0 && y>0 && ymax<ab[j].second){
                ymax = ab[j].second;
                idx = j;
            }
        }
        if(ymax != -1){
            ab[idx].first = 999;
            ab[idx].second = 999;
            ans++;
        }
    cout << ans << endl;
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<string.h> 
#include<map>
#include<math.h>
#include<string>
#include<algorithm>
#include<queue>
#include<vector>
#include<stdio.h>
using namespace std;
bool cheak(int a){
int n=0;
for(int i=1;i<=a;i++){
if(a%i==0){
n++;}
if (n==2){
cout<<a<<endl;}}
}
int main(){
int g;
cin>>g;
int a[1000];
for(int i=1;i<=1000;i++){
for(int j=0;j<1000;j++)
if(cheakprime[i])
i=a[j];}
for(int k=1;k<=1000;k++)
for(int h=2;h<=h+1;h++){
if (a[k]+a[h]+1==g) cout<<"yes";
else cout<<"no"; }
system("pause");
return 0;
}


Compiler output:
a.cc: In function 'bool cheak(int)':
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | }
      | ^
a.cc: In function 'int main()':
a.cc:25:4: error: 'cheakprime' was not declared in this scope
   25 | if(cheakprime[i])
      |    ^~~~~~~~~~
Language: C++

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>
#include <set>

using namespace std;

typedef long long ll;

const int MAX_V = 2*100+2;
const int INF = 2;

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;
  while(1){
    memset(used, 0, sizeof used);
    int f = dfs(s, t, INF);
    if(f == 0)  return flow;
    flow += f;
  }
}

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int N; cin >> N;
  int x[2*N+1], y[2*N+1];
  for(int i=1;i<=2*N;i++){
    cin >> x[i] >> y[i];
  }
  for(int i=1;i<=N;i++){
    for(int j=N+1;j<=2*N;j++){
      if(x[i] < x[j] && y[i] < y[j]){
        add_edge(i, j, 1);
      }
    }
  }
  // s=0, t=2*N+1
  for(int i=1;i<=N;i++){
    add_edge(0, i, 1);
  }
  for(int j=N+1;j<=2*N;j++){
    add_edge(j, 2*N+1, 1);
  }
  
  cout << max_flow(0, 2*N+1) << endl;
}

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

def dfs(v):
    if was[v] == clr: return 0
    was[v] = clr
    for u in g[v]:
        if mt[u] == -1 or dfs(mt[u]):
            mt[u] = v
            return 1
    return 0

read = lambda: map(int, input().split())
n = int(input())
n2 = n * 2
a = [0] * n2
b = [0] * n2
g = [list() for i in range(n2)]
for i in range(n):
    a[i], b[i] = read()
for i in range(n):
    a[i+n], b[i+n] = read()
for i in range(n):
    for j in range(n, n2):
        if a[i] < a[j] and b[i] < b[j]:
            g[i].append(j)
            g[j].append(i)
mt = [-1] * n2
was = [0] * n2
clr = 1
ans = 0
for i in range(n):
    if dfs(i):
        ans += 1
        clr += 1
print(ans)

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def dfs(v):
      | ^~~
Language: Java

import java.math.BigInteger;
import java.util.*;

public class Main {


    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a[] = new int[n + 1];
        int b[] = new int[n + 1];
        for (int i = 1; i <= n; i++)
            a[i] = in.nextInt();

        for (int i = 1; i <= n; i++) {
            b[i] = in.nextInt();
        }
        int sum=0;int ans=0;int cnt=0;
          for(int i=1;i<=n;i++)
              for(int j=1;j<=n;j++)
              {
                  sum=a[i]+b[j];
                  cnt++;
                  if(cnt==1)ans=sum+0;
                  else
                  ans^=sum;
              }
              System.out.println(ans);

    }


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

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#define MAX_N 210
using namespace std;

int N;
int coox[MAX_N], cooy[MAX_N];
bool f[MAX_N][MAX_N], vis[MAX_N];
int match[MAX_N];x
int res;

bool dfs (int);

int main () {
    scanf("%d", &N);
    for (int i = 1;i <= 2 * N; ++i) scanf("%d%d", coox + i, cooy + i);
    for (int i = 1;i <= N; ++i)
	for (int j = N + 1;j <= 2 * N; ++j)
	    if (coox[i] < coox[j] && cooy[i] < cooy[j]) {
		f[i][j - N] = true;
	    }

    for (int i = 1;i <= N; ++i) {
	memset(vis, false, sizeof(vis));
	if (dfs(i)) res++;
    }
    printf("%d\n", res);
    return 0;
}

bool dfs (int x) {
    for (int i = 1;i <= N; ++i) {
	if (!f[x][i] || vis[i]) continue;
	vis[i] = true;
	if (!match[i] || dfs(match[i])) {
	    match[i] = x;
	    return true;
	}
    }
    return false;
}


Compiler output:
a.cc:12:18: error: 'x' does not name a type
   12 | int match[MAX_N];x
      |                  ^
a.cc: In function 'int main()':
a.cc:28:21: error: 'res' was not declared in this scope
   28 |         if (dfs(i)) res++;
      |                     ^~~
a.cc:30:20: error: 'res' was not declared in this scope
   30 |     printf("%d\n", res);
      |                    ^~~
Language: C++

#include<iostream>
using namespace std;
void quicksort(int x[],int y[],int left,int right){
	if (left < right){
		int i=left,j=right;
		int tmp,pivotx,pivotxy;
		if ((x[i]+y[i]>x[j]+y[j])|(x[i]+y[i]==x[j]+y[j])&&(x[i]>x[j]))){
			if(((x[j]+y[j]>x[i+(i-j)/2]+y[i+(i-j)/2])|(x[j]+y[j]==x[i+(i-j)/2]+y[i+(i-j)/2])&&(x[j]>x[i+(i-j)/2]))){
				pivotxy=x[j]+y[j];
				pivotx=y[j];
			}else{
				if(((x[i]+y[i]>x[i+(i-j)/2]+y[i+(i-j)/2])|(x[i]+y[i]==x[i+(i-j)/2]+y[i+(i-j)/2])&&(x[i]>x[i+(i-j)/2]))){
					pivotxy=x[i+(j-i)/2]+y[i+(j-i)/2];
					pivotx=x[i+(j-i)/2];
				}else{
					pivotxy=x[i]+y[i];
					pivotx=x[i];
				}
			}
		}else{
			if(((x[i]+y[i]>x[i+(i-j)/2]+y[i+(i-j)/2])|(x[i]+y[i]==x[i+(i-j)/2]+y[i+(i-j)/2])&&(x[i]>x[i+(i-j)/2]))){
							pivotxy=x[i]+y[i];
							pivotx=x[i];
						}else{
							if(((x[j]+y[j]>x[i+(i-j)/2]+y[i+(i-j)/2])|(x[j]+y[j]==x[i+(i-j)/2]+y[i+(i-j)/2])&&(x[j]>x[i+(i-j)/2]))){
								pivotx=x[i+(j-i)/2];
								pivotxy=x[i+(j-i)/2]+y[i+(j-i)/2];
							}else{
								pivotx=x[j];
								pivotxy=x[j]+y[j];
							}
		    }
	    }
	while (1) { 
		            while ((x[i]+y[i] < pivotxy)|((x[i]+y[i]==pivotxy)&&(x[i]<pivotx))) i++; 
		            while (pivotxy < x[j]+y[j]|((pivotxy ==x[j]+y[j])&&(pivotz<z[j]))) j--; 
		            if (i >= j) break;
		            tmp = x[i]; x[i] = x[j]; x[j] = tmp; 
		            tmp = y[i]; y[i] = y[j]; y[j] = tmp; 
		            i++; j--;
        }
	quicksort(x,y,left,i-1);
	quicksort(x,y,j+1,right);
}
}

int main(){
  int N;
	cin >>N;
	int a[N],b[N],c[N],d[N];
	int i,j;
	int ans=0;
	for(i=0;i<N;i++){
		cin>>a[i]>>b[i];
	}
	for(i=0;i<N;i++){
		cin>>c[i]>>d[i];
	}
	quicksort(a,b,0,N-1);
	quicksort(c,d,0,N-1);
	j=0;
	for(i=0;i<N;i++){
		while((((a[j]+b[j]>c[i]+d[i])|(a[j]+b[j]==c[i]+d[i]))&&(b[i]>d[j]))&&(j<N)){
			j++;
		}
		if(j!=N){
			ans++;
			j++;
		}
	}
	cout<< ans;
	return 0;
}

Compiler output:
a.cc: In function 'void quicksort(int*, int*, int, int)':
a.cc:7:79: error: expected primary-expression before ')' token
    7 |                 if ((x[i]+y[i]>x[j]+y[j])|(x[i]+y[i]==x[j]+y[j])&&(x[i]>x[j]))){
      |                                                                               ^
a.cc:36:81: error: 'pivotz' was not declared in this scope; did you mean 'pivotx'?
   36 |                             while (pivotxy < x[j]+y[j]|((pivotxy ==x[j]+y[j])&&(pivotz<z[j]))) j--;
      |                                                                                 ^~~~~~
      |                                                                                 pivotx
a.cc:36:88: error: 'z' was not declared in this scope
   36 |                             while (pivotxy < x[j]+y[j]|((pivotxy ==x[j]+y[j])&&(pivotz<z[j]))) j--;
      |                                                                                        ^
Language: C++

int gx, gy;

int qqq;

//各座標までの最短距離

int d[100][100];


//移動方向のベクトル

int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };

ll ans = 0;
pair<int, int> red[101], blue[101];

int main() {
	cin >> 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;
	sort(red, red + n);
	int flag[101] = { 0 };
	sort(blue, blue + n);
	int p = 0;
	while (p < n) {
		int sc = 1000, id = -1;
		for (int i = 0; i <n; ++i) {
			if (red[i].first < blue[p].first&&red[i].second < blue[p].second&&flag[i] == 0) {
				if (sc > blue[p].first + blue[p].second - red[i].first - red[i].second) {
					sc = blue[p].first + blue[p].second - red[i].first - red[i].second;
					id = i;
				}
				else if (sc == blue[p].first + blue[p].second - red[i].first - red[i].second) {
					if (abs(red[id].first - red[id].second) > abs(red[i].first - red[i].second))
					{
						sc = blue[p].first + blue[p].second - red[i].first - red[i].second;
						id = i;
					}

				}
			}
		}
		if (id != -1) {
			ans++;
			flag[id] = 1;
		}
		p++;
	}
	cout << ans << endl;
	cin >> qqq;
	return 0;
}

Compiler output:
a.cc:14:1: error: 'll' does not name a type
   14 | ll ans = 0;
      | ^~
a.cc:15:1: error: 'pair' does not name a type
   15 | pair<int, int> red[101], blue[101];
      | ^~~~
a.cc: In function 'int main()':
a.cc:18:9: error: 'cin' was not declared in this scope
   18 |         cin >> n;
      |         ^~~
a.cc:18:16: error: 'n' was not declared in this scope
   18 |         cin >> n;
      |                ^
a.cc:19:44: error: 'red' was not declared in this scope
   19 |         for (int i = 0; i < n; ++i) cin >> red[i].first >> red[i].second;
      |                                            ^~~
a.cc:20:44: error: 'blue' was not declared in this scope
   20 |         for (int i = 0; i < n; ++i) cin >> blue[i].first >> blue[i].second;
      |                                            ^~~~
a.cc:21:14: error: 'red' was not declared in this scope
   21 |         sort(red, red + n);
      |              ^~~
a.cc:21:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   21 |         sort(red, red + n);
      |         ^~~~
      |         short
a.cc:23:14: error: 'blue' was not declared in this scope
   23 |         sort(blue, blue + n);
      |              ^~~~
a.cc:34:45: error: 'abs' was not declared in this scope
   34 |                                         if (abs(red[id].first - red[id].second) > abs(red[i].first - red[i].second))
      |                                             ^~~
a.cc:44:25: error: 'ans' was not declared in this scope
   44 |                         ans++;
      |                         ^~~
a.cc:49:9: error: 'cout' was not declared in this scope
   49 |         cout << ans << endl;
      |         ^~~~
a.cc:49:17: error: 'ans' was not declared in this scope
   49 |         cout << ans << endl;
      |                 ^~~
a.cc:49:24: error: 'endl' was not declared in this scope
   49 |         cout << ans << endl;
      |                        ^~~~