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

#include <bits/stdc++.h>
using namespace std;
typedef bool boool;
typedef long long ll;
#define vl vector<ll>
#define vb vector<boool>
#define vs vector<string>
#define vp vector<pair<ll, ll>>
#define vvl vector<vector<ll>>
#define vvp vector<vector<pair<ll, ll>>>
#define mod 1000000007
#define all(x) x.begin(), x.end()
#define rep1(i, n) for (long long i=0; i<(long long)(n); i++)
#define rep2(i, s, e) for (long long i=(s); i<(long long)(e); i++)
#define GET_MACRO(_1,_2,_3,NAME,...) NAME
#define rep(...) GET_MACRO(__VA_ARGS__, rep2, rep1)(__VA_ARGS__)

int main(){
  int h, w, m;
  cin >> h >> w >> m;
  vector<int> row(300000, 0);
  vector<int> col(300000, 0);
  vector<set> vec(300000);
  rep(i, m){
    int a, b;
    cin >> a >> b;
    a--; b--;
    row[a]++;
    col[b]++;
    vec[a].insert(b);
  }
  int br = 0; bc = 0;
  rep(i, 300000){
    br = max(br, row[i]);
    bc = max(bc, col[i]);
  }
  vector<int> y, x;
  rep(i, 300000){
    if(row[i]==br) y.push_back(i);
    if(col[i]==bc) x.push_back(i);
  }
  bool isExist = false;
  for(auto dy : y){
    for(auto dx : x){
      if(vec[dy].find(dx) == vec[dy].end()) isExist = true;     
    }
  }
  if(isExist) cout << br+bc << endl;
  else cout << br+bc-1 << endl;
  return 0;
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:23:13: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector'
   23 |   vector<set> vec(300000);
      |             ^
a.cc:23:13: note:   expected a type, got 'set'
a.cc:23:13: error: template argument 2 is invalid
a.cc:30:8: error: invalid types 'int[int]' for array subscript
   30 |     vec[a].insert(b);
      |        ^
a.cc:32:15: error: 'bc' was not declared in this scope; did you mean 'br'?
   32 |   int br = 0; bc = 0;
      |               ^~
      |               br
a.cc:45:13: error: invalid types 'int[int]' for array subscript
   45 |       if(vec[dy].find(dx) == vec[dy].end()) isExist = true;
      |             ^
a.cc:45:33: error: invalid types 'int[int]' for array subscript
   45 |       if(vec[dy].find(dx) == vec[dy].end()) isExist = true;
      |                                 ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, ns, ne) for (int i = ns; i < ne; ++i)
using namespace std;

// pair(y,x)と同じ
struct P {
  int y;
  int x;
  P(int _y, int _x) : y(_y), x(_x) {}
  // LHS = left-hand side RHS = right-hand side
  bool operator<(const P &rhs) const {
    // y の値を優先してソートするなら
    return y != rhs.y ? y < rhs.y : x < rhs.x;
  }
};

int main() {

  // 入力
  int H, W, M;
  cin >> H >> W >> M;

  vector<int> hs(H), ws(W);
  set<P> sp;

  rep(i, 0, M) {
    int y, x;
    cin >> y >> x;
    --y, --x;
    hs[y]++, ws[x]++;
    sp.emplace(y, x); //物がある座標
  }

  // 縦横の最大値
  int maxH = *max_element(hs.begin(), hs.end());
  int maxW = *max_element(ws.begin(), ws.end());

  // 縦最大だけのy座標
  vector<int> maxhs;
  rep(i, 0, H) {
    if (maxH == hs[i]) {
      maxhs.emplace_back(i);
    }
  }

  // 横最大だけのx座標
  vector<int> maxws;
  rep(i, 0, W) {
    if (maxW == ws[i]) {
      maxws.emplace_back(i);
    }
  }

// 縦最大と横最大の交点を確認
  int ans = maxH + maxW;
  for (auto yy : maxhs) {
    for (auto xx : maxws) {

      // 交点に物があるか確認
      if (sp.count(P(yy, xx))) {
        continue;
      }
      //交点に物が無い場所があったら終了
      cout << ans << endl;
      return;
    }
  }

  //交点に物が無い場所が無い場合は交差する1点を引く
  ans--;
  cout << ans << endl;
  getchar();
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:7: error: return-statement with no value, in function returning 'int' [-fpermissive]
   65 |       return;
      |       ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
//#define ll long long
//#define ull unsigned long long
const int maxm=3e5+5;
pair<int,int>p[maxm];
int r[maxm],c[maxm];
int n,m,k;
signed main(){
    ios::sync_with_stdio(0);
    cin>>n>>m>>k;
    for(int i=1;i<=k;i++){
        int a,b;cin>>a>>b;
        p[i]={a,b};
        r[a]++,c[b]++;
    }
    map<int,int>aa,bb;
    //标记所有最大行
    int ma1=0;
    for(int i=1;i<=n;i++){
        ma1=max(ma1,r[i]);
    }
    int num1=0;
    for(int i=1;i<=n;i++){
        if(r[i]==ma1){
            num1++;
        }
    }
    //标记所有最大列
    int ma2=0;
    for(int i=1;i<=m;i++){
        ma2=max(ma2,c[i]);
    }
    for(int i=1;i<=m;i++){
        if(c[i]==ma2){
            num2++;
        }
    }
    //
    int cnt=0;
    for(int i=1;i<=n;i++){
        int a=p[i].first;
        int b=p[i].second;
        if(r[a]==ma1&&c[b]==ma2){
            cnt++;
        }
    }
    if(cnt!=num1*num2){
        cout<<ma1+ma2<<endl;
    }else{
        cout<<ma1+ma2-1<<endl;
    }
    return 0;
}
/*
令r[i]为第i行的点数和,
令c[i]为第i列的点数和.
显然答案一定是从最大行和最大列中选一个配对.
需要判断交点处是否被标记.


*/


Compiler output:
a.cc: In function 'int main()':
a.cc:37:13: error: 'num2' was not declared in this scope; did you mean 'num1'?
   37 |             num2++;
      |             ^~~~
      |             num1
a.cc:49:18: error: 'num2' was not declared in this scope; did you mean 'num1'?
   49 |     if(cnt!=num1*num2){
      |                  ^~~~
      |                  num1
Language: C++

#include<bits/stdc++.h>
using namespace std;
//#define int long long
//#define ll long long
//#define ull unsigned long long
const int maxm=3e5+5;
pair<int,int>p[maxm];
int r[maxm],c[maxm];
int n,m,k;
signed main(){
    ios::sync_with_stdio(0);
    cin>>n>>n>>k;
    for(int i=1;i<=k;i++){
        int a,b;cin>>a>>b;
        p[i]={a,b};
        r[a]++,c[b]++;
    }
    map<int,int>aa,bb;
    //标记所有最大行
    int ma1=0;
    for(int i=1;i<=n;i++){
        ma1=max(ma1,r[i]);
    }
    for(int i=1;i<=n;i++){
        if(r[i]==ma1){
            aa[i]=1;
        }
    }
    //标记所有最大列
    ma2=0;
    for(int i=1;i<=m;i++){
        ma2=max(ma2,c[i]);
    }
    for(int i=1;i<=m;i++){
        if(c[i]==ma2){
            bb[i]=1;
        }
    }
    //
    int ok=0;
    for(int i=1;i<=n;i++){
        int a=p[i].first;
        int b=p[i].second;
        if(!aa[a]||!bb[b]){//不是焦点
            ok=1;break;
        }
    }
    if(ok){
        cout<<ma1+ma2<<endl;
    }else{
        cout<<ma1+ma2-1<<endl;
    }
    return 0;
}
/*


*/


Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: 'ma2' was not declared in this scope; did you mean 'ma1'?
   30 |     ma2=0;
      |     ^~~
      |     ma1
Language: C++

#include<iostream>
#include<stdio.h>
#include<string>
#include<stack>
#include<string.h>
#include "/Users/header/stdc++.h"
using namespace std;
int main(){
    int H,W,M;
    cin >> H;
    cin >> W;
    cin >> M;
    map<pair<int,int>,int> C;
    map<int,int> x_var;
    map<int,int> y_var;
    for(int i=0;i<M;i++){
        int x,y;
        cin >> x;
        cin >> y;
        x_var[x-1]++;
        y_var[y-1]++;
        C[make_pair(x-1,y-1)]++;
    }
    vector<int> x_vec(H);
    vector<int> y_vec(W);
    map<int,int> :: iterator it;
    int max_x=0;
    int max_y=0;
    for(it=x_var.begin();it!=x_var.end();it++){
        if(it->second > max_x){
            max_x=it->second;
            x_vec.clear();
            x_vec.push_back(it->first);
        }
        else if(it->second == max_x){
            x_vec.push_back(it->first);
        }
    }
    for(it=y_var.begin();it!=y_var.end();it++){
        if(it->second > max_y){
            max_y=it->second;
            y_vec.clear();
            y_vec.push_back(it->first);
        }
        else if(it->second == max_y){
            y_vec.push_back(it->first);
        }
    }
    int total=max_x+max_y-1;
    for(int i=0;i<x_vec.size();i++){
        for(int j=0;j<y_vec.size();j++){
            if(C[make_pair(x_vec[i],y_vec[j])] == 0){
                cout << total+1 << endl;
                return 0;
            }
        }
    }
    cout << total << endl;
    return 0;
}

Compiler output:
a.cc:6:10: fatal error: /Users/header/stdc++.h: No such file or directory
    6 | #include "/Users/header/stdc++.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include <queue>
#include<map>
#include <cstring>
#include <unordered_map>
#include <unordered_set>
#include<set>

using namespace std;
#define _USE_MATH_DEFINES
# define M_PI 3.14159265358979323846
# define MOD 1000000007
#define ll long long int
#define pii pair<ll, ll>
#define pb push_back
#define MIN -9,223,372,036,854,775
#define N 100005
#define all(v) v.begin(),v.end()

void solve(){
    ll i,j,k,n,ans=0,m,mx=0,my=0,a,b,x,y;
    cin>>n>>m>>k;
    set<pii> s;
    unordered_map<ll, ll> tx,ty;
    vector<ll> vx,vy;
    for(i=0;i<k;i++){
        cin>>a>>b;
        s.insert({a,b});
        tx[a]++;
        ty[b]++;
        if( tx[a]>mx ){
            vx.clear();
            mx=tx[a];
            vx.push_back(a);
        }
        else if(tx[a]==mx){
            vx.push_back(a);
        }
        
        if( ty[b]>my ){
            my=ty[b];
            vy.clear();
            vy.push_back(b);
        }
        else if(ty[b]==my){
            vy.push_back(b);
        }
    }

    if(k<=2){
        cout<<k;
        return;
    }
    ans=mx+my;
    f=0;
    for(i=0;i<vx.size();i++){
        for(j=0;j<vy.size();j++){
            if( s.find({vx[i], vy[j]}) == s.end() ){
                f=1;
                break;
            }
        }
    }
    
    if( !f )
        ans--;
    

    cout<<ans;

}

int main() {
    ll t=1;
	//cin>>t;
	while( t-- ){
	    solve();
	    cout<<"\n";
	}
	return 0;
}

/*
5 5 10
2 5
4 3
2 3
5 5
2 2
5 4
5 3
5 1
3 5
1 4
*/


Compiler output:
a.cc: In function 'void solve()':
a.cc:57:5: error: 'f' was not declared in this scope
   57 |     f=0;
      |     ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include <queue>
#include<map>
#include <cstring>
#include <unordered_map>
#include <unordered_set>
#include<set>

using namespace std;
#define _USE_MATH_DEFINES
# define M_PI 3.14159265358979323846
# define MOD 1000000007
#define ll long long int
#define pii pair<ll, ll>
#define pb push_back
#define MIN -9,223,372,036,854,775
#define N 100005
#define all(v) v.begin(),v.end()

void solve(){
    ll i,j,k,n,ans=0,m,x,y,dx,dy,a,b,mx=0,my=0;
    cin>>n>>m>>k;
    unordered_map<ll, ll> tx,ty;
    vector<vector<ll> > v;
    for(i=0;i<k;i++){
        cin>>a>>b;
        v.push_back({a,b});
        tx[a]++;
        ty[b]++;
        if( tx[a]>ma ){
            mx=tx[a];
            x=a;
        }
        if( ty[b]>my ){
            my=ty[b];
            y=b;
        }
    }

    if(k<=2){
        cout<<k;
        return;
    }
    ans = mx+my;

    for(i=0;i<k;i++){
        if( mx==tx[v[i][0]] && my==ty[v[i][1]] && ans==mx+my ){
            ans--;
        }
        ans = max(ans, tx[v[i][0]] + ty[v[i][1]] - 1 );
    }

    cout<<ans;

}

int main() {
    ll t=1;
	//cin>>t;
	while( t-- ){
	    solve();
	    cout<<"\n";
	}
	return 0;
}

/*
5 5 10
2 5
4 3
2 3
5 5
2 2
5 4
5 3
5 1
3 5
1 4
*/


Compiler output:
a.cc: In function 'void solve()':
a.cc:32:19: error: 'ma' was not declared in this scope; did you mean 'my'?
   32 |         if( tx[a]>ma ){
      |                   ^~
      |                   my
Language: C

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define cs const 
#define fr first 
#define se second
#define ls (now<<1)
#define rs (now<<1|1)
#define mid ((l+r)>>1)
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define low(i) (i&(-i))
#define par pair<int,int>
#define cn(x) memset(x, 0, sizeof(x))
#define rep(i, x, y) for(int i=x; i<=y; ++i)
#define sep(i, x, y) for(int i=x; i>=y; --i)
#define fore(i, x) for(int i=fir[x]; i; i=nex[i])

cs int G = 3;
cs int ff = 2e6 + 1;
cs int inf = 1e9 + 1;
cs int base = 2333;
cs int mod = 1e9 + 7;

map<pair<ll, ll>, ll> vis;
int A[ff][2], h, w, m, x, y, mx1, mx2;
signed main()
{
	cin >> h >> w >> m;
	rep(i, 1, m) cin >> x >> y, A[x][1] ++, A[y][2] ++, vis[mp(x, y)] = 1;
	rep(i, 1, max(h, w)) if(A[mx1][1] < A[i][1]) mx1 = i;
	rep(i, 1, max(h, w)) if(A[mx2][2] < A[i][2]) mx2 = i; 
	cout << A[mx1][1] + A[mx2][2] - vis[mp(mx1, mx2)];
}

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>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
# define mp make_pair
using namespace std;
using ll = long long;
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; }
static const ll INF = 1e17;

int main(){
  optimize_cin();
  int h, w, m; cin >> h >> w >> m;
  vector<int> countx(h, 0), county(w, 0);
  set<P> s;
  rep(i, m){
    int x, y; cin >> x >> y;
    --x; --y;
    ++countx[x];
    ++county[y];
    s.emplace(x, y);
  }

  int maxx = 0, maxy = 0;
  rep(i, h) chmax(maxx, countx[i]);
  rep(i, w) chmax(maxy, county[i]);

  ll ans = maxx + maxy;
  vector<int> goodx, goody;
  rep(i, h) if(countx[i]==maxx) goodx.pb(i);
  rep(i, w) if(county[i]==maxy) goody.pb(i);

  for(auto x : goodx){
    for(auto y : goody){
      if(s.count(P(x, y))) continue;
      cout << ans << endl;
      return 0;
    }
  }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:21:7: error: 'P' was not declared in this scope
   21 |   set<P> s;
      |       ^
a.cc:21:8: error: template argument 1 is invalid
   21 |   set<P> s;
      |        ^
a.cc:21:8: error: template argument 2 is invalid
a.cc:21:8: error: template argument 3 is invalid
a.cc:27:7: error: request for member 'emplace' in 's', which is of non-class type 'int'
   27 |     s.emplace(x, y);
      |       ^~~~~~~
a.cc:41:12: error: request for member 'count' in 's', which is of non-class type 'int'
   41 |       if(s.count(P(x, y))) continue;
      |            ^~~~~
Language: C++

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define int long long
#define ar array
#define db double
#define pow pw
const db pi = 3.14159265358979323846;
int pw(int a,int b){
    int ans=1;
    while(b){
    if (b%2) ans*=a;
    a*=a;
    b/=2;
    }
    return(ans);
}
const int mxn=3e5+7,INF=1e9+7;
int m,n,k;
map<int,int> r,c;
map<pair<int,int>,int> a;
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>m>>n>>k;
    for (int i=0;i<k;i++)
    {
        int u,v;
        cin>>u>>v;
        a[{u,v}]=1;
        r[u]++;
        c[v]++;
    }
    int ans=0,ans2=0,t1=0,t2=0;
    for (int i=1;i<=m;i++) 
    if (r[i]>r[ans]) ans=i;
    for (int i=1;i<=n;i++)
    {
        if (a[{ans,i}]==0&&c[i]>c[ans2]) ans2=i; 
    }
    for (int i=1;i<=n;i++)
        if (r[i]>r[t1]) t1=i;
    for (int i=1;i<=m;i++)
    if (a[{t1,i}]==0&&c[i]>c[t2]) t2=i;
    cout<<max(r[ans1]+c[ans2],r[t1]+c[t2]);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:17: error: 'ans1' was not declared in this scope; did you mean 'ans2'?
   51 |     cout<<max(r[ans1]+c[ans2],r[t1]+c[t2]);
      |                 ^~~~
      |                 ans2
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll r,c,m;
  cin>>r>>c>>m;
  map<ll,ll> a,b;
  map<ll,ll> :: iterator it;
  vector< pair<ll,ll> > v;
  ll x,y;
  for(int i=0;i<m;i++){
  	cin>>x>>y;
  	v.push_back(make_pair(x,y));
  	a[x]++;
  	b[y]++;
  }
  ll best_x = a.begin()->second;
  x = a.begin()->first;
  ll best_y = b.begin()->second;
  y = b.begin()->first;
  for(it=a.begin();it!=a.end();it++){
  	if(it->second>best_x){
  		best_x = it->second;
  		x = it->first;
	  }
  }
  for(it=b.begin();it!=b.end();it++){
  	if(it->second>best_y){
  		best_y = it->second;
  		y = it->first;
	  }
  }
  if(v.find({x,y})!=v.end())
  	cout<<best_x+best_y-1<<endl;
  else
  	cout<<best_x+best_y<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:8: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'find'
   33 |   if(v.find({x,y})!=v.end())
      |        ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
//#include <bits/stdc++.h> 

using namespace std;

int main(){
    long int H,W,M;
    cin>>H>>W>>M;
    long int h[M],w[M];
    vector<long int> x(H),y(W);
    for (long int i=0;i<M;i++){
        cin>>h[i]>>w[i];
        h[i]--;
        w[i]--;
        x[h[i]]++;
        y[w[i]]++;
    }
    long int maxh=0,maxw=0;
    for (long int i=1;i<H;i++){
        if (x[i]>x[i-1]) maxh=i;
    }
    for (long int i=1;i<W;i++){
        if (y[i]>y[i-1]) maxw=i;
    }
    vector<long int> xmax,ymax,nx=0,ny=0;
    for (long int i=0;i<H;i++){
        if (x[i]==x[maxh]){
            xmax.push_back(i);
            nx++;
        }
    }
    for (long int i=0;i<W;i++){
        if (y[i]==y[maxw]){
            ymax.push_back(i);
            ny++;
        }
    }

    long int n=0;
    for (long int i=0;i<M;i++){
        if (x[h[i]]==x[maxh] && y[w[i]]==y[maxw]) n++;
    }
    if (n==nx*ny) cout<<x[maxh]+y[maxw]-1<<endl;
    else cout<<x[maxh]+y[maxw]<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:35: error: conversion from 'int' to non-scalar type 'std::vector<long int>' requested
   28 |     vector<long int> xmax,ymax,nx=0,ny=0;
      |                                   ^
a.cc:28:40: error: conversion from 'int' to non-scalar type 'std::vector<long int>' requested
   28 |     vector<long int> xmax,ymax,nx=0,ny=0;
      |                                        ^
a.cc:32:15: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   32 |             nx++;
      |             ~~^~
a.cc:38:15: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   38 |             ny++;
      |             ~~^~
a.cc:46:14: error: no match for 'operator*' (operand types are 'std::vector<long int>' and 'std::vector<long int>')
   46 |     if (n==nx*ny) cout<<x[maxh]+y[maxw]-1<<endl;
      |            ~~^~~
      |            |  |
      |            |  vector<[...]>
      |            vector<[...]>
Language: C++

#include<bits/stdc++.h>
#define pb push_back

#define f(i,a,b) for(int i=a;i<b;i++)
#define f1(i,a,b) for(int i=a;i<=b;i++)
#define int long long
using namespace std;
#define mod 1000000007
signed main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int h, w, m, x, y, ans, maxi = 0, maxi1 = 0, res = 0, k, k1;
    cin >> h >> w >> m;
    memset(arr, 0, sizeof(arr));
    map<int, int>map1, map2;
    map<pair<int, int>, int>visit;
    while(m--)
    {
        cin >> x >> y;
        map1[x]++;
        map2[y]++;
        visit[ {x, y}] = 1;
        if(map1[x] > maxi)
        {
            maxi = map1[x];
            k = x;
        }
        if(map2[y] > maxi1)
        {
            maxi1 = map2[y];
            k1 = y;
        }
    }

    for(int i = 0; i <= h; i++)
    {
        ans = maxi1 + map1[i];
        if(visit[ {i, k1}])
        {
            ans--;
        }
        res = max(res, ans);
    }
    for(int i = 0; i <= w; i++)
    {
        ans = maxi + map2[i];
        if(visit[ {k, i}])
        {
            ans--;
        }
        res = max(res, ans);
    }
    cout << res << endl;
    return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: 'arr' was not declared in this scope
   18 |     memset(arr, 0, sizeof(arr));
      |            ^~~
Language: C++

//RAVAN_2070
#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fo(i,a,b) for(i=a;i<b;i++)
#define pb push_back
#define mp make_pair
void solve()
{
    int h,w,m,i,r,c;cin>>h>>w>>m;
    vector<int>R(h,0),C(w,0);
    map<pair<int,int>,int>M;
    fo(i,0,m)
    {
        cin>>r>>c;
        r--;c--;
        M[mp(r,c)]++;
        R[r]++;C[c]++;
    }
    int mxr,mxc;mxr=mxc=-1;
    fo(i,0,h)mxr=max(mxr,R[i]);
    fo(i,0,w)mxc=max(mxc,C[i]);

    vector<int>row,col;
    fo(i,0,h)if(R[i]==mxr)row.pb(i);
    fo(i,0,w)if(C[i]==mxc)col.pb(i);

    int ans=0;
    for(auto itr:row)
    {
        for(auto itc:col)
        {
            int f=1;
            int cnt=R[itr]+C[itc];
            if(M[mp(itr,itc)])f=0,cnt--;
            ans=max(ans,cnt);
            if(f==1)break;

        }
        if(f==1)break;
    }
    cout<<ans<<"\n";
    
}
int main()
{
    fastio
    solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:40:12: error: 'f' was not declared in this scope
   40 |         if(f==1)break;
      |            ^
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <set>
using namespace std;
typedef pair<int, int> i_i;
  
int H, W, M;

int main() {
  cin >> H >> W >> M;
  set<i_i> st;
  map<int, int> sumh, sumw;
  int max_h = 0, max_w = 0;
  for (int i = 0; i < M; i++) {
    int h, w;
    cin >> h >> w;
    st.insert({h, w});
    max_h = max(max_h, ++sumh[h]);
    max_w = max(max_w, ++sumw[w]);
  }
  
  vector<int> max_hs, max_ws; // 最大値の行、列番号リスト
  for (auto i = sumh.begin(); i != sumh.end(); i++) {
    if (max_h == i->second) {
	  max_hs.push_back(i->first);
    }
  }
  for (auto i = sumw.begin(); i != sumw.end(); i++) {
    if (max_w == i->second) {
	  max_ws.push_back(i->first);
    }
  }
  
  int ans = max_h + max_w - 1;
  
  // 爆破地点に対象物がなければそれが最大値
  for (auto h : max_hs) {
    for (auto w : max_ws) {
	 if (st.find({h, w}) == st.end()) {
       ++ans;
       cout << ans;
       return;
     }
    } 
  }
  
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:8: error: return-statement with no value, in function returning 'int' [-fpermissive]
   43 |        return;
      |        ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
	int h, w; 
	cin >> h >> w;
	int m;
	cin >> m;
	int mxr = 0, mxc = 0;
	vector<int> row(h), col(w);
	vector<pair<int, int>> v(m);
	for (int i = 0; i < m; i++) {
		int x, y; 
		cin >> x >> y;
		--x, --y;
		mxr = max(mxr, ++row[x]);
		mxc = max(mxc, ++col[y]);
		v.emplace_back(x, y);
	}
	int inter = 0;
	for (auto [x, y] : v) {
		if (row[x] == mxr and col[y] == mxc)
			++inter;
	}
	int cnt_mxr = count(row.begin(), row.end(), mxr);
	int cnt_mxc = count(col.begin(), col.end(), mxc);
	cout << (mxr + mxc - (inter == 1ll * cnt_r * cnt_c)) << "\n";

}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:46: error: 'cnt_r' was not declared in this scope; did you mean 'cnt_mxr'?
   26 |         cout << (mxr + mxc - (inter == 1ll * cnt_r * cnt_c)) << "\n";
      |                                              ^~~~~
      |                                              cnt_mxr
a.cc:26:54: error: 'cnt_c' was not declared in this scope; did you mean 'cnt_mxc'?
   26 |         cout << (mxr + mxc - (inter == 1ll * cnt_r * cnt_c)) << "\n";
      |                                                      ^~~~~
      |                                                      cnt_mxc
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
	int h, w,; 
	cin >> h >> w;
	int m;
	cin >> m;
	int mxr = 0, mxc = 0;
	vector<int> row(h), col(w);
	vector<pair<int, int>> v(m);
	for (int i = 0; i < m; i++) {
		int x, y; 
		cin >> x >> y;
		--x, --y;
		mxr = max(mxr, ++row[x]);
		mxc = max(mxc, ++col[y]);
		v.emplace_back(x, y);
	}
	int inter = 0;
	for (auto [x, y] : v) {
		if (row[x] == mxr and col[y] == mxc)
			++inter;
	}
	int cnt_r = count(row.begin(), row.end(), mxr);
	int cnt_c = count(col.begin(), col.end(), mxc);
	cout << (mxr + mxc - (inter == cnt_r * cnt_c)) << "\n";

}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:18: error: expected unqualified-id before ';' token
    4 |         int h, w,;
      |                  ^
Language: C++

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

#define ll long long
#define endl '\n'

void max_self(int &a, int b){ a = max(a, b);}
void min_self(int &a, int b){ a = min(a, b);}

void solve(){
	int h, w, m; cin>>h>>w>>m;
	unordered_map< int, int > mp_x, mp_y;
	int a[h + 1][w + 1] = {};
	int ma_x = 0, ma_y = 0, y_ = 0, x_ = 0;
	vector< pair< int, int > > v;
	for(int i = 0; i<m; i++){
		int x, y; cin>>x>>y;
		a[x][y]++;
		mp_x[x]++, mp_y[y]++;
		max_self(ma_x, mp_x[x]);
		max_self(ma_y, mp_y[y]);
	}
	
	int ans = 0;
	for(int i = 1; i<=h; i++){
		if(mp_x[i] != ma_x) continue;
		for(int j = 1; j<=w; j++){
			if(mp_y[j] != ma_y) continue;
			int cnt = ma_y + ma_x;
			if(a[x][y]) cnt--;
			ans = max(ans, cnt);
		}
	}
	cout<<ans<<endl;
}

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int t = 1;// cin>>t;
	for(int i = 1; i<=t; i++){
		solve();
	}
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:30:30: error: 'x' was not declared in this scope
   30 |                         if(a[x][y]) cnt--;
      |                              ^
a.cc:30:33: error: 'y' was not declared in this scope
   30 |                         if(a[x][y]) cnt--;
      |                                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
  int H, W, M; cin >> H >> W >> M;
  vector<int> R(H), C(W);
  map<pair<int, int>, int> m;
  int mr = 0, mc = 0;
  for (int i = 0; i < M; i++) {
    int r, c; cin >> r >> c; r--, c--;
    mr = max(mr, ++R[r]);
    mc = max(mc, ++C[c]);
    m[{r, c}] = 1;
  }
  vector<int> a, b;
  for (int i = 0; i < H; i++) {
    if (R[i] == mr) a.push_back(i);
  }
  for (int i = 0; i < W; i++) {
    if (C[i] == mc) b.push_back(i);
  }
  for (auto x : a) {
    for (auto y : b) {
      if (m[{x, y}] == 0) {
        cout << mr + mc << endl;
        return 0;
      }
    }
  }
  cout << mr + mc - 1 << endl;
}
}


Compiler output:
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
  int H, W, M; cin >> H >> W >> M;
  vector<int> R(H), C(W);
  map<pair<int, int>> m;
  int mr = 0, mc = 0;
  for (int i = 0; i < M; i++) {
    int r, c; cin >> r >> c; r--, c--;
    mr = max(mr, ++R[r]);
    mc = max(mc, ++C[c]);
    m[{r, c}] = 1;
  }
  vector<int> a, b;
  for (int i = 0; i < H; i++) {
    if (R[i] == mr) a.push_back(i);
  }
  for (int i = 0; i < W; i++) {
    if (C[i] == mc) b.push_back(i);
  }
  for (auto x : a) {
    for (auto y : b) {
      if (m[{x, y}] == 0) {
        cout << mr + mc << endl;
        return 0;
      }
    }
  }
  cout << mr + mc - 1 << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:20: error: wrong number of template arguments (1, should be at least 2)
    6 |   map<pair<int, int>> m;
      |                    ^~
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:12:6: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   12 |     m[{r, c}] = 1;
      |      ^
a.cc:23:12: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   23 |       if (m[{x, y}] == 0) {
      |            ^
a.cc: At global scope:
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^
Language: C++

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

int main()
{
    int H, W;
    long long M;
	
    vector<int> cnth(H), cntw(W);
    vector<pair<int, int>> colcount, rowcount;
    set<pair<int, int>> s;

    while (M--)
    {
        int a, b;
        myfile >> a >> b;
        cnth[--a]++;
        cntw[--b]++;
        s.insert(make_pair(a, b));
    }
  	for (int i = 0; i < H; i++)
    {
        colcount.push_back({cnth[i], i});
    }
    for (int i = 0; i < W; i++)
    {
        rowcount.push_back({cntw[i], i});
    }
    sort(colcount.begin(), colcount.end(), [](pair<int,int> x, pair<int,int> y){ return x.first > y.first;}); 
    sort(rowcount.begin(), rowcount.end(), [](pair<int,int> x, pair<int,int> y){ return x.first > y.first;});
    
    int max_targets = 0;
    int col = 0;
    int row = 0;
   
    while (col + 1 <= H && colcount[0].first >= colcount[col + 1].first)
    {
        while (row + 1 <= W && rowcount[0].first >= rowcount[row + 1].first)
        {
            int targets = colcount[col].first + rowcount[row].first;
            if (s.find({colcount[col].second, rowcount[row].second}) != s.end())
            {
                targets--;
            }
            if(targets > max_targets)
            {
                max_targets = targets;
            }
            row++;
        }
        col++;
    }
    cout << max_targets;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'myfile' was not declared in this scope; did you mean 'tmpfile'?
   16 |         myfile >> a >> b;
      |         ^~~~~~
      |         tmpfile
Language: C++

#include <iostream>
#include <algorithm>
#define ll long long

using namespace std;
ll n, m, k;
const ll NMAX = 300005;
ll ival[NMAX], jval[NMAX];

ll vx[NMAX], vy[NMAX];

ll imax = -1, jmax = -1;
ll cnt = 0;
ll mmax = -1;
ll valx, valy;

ll main()
{
    ll i, x, y;
    cin >> n >> m >> k; valx = valy = 0;
    for(i = 1; i <= k; i++) {
        cin >> x >> y;
        vx[i] = x; vy[i] = y;
        ival[x]++;
        jval[y]++;
        if(ival[x] > imax) {
            imax = ival[x];
            valx = 1;
        }
        else if(imax == ival[x])
            valx++;
        if(jval[y] > jmax) {
            jmax = jval[y];
            valy = 1;
        }
        else if(jmax == jval[y])
            valy++;
    }
    cnt = valx * valy;
    for(i = 1; i <= k; i++) {
        if(imax + jmax == ival[vx[i]] + jval[vy[i]]) {
            cnt--;
        }
    }
    if(cnt > 0) {
        cout << imax + jmax;
    } else {
        cout << imax + jmax - 1;
    }
    return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < n; i++)
using p = pair<int,int>;
int main(){
    int h,w;
    long long m;
    cin >> h >> w >> m;
    vector <int> xx(h);
    vector <int> yy(w);
    set <p> s;
    rep(i,m){
        int x,y;
        cin >> x >> y;
        --x; --y;
        xx[x] += 1;
        yy[y] += 1;
        s.emplace (x,y);
    }
    int mx = 0;
    int my = 0;
    rep(i,h) mx = max(mx,xx[i]);
    rep(i,w) my = max(my, yy[i]);
    int ans = mx + my;
    vector<int> xm,ym;
    rep(i,h){
        if (xx[i] == mx) xm.push_back(i);
    }
    rep(i,w){
        if (yy[i] == my) ym.push_back(i);
    }
    for (int j : xm) for (int k : ym){
        if (s.find({j,k}) == s.end()){
            cout << ans << endl;
            return;
        }
    }
    ans -= 1;
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   35 |             return;
      |             ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < n; i++)
using p = pair<int,int>;
int main(){
    int h,w;
    long long m;
    cin >> h >> w >> m;
    vector <int> xx(h);
    vector <int> yy(w);
    set <p> s;
    rep(i,m){
        int x,y;
        cin >> x >> y;
        --x; --y;
        xx[x] += 1;
        yy[y] += 1;
        s.emplace (x,y);
    }
    int mx = 0;
    int my = 0;
    rep(i,h) mx = max(mx,xx[i]);
    rep(i,w) my = max(my, yy[i]);
    int ans = mx + my;
    vector<int> xm,ym;
    rep(i,h){
        if (xx[i] == mx) xm.push_back(i);
    }
    rep(i,w){
        if (yy[i] == my) ym.push_back(i);
    }
    for (int j : xm) for (int k : ym){
        if (s.find({j,k} == s.end()){
            ans += 1;
        }
    }
    ans -= 1;
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:25: error: expected ')' before '==' token
   33 |         if (s.find({j,k} == s.end()){
      |                   ~     ^~~
      |                         )
a.cc:33:37: error: expected ')' before '{' token
   33 |         if (s.find({j,k} == s.end()){
      |            ~                        ^
      |                                     )
a.cc:33:19: error: could not convert 's.std::set<std::pair<int, int> >::find(std::pair<int, int>(j, k))' from 'std::set<std::pair<int, int> >::iterator' {aka 'std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator'} to 'bool'
   33 |         if (s.find({j,k} == s.end()){
      |             ~~~~~~^~~~~~~~~
      |                   |
      |                   std::set<std::pair<int, int> >::iterator {aka std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator}
a.cc:36:5: error: expected primary-expression before '}' token
   36 |     }
      |     ^
Language: C++

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

nt main()
{
    int H, W;
    long long M;
	
  	cin >> H >> W >> M;
    vector<int> cnth(H), cntw(W);
    vector<pair<int, int>> colcount, rowcount;
    set<pair<int, int>> s;

    while (M--)
    {
        int a, b;
        cin >> a >> b;
        cnth[--a]++;
        cntw[--b]++;
        s.insert(make_pair(a, b));
    }
    
  	for (int i = 0; i < H; i++)
    {
        colcount.push_back({cnth[i], i});
    }
    for (int i = 0; i < W; i++)
    {
        rowcount.push_back({cntw[i], i});
    }
    sort(colcount.begin(), colcount.end(), [](pair<int,int> x, pair<int,int> y){ return x.first > y.first;}); 
    sort(rowcount.begin(), rowcount.end(), [](pair<int,int> x, pair<int,int> y){ return x.first > y.first;});
	
  	int max_targets = 0;
    int col = 0;
    int row = 0;
    
  	while (col + 1 <= H && colcount[col].first >= colcount[col + 1].first)
    {
        while (row + 1 <= W && rowcount[row].first >= rowcount[row + 1].first)
        {
            int targets = colcount[col].first + rowcount[row].first;
            if (s.find({col, row}) != s.end())
            {
                max_targets--;
            }
            if(targets > max_targets)
            {
                max_targets = targets;
            }
            row++;
        }
        col++;
    }
    cout << max_targets;
    return 0;
}


Compiler output:
a.cc:5:1: error: 'nt' does not name a type; did you mean 'int'?
    5 | nt main()
      | ^~
      | int
Language: C++

#include<iostream>
#include<vecgtor>
#define rep(i,n) for(int i = 0;i < (n);i++)
using namespace std;
using P = pair<int,int>;

int main(){
    int h,w,n;
    cin >> h >> w >> n;
    vector<int> hs(h), ws(w);
    set<P> s;
    rep(i,n){
        int r,c;
        cin >> r >> c;
        r--;c--;
        hs[r]++;
        ws[c]++;
        s.emplace(r,c);
    }

    int mh = 0,mw = 0;
    rep(i,h)mh = max(mh,hs[i]);
    rep(j,w)mw = max(mw,ws[j]);
    vector<int> is,js;
    rep(i,h)if(mh == hs[i])is.push_back(i);
    rep(j,w) if(mw == ws[j])js.push_back(j);
    int ans = mh + mw;

    for(int i :is){
        for(int j :js){
            if(s.count(P(i,j)))continue;
            cout << ans << endl;
            return 0;
        }
    }
    cout << ans - 1 << endl;
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
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; }
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int s[30010][30010];
int sumh[30010];
int sumw[30010];

void solver(
  int H, int W, int M,
  vector<int> h, vector<int> w
) {
  REP(i,M) { h[i]--; w[i]--; } // 0-index

  REP(i,M) {
    s[h[i]][w[i]]=1;
    sumh[h[i]]++;
    sumw[w[i]]++;
  }

  int ans = 0;
  REP(i,H) {
    REP(j,W) {
      int sum = sumh[i]+sumw[j];
      if (s[i][j] == 1) sum--;
      chmax(ans, sum);
    }
  }
  COUT(ans);

  return;
}

int main() {
  IOS;
  int H,W,M;
  cin >> H >> W >> M;
  vector<int> h(M),w(M);
  REP(i,M) cin >> h[i] >> w[i];

  solver(H,W,M,h,w);

  return 0;
}

Compiler output:
/tmp/ccvjdSx2.o: in function `solver(int, int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)':
a.cc:(.text+0xeb): relocation truncated to fit: R_X86_64_PC32 against symbol `sumh' defined in .bss section in /tmp/ccvjdSx2.o
a.cc:(.text+0x102): relocation truncated to fit: R_X86_64_PC32 against symbol `sumh' defined in .bss section in /tmp/ccvjdSx2.o
a.cc:(.text+0x12e): relocation truncated to fit: R_X86_64_PC32 against symbol `sumw' defined in .bss section in /tmp/ccvjdSx2.o
a.cc:(.text+0x145): relocation truncated to fit: R_X86_64_PC32 against symbol `sumw' defined in .bss section in /tmp/ccvjdSx2.o
a.cc:(.text+0x188): relocation truncated to fit: R_X86_64_PC32 against symbol `sumh' defined in .bss section in /tmp/ccvjdSx2.o
a.cc:(.text+0x19f): relocation truncated to fit: R_X86_64_PC32 against symbol `sumw' defined in .bss section in /tmp/ccvjdSx2.o
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i < n; i++)
#define repd(i, n) for (int i = n-1; i > -1; i--)
#define repran(i, a,b) for (int i = a; i<b;i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> P;
int main()
{
    int h, w, m;
    cin >> h >> w >> m;
    set<P> c;
    map<int,int> mph, mpw;
    int hmax = 0, wmax = 0;
    rep(i, m){
        int a, b;
        cin >> a >> b;
        --a;--b;
        c.emplace(a,b);
        mph[a]++;mpw[b]++;
        hmax = max(hmax, mph[a]);
        wmax = max(wmax, mpw[b]);
    }
    vector<int> hidx, widx;
    for (auto p : mph){
        if (p.second==hmax) hidx.push_back(p.first);
    }
    for (auto p : mpw){
        if (p.second==wmax) widx.push_back(p.first);
    }
    int ans = hmax+wmax-1;
    for (int i: hidx){
        for (int j : widx){
            if (c.find({i,j})==c.end()) {
                ans++;
                cout << ans << endl;
                return;
            }
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
   38 |                 return;
      |                 ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;  
#pragma GCC optimize("Ofast") 
#define int long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back 
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)  
#define fn1 for( int i =1;i<=n; i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define endl '\n'
#define PI  3.14159265358979323846
#define MOD 1000000007
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
const int N = 2e6+5;  
const int INF = 1e18L;
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}
int ar[N];
int dp[N];
signed main(){
  #ifndef ONLINE_JUDGE
  freopen("input.txt","r",stdin);
  freopen("output.txt","w",stdout);
  #endif
  IOS;
  int T=1;
  // cin >> T;
  while(T--){
    int n , m , k;
    cin >> n >> m >> k;
    map<int,int>r,c;
    map<pair<int,int>,bool>  vis;
    for(int i =0 ;i < k;i++){
      int x ,y;
      cin >> x >>y;
      r[x]++;
      c[y]++;
      vis[{x,y}]++;
    }
    int ans = 0;
    int rmx =0 , cmx = 0;
    for(auto i : r)rmx=max(rmx,i.se); 
    for(auto i : c)cmx=max(cmx,i.se); 
    vector<int>rr,cc;
    for(auto i : r)if(rmx==i.se)rr.pb(i.fi);
    for(auto i : c)if(cmx==i.se)cc.pb(i.fi);
    bool ok= 1;
    for(auto i : rr){
      for(auto j : cc)
        if(vis[{i,j}]==0)ok = 0;
    }
    ans = rmx + cmx -ok;
    cout << ans <<'\n';
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:17: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   52 |       vis[{x,y}]++;
      |                 ^~
Language: C

#include <stdio.h>
#include <stdlib.h>
#define max(a, b) (a > b? a : b);

long long row[300000], col[300000], point[300000];

int binary_search(long long target, long long array[], long long n)
{
    long long fn = 0, bn = n - 1, tmp;
    while (fn <= bn)
    {
        tmp = (fn + bn) / 2;
        if (array[tmp] < target) {fn = tmp + 1;} else if (array[tmp] > target) {bn = tmp - 1;} else {return tmp;}
    }
    return fn;
}

int compare(const void *a, const void *b) {return *(long long*)a > *(long long*)b ? 1 : (*(long long*)a == *(long long*)b ? 0 : -1);}

int main(void)
{
    long long H, W, M;
    scanf("%lld %lld %lld", &H, &W, &M);
    long long maxRow = 0, maxCol = 0;

    for (long long i = 0; i < M; i++)
    {
        long long a, b;
        scanf("%lld %lld", &a, &b);
        row[a - 1]++;
        col[b - 1]++;

        if (row[a - 1] > maxRow)
            maxRow = row[a - 1];
        if (col[b - 1] > maxCol)
            maxCol = col[b - 1];

        point[i] = a * W + b;
    }

    long long r = maxRow + maxCol - 1;

    long long numRow = 0, numCol = 0;
    long long indexRow[M], indexCol[M];
    for (long long i = 0; i < H; i++)
    {
        if (row[i] == maxRow)
        {
            indexRow[numRow++] = i;
        }
    }

    for (long long i = 0; i < W; i++)
    {
        if (col[i] == maxCol)
        {
            indexCol[numCol++] = i;
        }
    }

    if (numRow*numCol>M) {printf("%lld", r+1); return 0;}
    qsort(point, M, sizeof(long long), compare);

    for (long long i = 0; i < numRow; i++)
    {
        for (long long j = 0; j < numCol; j++)
        {
            long long key = (indexRow[i]+1)*W+indexCol[j]+1;
            if (point(binary_search(key, point, M)) != key)
            {
                printf("%lld", r + 1);
                return 0;
            }
        }
    }

    printf("%lld", r);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:69:17: error: called object 'point' is not a function or function pointer
   69 |             if (point(binary_search(key, point, M)) != key)
      |                 ^~~~~
main.c:5:37: note: declared here
    5 | long long row[300000], col[300000], point[300000];
      |                                     ^~~~~
Language: C++

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

int main(){
	int h, w, n;
  	cin >> h >> w >> n;
  	vector<int> hs(h), ws(w);
  	set<P> s;
  	rep(i, n){
    	int r, c;
      	cin >> r >> c;
      	r--; c--;
      	hs[r]++;
      	hw[c]++;
      	s.emplace(r, c);
    }
  
  	int mh = 0, mw = 0;
  	rep(i, h) mh = max(mh, hs[i]);
   	rep(j, w) mw = max(mw, ws[j]);
  	vector<int> is, js;
  	rep(i, h) if(mh == hs[i]) is.push_back(i);
  	rep(j, w) if(mw == hs[j]) js.push_back(j);
  	
  	int ans = mh+mw;
  	for(int i : is){
    	for(int j : js){
        	if(s.count(P(i, j))) continue;
          	cout << ans << endl;
          	return 0;
        }
    }
  	ans--;
  	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'hw' was not declared in this scope; did you mean 'hs'?
   17 |         hw[c]++;
      |         ^~
      |         hs
Language: C++

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

#define rep(i, a) for (int i = 0; i < (a); i++ )

 
typedef pair<int,int> P;
typedef long long ll;
 
const int INF = 1001001001;
const int MOD = 1000000007;
const double PI=acos(-1);

int main(){
    int H,W,M;
    cin >> H >> W >> M;
    set<pair<int,int>> S;

    vector<vector<int>> Aw(W,vector<int> (2,0));
    vector<vector<int>> Ah(H,vector<int> (2,0));
    rep(i,W) {
        Aw[i][1] = i;
    }
    rep(i,H) {
        Ah[i][1] = i;
    }

    rep(i,M) {
        int h,w;
        cin >> h >> w;
        h--,w--;
        S.insert(make_pair(h,w));
        Ah[h][0]++;
        Aw[w][0]++;
    }
    sort(Aw.begin(),Aw.end());
    sort(Ah.begin(),Ah.end());
    ll ans = 0;

    ll wnum = Aw.back()[0];
    ll wint = Aw.back()[1];
    vector<int> wmax;
    int idx = W-1;
    while(Aw[idx][0]==wnum) {
        wmax.push_back(Aw[idx][1]);
        idx--;
        if (idx<0) break;
    }
    
    ll hnum = Ah.back()[0];
    ll hint = Ah.back()[1];
    vector<int> hmax;
    idx = H-1;
    while(Ah[idx][0]==hnum) {
        hmax.push_back(Ah[idx][1]);
        idx--;
        if (idx<0) break;
    }
    int cnt = 0
    rep(h,hmax.size()) {
        rep(w,wmax.size()) {
            ll tmp = hnum + wnum;
            //cout << hmax[h]+1 << " " << wmax[w]+1 << endl;
            if(S.count(make_pair(hmax[h],wmax[w]))) {
                tmp--;
            }
            ans = max(ans,tmp);
            cnt++;
            if (cnt>1000000) break;
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:19: error: expected ',' or ';' before 'for'
    4 | #define rep(i, a) for (int i = 0; i < (a); i++ )
      |                   ^~~
a.cc:60:5: note: in expansion of macro 'rep'
   60 |     rep(h,hmax.size()) {
      |     ^~~
a.cc:60:9: error: 'h' was not declared in this scope
   60 |     rep(h,hmax.size()) {
      |         ^
a.cc:4:35: note: in definition of macro 'rep'
    4 | #define rep(i, a) for (int i = 0; i < (a); i++ )
      |                                   ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
using namespace std;

const int maxn = 3e5 + 10;
int cntr[maxn], cntc[maxn];
vector<int> g[maxn * 2];
int sz = 0;
bool was[maxn * 2];

void dfs(int v) {
	sz++;
	was[v] = true;
	for(int x : g[v]) {
		if(was[x]) continue;
		dfs(x);
	}
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n, m, k;
	cin >> n >> m >> k;
	int c[maxn], r[maxn];
	for(int i = 0; i < k; i++) {
		cin >> r[i] >> c[i];
		cntr[r[i]]++;
		cntc[c[i]]++;
	}
	int ansr = *max_element(cntr, cntr + maxn);
	int ansc = *max_element(cntc, cntc + maxn);
	vector<int> maxrows, maxcols;
	for(int i = 1; i <= n; i++) {
		if(cntr[i] == ansr) maxrows.push_back(i);
	}
	for(int i = 1; i <= m; i++) {
		if(cntc[i] == ansc) maxcols.push_back(i);
	}
	for(int i = 0; i < k; i++) {
		if(cntr[r[i]] == ansr and cntc[c[i]] == ansc) {
			g[r[i]].push_back(c[i] + maxn);
			g[c[i] + maxn].push_back(r[i]);
		}
	}
	dfs(maxrows[0]);
	if(sz == (int)maxrows.size() * maxcols.size()) {
		cout << ansr + ansl - 1 << endl;
	}
	else cout << ansr + ansl << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:32: error: 'ansl' was not declared in this scope; did you mean 'ansc'?
   52 |                 cout << ansr + ansl - 1 << endl;
      |                                ^~~~
      |                                ansc
a.cc:54:29: error: 'ansl' was not declared in this scope; did you mean 'ansc'?
   54 |         else cout << ansr + ansl << endl;
      |                             ^~~~
      |                             ansc