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

#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define x first
#define y second
#define PQ priority_queue
#define pb push_back
#define fu(i,a,j) for(int i=a;i<j;i++)
#define fd(i,a,j) for(int i=a;i>=j;i--)
#define SYNC ios::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL)
#define MOD 1000000007 
#define MOD2 1000000021
#define MAXN 2000000
#define INF 1e9
using namespace std;

typedef long long ll;
typedef long double ld;
typedef double db;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<string> vs;

//ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

ll m_pow(ll a, ll b, ll M = MOD) { ll res = 1; for (; b; b >>= 1, a = (a * a) % M)if (b & 1)res = (res * a) % M; return res; }
ll gcd(ll a, ll b) { if (a < b) swap(a, b); for (; b; a %= b, swap(a, b)); return a; }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); };
db dis(pii a, pii b) { return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y)); }
int dr[] = { 0, 1, 0, -1, 1,1,-1,-1 };
int dc[] = { 1, 0, -1, 0, 1,-1,1,-1 };

int n, m, k, t;

string ansok[2] = { "NO","YES" };

vpii ga[300001];
vpii se[300001];
int cga[300001];
int cse[300001];

int main()
{
	SYNC;
	cin >> n >> m >> k;
	for (int i = 0; i < k; i++) {
		cin >> a[i].x >> a[i].y;
		se[a[i].x].pb(a[i]);
		ga[a[i].y].pb(a[i]);
	}
	int ans = 0;
	int r = 0, c = 0;
	int mx = 0, idx = 0;
	for (int i = 1; i <= n; i++) {
		if (mx < se[i].size()) {
			mx = se[i].size();
			idx = i;
		}
	}
	for (auto it : se[idx]) {
		cga[it.y]++;
	}
	ans = mx;
	for (int i = 1; i <= m; i++) {
		ans = max(ans, mx + (int)ga[i].size() - cga[i]);
	}

	r = 0, c = 0;
	mx = 0, idx = 0;
	for (int i = 1; i <= m; i++) {
		if (mx < ga[i].size()) {
			mx = ga[i].size();
			idx = i;
		}
	}
	for (auto it : ga[idx]) {
		cse[it.x]++;
	}
	for (int i = 1; i <= n; i++) {
		ans = max(ans, mx + (int)se[i].size() - cse[i]);
	}


	cout << ans << '\n';
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:24: error: 'a' was not declared in this scope
   50 |                 cin >> a[i].x >> a[i].y;
      |                        ^
Language: C++

#include <iostream>
#include <vector>
#include <iterator>

#define Nfori(N) for(int i=0;i<N;i++)
#define Nforj(N) for(int j=0;j<N;j++)

using namespace std;

int main(){
  	int H, W, M;
  	cin >> H >> W >> M;
  	vector<int> h(M), w(M);
  	vector<int> bH(H), bW(W);
  	vector<vector<int>> map(W, vector<int>(H, 0));
  	Nfori(M){
      	cin >> h[i] >> w[i];
  		bH(h[i])++;
      	bW(w[i])++;
      	map[h[i]][w[i]] = 1;
    }
  	vector<vector<int>::iterator> iH, iW;
  	auto h_itr = bH.begin();
  	while(h_itr == bH.end()){
      	auto tmp = max_element(h_itr, bH.end());
      	iH.pushback(tmp);
      	h_itr = ++tmp;
    }
  	auto w_itr = bW.begin();
  	while(w_itr == bW.end()){
      	auto tmp = max_element(w_itr, bW.end());
      	iW.pushback(tmp);
      	w_itr = ++tmp;
    }
  	int max = 0;
  	for(auto& hh : iH){
      	for(auto& ww : iW){
          	int tmp;
          	if(map[distance(bH.begin(), hh)][distance(bW.begin(), ww)] == 1){
              	tmp = *(hh) + *(ww) - 1;
            }
          	else tmp = *(hh) + *(ww);
          	max = max < tmp ? tmp : max;
        }
    }
  	cout << max << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: no match for call to '(std::vector<int>) (__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   18 |                 bH(h[i])++;
      |                 ~~^~~~~~
a.cc:19:11: error: no match for call to '(std::vector<int>) (__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   19 |         bW(w[i])++;
      |         ~~^~~~~~
a.cc:25:20: error: 'max_element' was not declared in this scope
   25 |         auto tmp = max_element(h_itr, bH.end());
      |                    ^~~~~~~~~~~
a.cc:26:12: error: 'class std::vector<__gnu_cxx::__normal_iterator<int*, std::vector<int> > >' has no member named 'pushback'; did you mean 'push_back'?
   26 |         iH.pushback(tmp);
      |            ^~~~~~~~
      |            push_back
a.cc:31:20: error: 'max_element' was not declared in this scope
   31 |         auto tmp = max_element(w_itr, bW.end());
      |                    ^~~~~~~~~~~
a.cc:32:12: error: 'class std::vector<__gnu_cxx::__normal_iterator<int*, std::vector<int> > >' has no member named 'pushback'; did you mean 'push_back'?
   32 |         iW.pushback(tmp);
      |            ^~~~~~~~
      |            push_back
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,row=0,column=0;
  cin>>a>>b>>c;
  vector<vector<int>>v;
  map<int,int>count,count1;
  for(int i=0;i<c;i++){
 vector<int>x;
    int s,t;
    cin>>s>>t;
    x.push_back(s);
    x.push_back(t);
    v.push_back(v);
    count[v[i][0]]++;
     count1[v[i][1]]++;
  row=max(row, count[v[i][0]]++);
    column=max(column,count1[v[i][1]]);
  
  }

cout<<row+column;



return 0;}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: no matching function for call to 'std::vector<std::vector<int> >::push_back(std::vector<std::vector<int> >&)'
   14 |     v.push_back(v);
      |     ~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; value_type = std::vector<int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'std::vector<std::vector<int> >' to 'const std::vector<std::vector<int> >::value_type&' {aka 'const std::vector<int>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; value_type = std::vector<int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'std::vector<std::vector<int> >' to 'std::vector<std::vector<int> >::value_type&&' {aka 'std::vector<int>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
Language: C++

#include <iostream>
#include <set> 
#include <iterator>
#include <bitset> 
#include <bits/stdc++.h> 
using namespace std;
typedef  long long int ll;
ll mod=1000000007;
 
 
int main() {
    int t=1;
    //cin>>t;
    while(t--)
    {   int h,w;
        cin>>h>>w;
        int m;
        cin>>m;
        int count=0;
        int ind[h+1]={0};
        int x[m+1];
        int y[m+1];
        int ma[m+1]={0};
        for(int i=1;i<=m;i++)
        {   cin>>x[i];
            cin>>y[i];
            ind[x[i]]++;
            
        }
        int maxm=INT_MIN;
        int index;
        for(int i=1;i<=h;i++)
        {   if(ind[i]>maxm)
            {   index=i;
                maxm=ind[i];
            }
        }
        for(int i=1;i<=m;i++)
        {   if(x[i]==index)
                ma[i]=1;
        }
        sort(ind+1,ind+h+1,greater<int>());
        
        
        count=count+ind[1];
        //cout<<count<<endl;
        int ind1[w+1]={0};
        for(int i=1;i<=m;i++)
        {   if(ma[i]!=1)
            {   ind1[y[i]]++;
            }
        }

Compiler output:
a.cc: In function 'int main()':
a.cc:52:10: error: expected '}' at end of input
   52 |         }
      |          ^
a.cc:15:5: note: to match this '{'
   15 |     {   int h,w;
      |     ^
a.cc:52:10: error: expected '}' at end of input
   52 |         }
      |          ^
a.cc:11:12: note: to match this '{'
   11 | int main() {
      |            ^
Language: C++

#include<iostream>
using namespace std;
int main(){
	int h,w,m,hi,wi;
  	cin>>h>>w>>m;
  	int ** map = new int*[h];
    for(int i=0;i<h;i++){
      map[i] = new int [w];
    }
	for(int i=0;i<m;i++){
      cin>>hi>>wi;
      map[hi][wi] = -1;
    }
  	int rowcount =0;
  	int colcount=0;
  	int max=0;
  	int maxcol =0;
  	for(int i=0;i<h;i++){
      rowcount=0;
      maxcol =0;
      for(int j=0;j<w;j++){
      	if(map[i][j])==-1){
          rowcount++;
        }
        colcount=0;
        for(int k=0;k<h;k++){
          if(k==i){
            continue;
          }
          if(map[k][j] ==-1){
            colcount++;
          }
        }
        if(maxcol<colcount){
        	maxcol =colcount;
        }
      }
      if(maxcol+rowcount>max){
        max = maxcol+rowcount;
      }
    }
    cout<<max<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:22: error: expected primary-expression before '==' token
   22 |         if(map[i][j])==-1){
      |                      ^~
Language: C++

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

int mat[maxi][maxi]={};

int main(){
    
    ios::sync_with_stdio(false);
    cin.tie(0);

    for(int i=0; i<max; i++){
        for(int j=0; j<max; j++){
            mat[i][j]=0;
        }
    }

    int h, w, m;
    cin >> h >> w >> m;

    int x, y;
    for(int i=0; i<m; i++){
        cin >> x >> y;
        mat[x][y]=1;
    }

    vector<int> row(h+1), col(w+1);
    for(int j=1; j<=w; j++){
        int count = 0;
        for(int i=1; i<=h; i++){
            if(mat[i][j]==1) count++;
        }
        col[j]=count;
    }

    for(int i=1; i<=h; i++){
        int count = 0;
        for(int j=1; j<=w; j++){
            if(mat[i][j]==1) count++;
        }
        row[i]=count;
    }

    long long int ans = 0;
    for(int i=1; i<=h; i++){
        for(int j=1; j<=w; j++){
            long long int temp = row[i]+col[j];
            if(mat[i][j]==1) temp--;
            ans = max(ans,temp);
        }
    }

    cout<<ans<<'\n';

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   12 |     for(int i=0; i<max; i++){
      |                  ~^~~~
a.cc:13:23: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   13 |         for(int j=0; j<max; j++){
      |                      ~^~~~
Language: C++

#injclude<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,row=0,column=0;
  cin>>a>>b>>c;
  vector<vector>>v;
  map<int,int>count,count1;
  for(int i=0;i<c;i++){
 vector<int>x;
    int s,t;
    cin>>s>>t;
    x.push_back(s);
    x.push_back(t);
    v.push_back(v);
    count[v[i][0]]++;
     count1[v[i][1]]++;
  row=max(row, count[v[i][0]]++);
    column=max(column,count1[v[i][1]]);
  
  }

cout<<row+column;



return 0;}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #injclude; did you mean #include?
    1 | #injclude<bits/stdc++.h>
      |  ^~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>a>>b>>c;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #injclude<bits/stdc++.h>
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<vector>>v;
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #injclude<bits/stdc++.h>
a.cc:6:18: error: 'v' was not declared in this scope
    6 |   vector<vector>>v;
      |                  ^
a.cc:7:3: error: 'map' was not declared in this scope
    7 |   map<int,int>count,count1;
      |   ^~~
a.cc:1:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
  +++ |+#include <map>
    1 | #injclude<bits/stdc++.h>
a.cc:7:7: error: expected primary-expression before 'int'
    7 |   map<int,int>count,count1;
      |       ^~~
a.cc:9:9: error: expected primary-expression before 'int'
    9 |  vector<int>x;
      |         ^~~
a.cc:12:5: error: 'x' was not declared in this scope
   12 |     x.push_back(s);
      |     ^
a.cc:15:5: error: 'count' was not declared in this scope
   15 |     count[v[i][0]]++;
      |     ^~~~~
a.cc:16:6: error: 'count1' was not declared in this scope
   16 |      count1[v[i][1]]++;
      |      ^~~~~~
a.cc:17:7: error: 'max' was not declared in this scope
   17 |   row=max(row, count[v[i][0]]++);
      |       ^~~
a.cc:22:1: error: 'cout' was not declared in this scope
   22 | cout<<row+column;
      | ^~~~
a.cc:22:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

int mat[max][max]={};

int main(){
    
    ios::sync_with_stdio(false);
    cin.tie(0);

    for(int i=0; i<max; i++){
        for(int j=0; j<max; j++){
            mat[i][j]=0;
        }
    }

    int h, w, m;
    cin >> h >> w >> m;

    int x, y;
    for(int i=0; i<m; i++){
        cin >> x >> y;
        mat[x][y]=1;
    }

    vector<int> row(h+1), col(w+1);
    for(int j=1; j<=w; j++){
        int count = 0;
        for(int i=1; i<=h; i++){
            if(mat[i][j]==1) count++;
        }
        col[j]=count;
    }

    for(int i=1; i<=h; i++){
        int count = 0;
        for(int j=1; j<=w; j++){
            if(mat[i][j]==1) count++;
        }
        row[i]=count;
    }

    long long int ans = 0;
    for(int i=1; i<=h; i++){
        for(int j=1; j<=w; j++){
            long long int temp = row[i]+col[j];
            if(mat[i][j]==1) temp--;
            ans = max(ans,temp);
        }
    }

    cout<<ans<<'\n';

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:22: error: expression cannot be used as a function
   49 |             ans = max(ans,temp);
      |                      ^
Language: C++

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

int mat[max][max]={};

int main(){
    
    ios::sync_with_stdio(false);
    cin.tie(0);

    for(int i=0; i<max; i++){
        for(int j=0; j<max; j++){
            mat[i][j]=0;
        }
    }

    int h, w, m;
    cin >> h >> w >> m;

    int x, y;
    for(int i=0; i<m; i++){
        cin >> x >> y;
        mat[x][y]=1;
    }

    vector<int> row(h+1), col(w+1);
    for(int j=1; j<=w; j++){
        int count = 0;
        for(int i=1; i<=h; i++){
            if(mat[i][j]==1) count++;
        }
        col[j]=count;
    }

    for(int i=1; i<=h; i++){
        int count = 0;
        for(int j=1; j<=w; j++){
            if(mat[i][j]==1) count++;
        }
        row[i]=count;
    }

    long long int ans = 0;
    for(int i=1; i<=h; i++){
        for(int j=1; j<=w; j++){
            long long int temp = row[i]+col[j];
            if(mat[i][j]==1) temp--;
            ans = max(ans,temp);
        }
    }

    cout<<ans<<'\n';

    return 0;
}


Compiler output:
a.cc:4:17: error: cannot resolve overloaded function 'max' based on conversion to type 'long unsigned int'
    4 | int mat[max][max]={};
      |                 ^
a.cc:4:5: error: size of array 'mat' has non-integral type '<unresolved overloaded function type>'
    4 | int mat[max][max]={};
      |     ^~~
a.cc:4:17: error: cannot resolve overloaded function 'max' based on conversion to type 'long unsigned int'
    4 | int mat[max][max]={};
      |                 ^
a.cc:4:5: error: size of array 'mat' has non-integral type '<unresolved overloaded function type>'
    4 | int mat[max][max]={};
      |     ^~~
a.cc: In function 'int main()':
a.cc:11:19: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   11 |     for(int i=0; i<max; i++){
      |                  ~^~~~
a.cc:12:23: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   12 |         for(int j=0; j<max; j++){
      |                      ~^~~~
Language: C

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

int main(void){
	int h,w,m,tmph,tmpw,maxh=0,maxw=0,i,j;
	scanf("%d %d %d",&h,&w,&m);
	//int cell[h][w];
	int log[m][2];
	int hcell[h],wcell[w];
	for(i=0;i<h;i++){
		hcell[i]=0;
		for(j=0;j<w;j++){
			//cell[i][j]=0;
			if(i){
				
			}else{
				wcell[j]=0;
				}
		}
	}
	
	
	for(i=0;i<m;i++){
		scanf("%d %d",&tmph,&tmpw);
		tmph--;
		tmpw--;
		//cell[tmph][tmpw]=1;
		m[0]=tmph;
		m[1]=tmpw;
		hcell[tmph]++;
		if(hcell[maxh]<hcell[tmph]){
			maxh=tmph;
		}
		wcell[tmpw]++;
		if(wcell[maxw]<wcell[tmpw]){
			maxw=tmpw;
		}
		//printf("%d %d,  %d %d\n",tmph,tmpw,hcell[tmph],wcell[tmpw]);
	}
	
	int tmp=0;
	for(i=0;i<m;i++){
		if(i[0]==maxh&&i[1]==maxw){
			tmp=1;break;
		}
	}
	printf("%d",hcell[maxh]+wcell[maxw]-tmp);
}

Compiler output:
main.c: In function 'main':
main.c:28:18: error: subscripted value is neither array nor pointer nor vector
   28 |                 m[0]=tmph;
      |                  ^
main.c:29:18: error: subscripted value is neither array nor pointer nor vector
   29 |                 m[1]=tmpw;
      |                  ^
main.c:43:21: error: subscripted value is neither array nor pointer nor vector
   43 |                 if(i[0]==maxh&&i[1]==maxw){
      |                     ^
main.c:43:33: error: subscripted value is neither array nor pointer nor vector
   43 |                 if(i[0]==maxh&&i[1]==maxw){
      |                                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
//型に気を付けよう
//a=0x61=97 '0'=0x30=48
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long  ll;
typedef long double  ld;
typedef string str;
typedef pair<int,int> pairii;
typedef vector<int> veci;
const double pi=3.1415926535;
const ll  mod=1000000007;
//桁数指定　cout << fixed << setprecision(2)

int MAX(vector<int> Vec){//配列の最大値
  int n=Vec.size();
  int max= -2147483647;
  for(int i=0;i<n;i++){
    if(max<Vec.at(i))max=Vec.at(i);
  }
  return max;}
int main() {
  int h,w;
  cin>>h>>w;
  int n;
  cin>>n;
  veci vh(n);veci vw(n);
  {rep(i,n)cin>>vh[i]>>vw[i];}
  veci hc(h+1);veci wc(w+1);
  rep(i,n){
    hc[vh[i]]++;
  }
  int ans=MAX(hc);int hma;int hhh=ans;
  {rep(i,h+1){if(hc[i]==hhh){hma=i;
  {rep(i,n)if(vh[i]==hma)vw[i]=0;}
  rep(j,n){
    wc[vw[j]]++;
  }
  wc[0]=0;
  ans+=MAX(wc);int anss=max(ans,anss);}}}cout<<anss<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:48: error: 'anss' was not declared in this scope; did you mean 'ans'?
   40 |   ans+=MAX(wc);int anss=max(ans,anss);}}}cout<<anss<<endl;
      |                                                ^~~~
      |                                                ans
Language: C++

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

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	ll h,w,m,a,b;

	cin >> h >> w >> m;

	map<ll,ll> row;
	map<ll,ll> col;
	set<pair<ll,ll>> s;
	for(int i = 0; i < m; i++){
		cin >> a >> b;
		row[a]++;
		col[b]++;
		s.insert({a,b});
	}

	

	ll p1 = 0,p1row;
	for(auto val : row){
		if(val.second > p1){
			p1 = val.second;
			p1row = val.first;
		}
	}
	
	ll cmx = 0;
	for(auto val : col){
		cmx = max(cmx,val.second);
	}

	ll ans = 0, curr;
	for(auto val : col){
		if(val.second == cmx){
			curr = p1 + val.second;
			if(s.find({p1row,val.first}) != s.end()){
				curr = p1 + max(0,val.second-1);
			}
			ans = max(ans,curr);
		}
	}

	cout << ans << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:48: error: no matching function for call to 'max(int, long long int)'
   43 |                                 curr = p1 + max(0,val.second-1);
      |                                             ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:43:48: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   43 |                                 curr = p1 + max(0,val.second-1);
      |                                             ~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:43:48: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   43 |                                 curr = p1 + max(0,val.second-1);
      |                                             ~~~^~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
//型に気を付けよう
//a=0x61=97 '0'=0x30=48
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long  ll;
typedef long double  ld;
typedef string str;
typedef pair<int,int> pairii;
typedef vector<int> veci;
const double pi=3.1415926535;
const ll  mod=1000000007;
//桁数指定　cout << fixed << setprecision(2)

int MAX(vector<int> Vec){//配列の最大値
  int n=Vec.size();
  int max= -2147483647;
  for(int i=0;i<n;i++){
    if(max<Vec.at(i))max=Vec.at(i);
  }
  return max;}
int main() {
  int h,w;
  cin>>h>>w;
  int n;
  cin>>n;
  veci vh(n);veci vw(n);
  {rep(i,n)cin>>vh[i]>>vw[i];}
  veci hc(h+1);veci wc(w+1);
  rep(i,n){
    hc[vh[i]]++;
  }
  int ans=MAX(hc);int hma;int hhh=ans;
  {rep(i,h+1){if(hc[i]==hhh){hma=i;
  {rep(i,n)if(vh[i]==hma)vw[i]=0;}
  rep(j,n){
    wc[vw[j]]++;
  }
  wc[0]=0;
  ans+=MAX(wc);anss=max(ans,anss);}}}cout<<anss<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:16: error: 'anss' was not declared in this scope; did you mean 'ans'?
   40 |   ans+=MAX(wc);anss=max(ans,anss);}}}cout<<anss<<endl;
      |                ^~~~
      |                ans
a.cc:40:44: error: 'anss' was not declared in this scope; did you mean 'ans'?
   40 |   ans+=MAX(wc);anss=max(ans,anss);}}}cout<<anss<<endl;
      |                                            ^~~~
      |                                            ans
Language: C++

#include <bits/stdc++.h>

#define ll long long

using namespace std;

const int N = 3e5 + 2;
ll r[N], c[N];

int main() {
	int h, w, m; cin >> h >> w >> m;
	int maxr = 0, maxc = 0;
	set<ll> s;
	ll mod = 1e6;
	while (m--) {
		int row, col; cin >> row >> col;
		++r[row];
		++c[col];
		s.insert(mod * row + col);
		if (r[maxr] < r[row]) maxr = row;
		if (c[maxc] < c[col]) maxc = col;
	}
	ll res = 0;
	for (int i = 1; i <= h; ++i) {
		res = max(res, c[maxc] + r[i] - s.count(i * mod + maxc));
	}
	cout << res;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:26: error: no matching function for call to 'max(long long int&, long long unsigned int)'
   25 |                 res = max(res, c[maxc] + r[i] - s.count(i * mod + maxc));
      |                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:25:26: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   25 |                 res = max(res, c[maxc] + r[i] - s.count(i * mod + maxc));
      |                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:25:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   25 |                 res = max(res, c[maxc] + r[i] - s.count(i * mod + maxc));
      |                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
char a[300000][300000];
long long N,M,k,ans=0;
long long search(long long x,long long y){
	long long ans1=0;
	for(int i=1;i<=M;i++){
		if(a[x][i]=='O') ans1++;
		if(a[i][y]=='O') ans1++;
	}
	return ans1;
}
int main(){
	cin>>N>>M;
	cin>>k;
	for(int i=1;i<=N;i++){
		for(int j=1;j<=M;j++){
			a[i][j]='#';
		}
	}
	for(int i=0;i<k;i++){
		long long x,y;
		cin>>x>>y;
		a[x][y]='O';
	}
	for(int i=1;i<=N;i++){
		for(int j=1;j<=M;j++){
			long long local;
			local = search(i,j);
			ans = max(ans,local); 
		}
	}
	cout<<ans;
	return 0;
}

Compiler output:
/tmp/ccttHLi9.o: in function `search(long long, long long)':
a.cc:(.text+0x7c): relocation truncated to fit: R_X86_64_PC32 against symbol `M' defined in .bss section in /tmp/ccttHLi9.o
/tmp/ccttHLi9.o: in function `main':
a.cc:(.text+0x96): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccttHLi9.o
a.cc:(.text+0xb2): relocation truncated to fit: R_X86_64_PC32 against symbol `M' defined in .bss section in /tmp/ccttHLi9.o
a.cc:(.text+0xc4): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/ccttHLi9.o
a.cc:(.text+0x11b): relocation truncated to fit: R_X86_64_PC32 against symbol `M' defined in .bss section in /tmp/ccttHLi9.o
a.cc:(.text+0x131): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccttHLi9.o
a.cc:(.text+0x197): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/ccttHLi9.o
a.cc:(.text+0x1d6): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccttHLi9.o
a.cc:(.text+0x1e8): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccttHLi9.o
a.cc:(.text+0x1f9): relocation truncated to fit: R_X86_64_PC32 against symbol `M' defined in .bss section in /tmp/ccttHLi9.o
a.cc:(.text+0x20f): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
#define INF 2e9
#define MOD 1000000007
#define MOD9 998244353
#define intMAX 51000;
#define PI 3.14159265359
using namespace std;
typedef long long llong;
typedef long double ldouble;

using Graph = vector<vector<int>>;

int main(){
  llong H, W, M;
  cin >> H >> W >> M;
  vector<vector<llong>> exist(H, vector<llong> (W, 0));
  vector<llong> Hnum(H, 0);
  vector<llong> Wnum(W, 0);
  for(int i=0; i<M; ++i) {
    llong h, w;
    cin >> h >> w;
    --h; --w;
    exist[h][w] = 1;
    ++Hnum[h]; ++Wnum[w];
  }
  vector<llong> Hindex(H);
  iota(Hindex.begin(), Hindex.end(), 0);
  vector<llong> Windex(W);
  iota(Windex.begin(), Windex.end(), 0);
  sort(Hindex.begin(), Hindex.end(), [&](int x, int y){return Hnum[x] > Hnum[y];});
  sort(Windex.begin(), Windex.end(), [&](int x, int y){return Wnum[x] > Wnum[y];});
  llong Hmax = Hnum[Hindex[0]];
  llong Wmax = Wnum[Windex[0]];
  llong ans = 0;
  for(auto& i:Hindex){
    if(Hnum[i] != Hmax) break;
    else{
      for(int k=0; k<W; ++k){
        j = Windex[k];
        if(Wnum[j] != Wmax) break;
        else{
          if(exist[i][j] == 0){
            cout << Hmax + Wmax << endl;
            return 0;
          }else{
            ans = Hmax + Wmax - 1;
          }
        }
      }
    }
  }
  cout << ans << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define vll vector<ll>
#define vvll vector<vll>
#define mll map<ll,ll>
#define f(i,m,n) for(i=m;i<n;i++)
#define ee endl
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define take(v,n) for(i=0;i<n;i++) cin>>v[i];
#define NO() cout<<"No"<<endl
#define YES() cout<<"Yes"<<endl
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define sot(v) sort(v.begin(),v.end());
bool isPrime(int n) 
{ 
    // Corner cases 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
  
    // This is checked so that we can skip  
    // middle five numbers in below loop 
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (int i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
}

ll powe(ll x, ll y){
    ll res = 1;
    while (y > 0){
        if (y & 1) res = res*x;
        y = y>>1;
        x = x*x;
    }
    return res;
}

void solve()
{
    ll i,j,k=0,n,m,l;
    cin>>n>>m>>k;
    mll row,col;
    vector<vector<bool>> v(n,vector<bool>(n,false))
    while(k--)
    {
        cin>>i>>j;
        i--;
        j--;
        v[i][j]=1;
        row[i]++;
        col[j]++;
    }
    ll ans=0;
    for(i=0;i<n;i++)
    {
        for(j=0;j<m;j++)
        {
            ans=max(ans,row[i]+col[j]-v[i][j]);
        }
    }
    cout<<ans<<ee;
}

int main() {
    fast;
    ll i,j,l,k,t,n;
    t=1;
    while(t--)
    solve();
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:51:5: error: expected ',' or ';' before 'while'
   51 |     while(k--)
      |     ^~~~~
Language: C++

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


pair<int, int> cntx[300000];
pair<int, int> cnty[300000];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
#ifndef ONLINE_JUDGE
  freopen("in", "r", stdin);
  freopen("out", "w", stdout);
#endif

  int h, w, m;
  cin >> h >> w >> m;
  set<pair<int, int>> S;
  for (int i = 0; i < h; ++i) cntx[i].second = i;
  for (int i = 0; i < w; ++i) cnty[i].second = i;

  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    cntx[a].first += 1;
    cnty[b].first += 1;
    S.insert({a, b});
  }
  sort(cntx, cntx + h);
  reverse(cntx, cntx + h);
  sort(cnty, cnty + w);
  reverse(cnty, cnty + w);
  int ans = cntx[0].first + cnty[0].first - 1;
  for (int i = 0; i < h; ++i) {
    if (cntx[i].first != cntx[0].first) {
      break;
    }
    for (int j = 0; j < w; ++j) {
      if (cnty[j].first != cnty[0].first) break;
      if (!S.count({cntx[i].second, cnty[j].second})) {
        ++ans;
        break;
      }
    }
    if (ans == cntx[0].first + cnty[0].first) break;
  }
  cout << ans;
  return 0;
}
#include <bits/stdc++.h>
using namespace std;


pair<int, int> cntx[300000];
pair<int, int> cnty[300000];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
#ifndef ONLINE_JUDGE
  freopen("in", "r", stdin);
  freopen("out", "w", stdout);
#endif

  int h, w, m;
  cin >> h >> w >> m;
  set<pair<int, int>> S;
  for (int i = 0; i < h; ++i) cntx[i].second = i;
  for (int i = 0; i < w; ++i) cnty[i].second = i;

  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    cntx[a].first += 1;
    cnty[b].first += 1;
    S.insert({a, b});
  }
  sort(cntx, cntx + h);
  reverse(cntx, cntx + h);
  sort(cnty, cnty + w);
  reverse(cnty, cnty + w);
  int ans = cntx[0].first + cnty[0].first - 1;
  for (int i = 0; i < h; ++i) {
    if (cntx[i].first != cntx[0].first) {
      break;
    }
    for (int j = 0; j < w; ++j) {
      if (cnty[j].first != cnty[0].first) break;
      if (!S.count({cntx[i].second, cnty[j].second})) {
        ++ans;
        break;
      }
    }
    if (ans == cntx[0].first + cnty[0].first) break;
  }
  cout << ans;
  return 0;
}


Compiler output:
a.cc:55:16: error: redefinition of 'std::pair<int, int> cntx [300000]'
   55 | pair<int, int> cntx[300000];
      |                ^~~~
a.cc:5:16: note: 'std::pair<int, int> cntx [300000]' previously defined here
    5 | pair<int, int> cntx[300000];
      |                ^~~~
a.cc:56:16: error: redefinition of 'std::pair<int, int> cnty [300000]'
   56 | pair<int, int> cnty[300000];
      |                ^~~~
a.cc:6:16: note: 'std::pair<int, int> cnty [300000]' previously defined here
    6 | pair<int, int> cnty[300000];
      |                ^~~~
a.cc:57:5: error: redefinition of 'int main()'
   57 | int main() {
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main() {
      |     ^~~~
Language: C++

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

int h, w, m;
vector <vector <int> > v;

main() {
  cin>>h>>w>>m;
  vector <int> temp(w, 0);
  v.assign(h, temp);
  int u, x;
  for (int i = 0; i<m; i++) {
    cin >> u >> x;
    v[u][x] = 1;
  }
  
  vector <vector <int> > ps_hor = v, ps_ver = v;
  
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      ps_hor[i][j] = ((j>0) ? (ps_hor[i-1][j] + v[i][j]) : v[i][j]);
      ps_ver[i][j] = ((i>0) ? (ps_hor[i][j-1] + v[i][j]) : v[i][j]);
    }
  }
  
  int ans = 0;
  
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      ans = max(ans, ps_hor[h-1][j] + ps_ver[i][w-1] - v[i][j];
    }
  }
  cout<<ans;
}

Compiler output:
a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:30:63: error: expected ')' before ';' token
   30 |       ans = max(ans, ps_hor[h-1][j] + ps_ver[i][w-1] - v[i][j];
      |                ~                                              ^
      |                                                               )
Language: Java

#include <bits/stdc++.h>
const int MAX=3e5+10;
const int modn=1e9+7;
typedef long long ll ;
#define int ll
#define endl '\n'
#define cwk     freopen("D:\\workplace\\CLion\\in.in","r",stdin),freopen("D:\\workplace\\CLion\\out.out","w",stdout)
using namespace std;
int h,w,m;
int x,y,flagx,flagy;
int maxx,maxy;
int ansx[MAX],ansy[MAX];
vector<pair<int,int>>v;
void solve(){
   cin>>h>>w>>m;
   for(int i=1;i<=m;i++){
       cin>>x>>y;
       v.push_back(pair<int,int>(x,y));
       ansx[x]++;
       ansy[y]++;
       if(ansx[x]>maxx){
           maxx=ansx[x];
           flagx=x;
       }
       if(ansy[y]>maxy){
           maxy=ansy[y];
           flagy=y;
       }
   }
   int cnt=0;
   for(int i=0;i<v.size();i++){
       if(v[i].first==flagx||v[i].second==flagy)
           cnt++;
   }
   cout<<cnt;
}
signed main() {
    //ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
    //cwk;
    int _=1;
    //cin>>_;
    while(_--){
        solve();
    }
    return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:3: error: class, interface, enum, or record expected
const int modn=1e9+7;
^
Main.java:4: error: class, interface, enum, or record expected
typedef long long ll ;
^
Main.java:5: error: illegal character: '#'
#define int ll
^
Main.java:6: error: illegal character: '#'
#define endl '\n'
^
Main.java:7: error: illegal character: '#'
#define cwk     freopen("D:\\workplace\\CLion\\in.in","r",stdin),freopen("D:\\workplace\\CLion\\out.out","w",stdout)
^
Main.java:9: error: class, interface, enum, or record expected
int h,w,m;
^
Main.java:10: error: class, interface, enum, or record expected
int x,y,flagx,flagy;
^
Main.java:11: error: class, interface, enum, or record expected
int maxx,maxy;
^
Main.java:12: error: class, interface, enum, or record expected
int ansx[MAX],ansy[MAX];
^
Main.java:13: error: unnamed classes are a preview feature and are disabled by default.
vector<pair<int,int>>v;
^
  (use --enable-preview to enable unnamed classes)
Main.java:15: error: not a statement
   cin>>h>>w>>m;
            ^
Main.java:17: error: not a statement
       cin>>x>>y;
             ^
Main.java:35: error: not a statement
   cout<<cnt;
       ^
Main.java:18: error: '.class' expected
       v.push_back(pair<int,int>(x,y));
                           ^
Main.java:18: error: '.class' expected
       v.push_back(pair<int,int>(x,y));
                               ^
Main.java:18: error: -> expected
       v.push_back(pair<int,int>(x,y));
                                     ^
Main.java:40: error: unnamed variables are a preview feature and are disabled by default.
    int _=1;
        ^
  (use --enable-preview to enable unnamed variables)
Main.java:42: error: as of release 9, '_' is a keyword, and may not be used as an identifier
    while(_--){
          ^
20 errors
Language: C++

#include <iostream>
#include <map>
using namespace std;
typedef pair<int, int> P;

int main()
{
    int h, w, m;
    cin >> h >> w >> m;
    int x[300005]{0}, y[100005]{0};
    map<P, int> mp;
    for(int i = 0; i < m; i++){
        int a, b;
        cin >> a >> b;
        a--; b--;
        x[a]++;
        y[b]++;
        mp[P(a, b)]++;
    }
    P px[300005], py[300005];
    for(int i = 0; i < h; i++) px[i] = P(x[i], i);
    for(int i = 0; i < w; i++) py[i] = P(y[i], i);
    sort(px, px + h, greater<P>());
    sort(py, py + w, greater<P>());
    bool f = false;
    for(int i = 0; px[i].first == px[0].first; i++){
        for(int j = 0; py[j].first == py[0].first; j++){
            if(!mp[P(px[i].second,py[j].second)]) f = true;
            break;
        }
        if(f) break;
    }
    if(f) cout << px[0].first + py[0].first << endl;
    else cout << px[0].first + py[0].first - 1 << endl;
}


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(px, px + h, greater<P>());
      |     ^~~~
      |     short
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <vector>
#include <functional>
#include <queue>
#include <unordered_set>
#include <climits>
#include <set>
#include <list>
#include <cmath>
#include <map>

using namespace std;
typedef long long ll;

int main()
{
	int H, W, M;
	cin >> H >> W >> M;
	vector<pair<int, int> > pair;
	int HTarget[300300];
	int WTarget[300300];
	for(int i = 0; i < 300300; i++){
		HTarget[i] = 0;
		WTarget[i] = 0;
	}
	for(int i = 0; i < M; i++){
		int h, w;
		cin >> h >> w;
		HTarget[h]++;
		WTarget[w]++;
		pair.push_back(make_pair<int, int>(h, w));
	}
	
	int HMax = 0;
	int WMax = 0;
	for(int i = 0; i < 300300; i++){
		HMax = max(HTarget[i], HMax);
		WMax = max(WTarget[i], WMax);
	}
	set<int> HMaxList;
	set<int> WMaxList;
	for(int i = 0; i < 300300; i++){
		if(HMax == HTarget[i]){
			HMaxList.insert(i);
		}
		if(WMax == WTarget[i]){
			WMaxList.insert(i);
		}
	}
	
	int count = 0;
	for(int i = 0; i < pair.size(); i++){
		if(HMaxList.find(pair[i].first) != HMaxList.end() && WMaxList.find(pair[i].second) != WMaxList.end()){
			count++;
		}
	}
	ll ans = 0;
	if(count == HMaxList.size() * WMaxList.size()){
		ans = HMax + WMax - 1;
	}else{
		ans = HMax + WMax;
	}
	cout << ans << endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:52: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
   37 |                 pair.push_back(make_pair<int, int>(h, w));
      |                                                    ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_pair.h:1132:21: note:   initializing argument 1 of 'constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = int; _T2 = int; typename __strip_reference_wrapper<typename decay<_Tp>::type>::__type = int; typename decay<_Tp>::type = int; typename __strip_reference_wrapper<typename decay<_Tp2>::type>::__type = int; typename decay<_Tp2>::type = int]'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |               ~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define END '\n'
#define int long long
#define pb push_back
#define pii pair<int, int>
#define ff first
#define ss second
#define bug(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define loop(i, a, b) for(int i = (a); i < (b); i++)
#define loopb(i, b, a) for(int i = (b); i > (a); --i) 
const int inf = 2e18;  
const int mod1 = 998244353;
const int mod = 1e9 + 7;
const int nax = 300005;
int r[nax],c[nax],m,h,w;
set<pii> targets;
void solve()
 {
  cin>>h>>w>>m;
  loop(i,0,m)
   {
    int y,x;
    cin>>y>>x;
    r[y]++;
    c[x]++;
    targets.insert({y,x});
   }
  int ans = 0;
  loop(i,1,h+1)
   loop(j,1,w+1)
     ans = max(ans,r[i] + c[j] - targets.count({i,j}));
  cout<<ans;
 }
signed main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0); 
  solve();
  // cerr<<END<<1.0*clock()/CLOCKS_PER_SEC;
  return 0;
} 

Compiler output:
a.cc: In function 'void solve()':
a.cc:32:15: error: no matching function for call to 'max(long long int&, long long unsigned int)'
   32 |      ans = max(ans,r[i] + c[j] - targets.count({i,j}));
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:32:15: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   32 |      ans = max(ans,r[i] + c[j] - targets.count({i,j}));
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:32:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   32 |      ans = max(ans,r[i] + c[j] - targets.count({i,j}));
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int mod=1000000007;

int main()
{

  ios::sync_with_stdio(0);
  cin.tie(0);
  int h,w,m,x,y;
  cin>>h>>w>>m;
  map<int,int> r,c;
  vector<pair<int,int> > d;
  while(m--){
    cin>>x>>y;
    r[x]++;
    c[y]++;
    d.push_back(make_pair<int,int>(x,y));
  }
  ll ans=0;
  vector<pair<int,int> >::iterator it;
  for(int i=1; i<=h; i++){
     for(int j=1; j<=w; j++){
        it=find(d.begin(),d.end(),make_pair<int,int>(i,j));
        if(it!=d.end()){ans=max(ans,(ll)(r[i]+c[j]-1));}
        else{ans=max(ans,(ll)(r[i]+c[j]));}
     }
  }
  cout<<ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:36: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
   19 |     d.push_back(make_pair<int,int>(x,y));
      |                                    ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:1132:21: note:   initializing argument 1 of 'constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = int; _T2 = int; typename __strip_reference_wrapper<typename decay<_Tp>::type>::__type = int; typename decay<_Tp>::type = int; typename __strip_reference_wrapper<typename decay<_Tp2>::type>::__type = int; typename decay<_Tp2>::type = int]'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |               ~~~~~~^~~
a.cc:25:54: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
   25 |         it=find(d.begin(),d.end(),make_pair<int,int>(i,j));
      |                                                      ^
/usr/include/c++/14/bits/stl_pair.h:1132:21: note:   initializing argument 1 of 'constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = int; _T2 = int; typename __strip_reference_wrapper<typename decay<_Tp>::type>::__type = int; typename decay<_Tp>::type = int; typename __strip_reference_wrapper<typename decay<_Tp2>::type>::__type = int; typename decay<_Tp2>::type = int]'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |               ~~~~~~^~~