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

#include <iostream>
using namespace std;

struct ret {
  long count;
  long mode;
  bool unique;
};

struct ret f(long* array, int size) {
  struct ret result;
  
  long count = 1;
  for (long j = 0; j < size; j++) {
    if (array[i] == array[j]) {
      count++;
      unique = false;
    }
  }

  if (count_max <= count) {
    count_max = count;
    mode = array[i];
  }
  
  result.mode = mode;
  result.count = count;
  result.unique = unique;
  
  return result;
}

int main() {
  long h, w, m;
  cin >> h >> w >> m;
  long posx[m], posy[m], xmode, ymode, xcount = 0, ycount = 0;
  bool xuniq = true, yuniq = true;
  for (long i = 0; i < m; i++) {
    cin >> posx[i] >> posy[i];
    struct ret x = f(posx, i);
    struct ret y = f(posy, i);
    xmode = x.mode;
    ymode = y.mode;
    xcount = x.count;
    ycount = y.count;
    xuniq = x.unique;
    yuniq = y.unique;
  }
  
  if (xuniq && yuniq) cout << 2;
  else if (xuniq && !yuniq) cout << 1 + y.count;
  else if (!xuniq && yuniq) cout << 1 + x.count;
  else {
    for (long i = 0; i < m; i++) {
      if (posx[i] == x.mode && posy[i] == y.mode) {
        cout << x.count + y.count - 1;
        return 0;
      }
    }
    cout << x.count + y.count;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'ret f(long int*, int)':
a.cc:15:15: error: 'i' was not declared in this scope
   15 |     if (array[i] == array[j]) {
      |               ^
a.cc:17:7: error: 'unique' was not declared in this scope
   17 |       unique = false;
      |       ^~~~~~
a.cc:21:7: error: 'count_max' was not declared in this scope
   21 |   if (count_max <= count) {
      |       ^~~~~~~~~
a.cc:23:5: error: 'mode' was not declared in this scope; did you mean 'mode_t'?
   23 |     mode = array[i];
      |     ^~~~
      |     mode_t
a.cc:23:18: error: 'i' was not declared in this scope
   23 |     mode = array[i];
      |                  ^
a.cc:26:17: error: 'mode' was not declared in this scope; did you mean 'mode_t'?
   26 |   result.mode = mode;
      |                 ^~~~
      |                 mode_t
a.cc:28:19: error: 'unique' was not declared in this scope
   28 |   result.unique = unique;
      |                   ^~~~~~
a.cc: In function 'int main()':
a.cc:51:41: error: 'y' was not declared in this scope
   51 |   else if (xuniq && !yuniq) cout << 1 + y.count;
      |                                         ^
a.cc:52:41: error: 'x' was not declared in this scope
   52 |   else if (!xuniq && yuniq) cout << 1 + x.count;
      |                                         ^
a.cc:55:22: error: 'x' was not declared in this scope
   55 |       if (posx[i] == x.mode && posy[i] == y.mode) {
      |                      ^
a.cc:55:43: error: 'y' was not declared in this scope
   55 |       if (posx[i] == x.mode && posy[i] == y.mode) {
      |                                           ^
a.cc:60:13: error: 'x' was not declared in this scope
   60 |     cout << x.count + y.count;
      |             ^
a.cc:60:23: error: 'y' was not declared in this scope
   60 |     cout << x.count + y.count;
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int64_t MOD=1000000007;
const long long INF = 1LL<<60;

int main() {
  int H,W,M; cin>>H>>W>>M;
  vector<int> LH(H,0),LW(W,0);
  vector<vector<bool>> B(H,vector<bool>(W,false));
  rep(i,M){
    int a,b; cin>>a>>b;
    a--;
    b--;
    B.at(a).at(b)=true;
    LH.at(a)++;
    LW.at(b)++;
  }
  int HM=0,WM=0;
  vector<int> HH,WW;
  rep(i,H){
    if(HM<LH.at(i)){
      HH={};
      HH.push_back(i);
      HM=LH.at(i);
    }
    else if(HM==LH.at(i)){
      HH.push_back(i);
    }
  }
  rep(i,W){
    if(WM<LW.at(i)){
      WW={};
      WW.push_back(i);
      WM=LW.at(i);
    }
    else if(WM==LW.at(i)){
      WW.push_back(i);
    }
  }
  int s=HH.size(),t=WW.size(),ans=WM+HM;
  bool c=false,finisf=false;
  rep(i,s){
    rep(j,t){
      if(B.at(HH.at(i)).at(WW.at(j))==false){
        c=true;
        finish=true;
        break;
      }
    }
    if(finish) break;
  }
  
  if(c) cout<<ans;
  else cout<<ans-1; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:9: error: 'finish' was not declared in this scope; did you mean 'finisf'?
   47 |         finish=true;
      |         ^~~~~~
      |         finisf
a.cc:51:8: error: 'finish' was not declared in this scope; did you mean 'finisf'?
   51 |     if(finish) break;
      |        ^~~~~~
      |        finisf
Language: C++

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

int main(){
 long int H, W, M;
  cin >> H >> W >> M;
  
  vector<vector<int>> data(H,vector<int>(W,0));
  
  for(long int i = 0; i < M; i++){
    long int a,b;
    cin >> a >> b;
    data.at(a).at(b) = 1;
  }
  
  long long int maxsum = 0;
  long int maxindex = 0;
  for(int k = 0;k < W;k++){
    long long int sum = 0;
    for(long int i = 0; i < H;i++){
      sum += data.at(i).at(k)
    }
    
    if(sum >= maxsum){
      maxindex = k;
      maxsum = sum;
    }
  }
  
  long long int maxsum2 = 0;
  long int maxindex2 = 0;
    for(long int k = 0;k < H;k++){
    long long int sum = 0;
    for(int i = 0; i < W;i++){
      sum += data.at(k).at(i)
    }
    
    if(sum >= maxsum2){
      maxindex2 = k;
      maxsum2 = sum;
    }
  }
  
  if(data.at(maxindex2).at(maxindex) == 1){
    cout << maxsum + maxsum2 - 1 << endl;
  }
else{
cout << maxsum + maxsum2 << endl;
}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:30: error: expected ';' before '}' token
   21 |       sum += data.at(i).at(k)
      |                              ^
      |                              ;
   22 |     }
      |     ~                         
a.cc:35:30: error: expected ';' before '}' token
   35 |       sum += data.at(k).at(i)
      |                              ^
      |                              ;
   36 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){int n,o;long m;cin>>n>>o>>m;
   vector<int>a(m);vector<int>b(m);
   for(int i=0;i<m;i++){cin>>a.at(i)>>b.at(i);}
sort(a.begin(),a.end());sort(b.begin(),b.end());
  int x=0,y=0,v=0,w=0,t=0,u=0;
  for(int i=0;i<m;i++)
  {if(a.at(i)==x)v++;else {if(t<v)t=v;x=a.at(i);v=0;}}
for(int i=0;i<m;i++)
{if(b.at(i)==y)w++;else {if(u<w)u=w;y=b.at(i);w=0;}
 if(t<v)t=v;if(u<w)u=w;
 cout<<v+w-1<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: expected '}' at end of input
   13 |  cout<<v+w-1<<endl;}
      |                     ^
a.cc:3:11: note: to match this '{'
    3 | int main(){int n,o;long m;cin>>n>>o>>m;
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){int n,w;long m;cin>>n>>w>>m;
   vector<int>a(m);vector<int>b(m);
   for(int i=0;i<m;i++){cin>>a.at(i)>>b.at(i);}
sort(a.begin(),a.end());sort(b.begin(),b.end());
  int x=0,y=0,v=0,w=0,t=0,u=0;
  for(int i=0;i<m;i++)
  {if(a.at(i)==x)v++;else {if(t<v)t=v;x=a.at(i);v=0;}}
for(int i=0;i<m;i++)
{if(b.at(i)==y)w++;else {if(u<w)u=w;y=b.at(i);w=0;}
 if(t<v)t=v;if(u<w)u=w;
 cout<<v+w-1<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: redeclaration of 'int w'
    7 |   int x=0,y=0,v=0,w=0,t=0,u=0;
      |                   ^
a.cc:3:18: note: 'int w' previously declared here
    3 | int main(){int n,w;long m;cin>>n>>w>>m;
      |                  ^
a.cc:13:21: error: expected '}' at end of input
   13 |  cout<<v+w-1<<endl;}
      |                     ^
a.cc:3:11: note: to match this '{'
    3 | int main(){int n,w;long m;cin>>n>>w>>m;
      |           ^
Language: C++

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


int main() {

  int H;
  int W;
  int M;
  int H_Max=0;
  int W_Max=0;
  int Ans=0;
  int Count=0;
cin >> H >> W >> M;
  vector<int>Height(M);
  vector<int>Width(M);
  vector<int>H_matome(H);
  vector<int>W_matome(W);
  vector<int>H_Max_matome(0);
  vector<int>W_Max_matome(0);
  vector<vector<int>>Haichi(H,vector<int>(W));
  
  for(int i=0; i<M; i++){
    cin >> Height.at(i);
    cin >> Width.at(i);
    Height.at(i)--;
    Width.at(i)--;
    H_matome.at(Height.at(i))++;
    W_matome.at(Width.at(i))++;
    Haichi.at(Height.at(i)).at(Width.at(i));
  }
  
  for(int i=0; i<H; i++){
    H_Max=max(H_Max,H_matome.at(i));
  }
  for(int i=0; i<W; i++){
    W_Max=max(W_Max,W_matome.at(i));
  }
  for(int i=0; i<H; i++){
    if(H_Max==H_matome.at(i)){
    H_Max_matome.push_back(i);
    }
  }
  for(int i=0; i<W; i++){
    if(W_Max==W_matome.at(i)){
    W_Max_matome.push_back(i);
    }
  }
  for(int i=0;i<H_Max_matome.size();i++){
    for(int j=0;j<W_Max_matome.size();j++){
    if(Count+Haichi.at(H_Max_matome.at(i)).at(W_Max_matome.at(j))=0){
      Ans=-1;
    }
    }
  }
  Ans=Ans+H_Max+W_Max;

  cout << Ans;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:31: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   30 |     Haichi.at(Height.at(i)).at(Width.at(i));
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
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:1180:7: note: declared here
 1180 |       at(size_type __n)
      |       ^~
a.cc:51:13: error: lvalue required as left operand of assignment
   51 |     if(Count+Haichi.at(H_Max_matome.at(i)).at(W_Max_matome.at(j))=0){
      |        ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){int n,w;long m;cin>>n>>w>>m;
   vector<int>a(m);vector<int>b(m);
   for(int i=0;i<m;i++){cin>>a.at(i)>>b.at(i);}
sort(a.begin(),a.end());sort(b.begin(),b.end());
  int x=0,y=0,v=0;w=0,t=0,u=0;
  for(int i=0;i<m;i++)
  {if(a.at(i)==x)v++;else {if(t<v)t=v;x=a.at(i);v=0;}}
for(int i=0;i<m;i++)
{if(b.at(i)==y)w++;else {if(u<w)u=w;y=b.at(i);w=0;}
 if(t<v)t=v;if(u<w)u=w;
 cout<<v+w-1<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: 't' was not declared in this scope
    7 |   int x=0,y=0,v=0;w=0,t=0,u=0;
      |                       ^
a.cc:7:27: error: 'u' was not declared in this scope
    7 |   int x=0,y=0,v=0;w=0,t=0,u=0;
      |                           ^
a.cc:13:21: error: expected '}' at end of input
   13 |  cout<<v+w-1<<endl;}
      |                     ^
a.cc:3:11: note: to match this '{'
    3 | int main(){int n,w;long m;cin>>n>>w>>m;
      |           ^
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int h = Integer.parseInt(sc.next());
    int w = Integer.parseInt(sc.next());
    int m = Integer.parseInt(sc.next());
    int[][] arr = new int[m][2];
    int[] arr_h = new int[h+1];
    int[] arr_w = new int[w+1];

    for(int i = 0; i<m; i++){
      int h_i = Integer.parseInt(sc.next());
      int w_i = Integer.parseInt(sc.next());
      arr[i][0] = h_i;
      arr[i][1] = w_i;
      arr_h[h_i]++;
      arr_w[w_i]++;
    }

    ArrayList<Integer> h_maxIdx = getMaxIdx(arr_h);
    ArrayList<Integer> w_maxIdx = getMaxIdx(arr_w);

    int ans = arr_h[h_maxIdx.get(0)] + arr_w[w_maxIdx.get(0)];
    int flg = 0;

    for(int i=0; i<h_maxIdx.size(); i++){
      for(int j=0; j<w_maxIdx.size(); j++){
        int judge = false;
        
        if(judge = true){
          flg = 1;
          break;
        }
      }
    }
    if(flg == 0){
      ans--;
    }

    System.out.println(ans);
   
    sc.close();
    return;
  }

  public static ArrayList<Integer> getMaxIdx(int[] arr){
    ArrayList<Integer> maxIdx = new ArrayList<Integer>();
    int max = -1;
    for(int i = 0; i< arr.length; i++){
        if(arr[i] > max){
          max = arr[i];
          maxIdx = new ArrayList<Integer>();
          maxIdx.add(i);
        }else if(arr[i] == max){
          maxIdx.add(i);
        }
    }
    return maxIdx;
  }
  
  
}


Compiler output:
Main.java:30: error: incompatible types: boolean cannot be converted to int
        int judge = false;
                    ^
Main.java:32: error: incompatible types: boolean cannot be converted to int
        if(judge = true){
                   ^
Main.java:32: error: incompatible types: int cannot be converted to boolean
        if(judge = true){
                 ^
3 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
int ans = 0;
const int MAXN = 3e5+9;
int row[MAXN], col[MAXN];
int R, C, M;
void func() {
	for (int i = 0; i < max(R, C); ++i) {
		if(i < R && i < C) {
			ans = max(ans, row[i] + col[i] - 1);
		}
		if(i < R){
			ans = max(ans, row[i]);
		}
		if(i < C){
			ans = max(ans, col[i]);
		}
	}
}

int main() {
	//freopen("input.txt", "r", stdin);

	cin >> R >> C >> M;
	// string s[R+5];
	// for (int i = 0; i < R; ++i) {
	// 	cin >> s[i];
	// }
	priority<int> Q;
	for (int i = 0; i < M; ++i) {
		int r, c;
		cin >> r >> c;
		--r;
		--c;
		++row[r];
		++col[c];
		Q.push(r + c);
		Q.push(r);
		Q.push(c);
	}

	// for (int i = 0; i < R; ++i) {
	// 	for (int j = 0; j < C; ++j){
	// 		ans = max(ans, row[i] + col[j] - 1);
	// 	}
	// }
	sort(row, row + R, greater<int>());
	sort(col, col + C, greater<int>());
	func();

	sort(row, row + R, greater<int>());
	sort(col, col + C);
	func();

	sort(row, row + R);
	sort(col, col + C, greater<int>());
	func();

	sort(row, row + R);
	sort(col, col + C);
	func();

	while((int)Q.size() > 0) {
		ans = max(ans, Q.top());
		Q.pop();
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: 'priority' was not declared in this scope
   29 |         priority<int> Q;
      |         ^~~~~~~~
a.cc:29:18: error: expected primary-expression before 'int'
   29 |         priority<int> Q;
      |                  ^~~
a.cc:37:17: error: 'Q' was not declared in this scope
   37 |                 Q.push(r + c);
      |                 ^
a.cc:63:20: error: 'Q' was not declared in this scope
   63 |         while((int)Q.size() > 0) {
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int H,W,M;
    cin>>H>>W>>M;
    int p=H*W;
    int arr[p/2][2];
    for(int i=0;i<p/2;i++){
        for(int j=0;j<2;j++){
            cin>>arr[i][j];
        }
    }
    int count=0,p=0,p2=0;
    for(int i=0;i<p/2;i++){
        for(int j=0;j<p/2;j++){
            if(arr[i][0]==arr[j][0]){
                count++;
            }
        }
        if(count>p){
            p=count;
        }
        count=0;
    }
    count=0;
    for(int i=0;i<p/2;i++){
        for(int j=0;j<p/2;j++){
            if(arr[i][1]==arr[j][1]){
                count++;
            }
        }
        if(count>p2){
            p=count;
        }
        count=0;
    }
    cout<<p+p2-1<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: redeclaration of 'int p'
   13 |     int count=0,p=0,p2=0;
      |                 ^
a.cc:6:9: note: 'int p' previously declared here
    6 |     int p=H*W;
      |         ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<set>
#include<tuple>
#include<ctime>
#include<functional>
#include<cmath>
#include<cassert>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> p; 
#define rep(i,n) for(ll i=0;i<(n);i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("Yes")
#define p_no() p("No")
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))

int main(){
    ll H,W,M,h[300010],w[300010],hmax=0,wmax=0,g[300010],r[300010],ans=0,ix1=0,ix2=0,fi[300000][300000]=0;
    cin>>H>>W>>M;
    rep(i,M){
        cin>>h[i]>>w[i];
        g[h[i]]++;
        r[w[i]]++;
        if(hmax<g[h[i]]){
             hmax=g[h[i]];
              ix1=h[i];
             }
        if(wmax<r[w[i]]) 
        {
            wmax=r[w[i]];
            ix2=w[i];
        }
        fi[h[i]][w[i]]=1;
    }
    if(fi[ix1][ix2]==1) ans=hmax+wmax-1;
    else ans=hmax+wmax;
    p(ans);   
    

}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:105: error: array must be initialized with a brace-enclosed initializer
   34 |     ll H,W,M,h[300010],w[300010],hmax=0,wmax=0,g[300010],r[300010],ans=0,ix1=0,ix2=0,fi[300000][300000]=0;
      |                                                                                                         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){int n,w;long m;cin>>n>>w>>m;
   vector<int>a(m);vector<int>b(m);
   for(int i=0;i<m;i++){cin>>a.at(i)>>b.at(i);}
sort(a.begin();a.end());sort(b.begin();b.end());
  int x=0,y=0,v=0;w=0,t=0,u=0;
  for(int i=0;i<m;i++)
  {if(a.at(i)==x)v++;else {if(t<v)t=v;x=a.at(i);v=0;}}
for(int i=0;i<m;i++)
{if(b.at(i)==y)w++;else {if(u<w)u=w;y=b.at(i);w=0;}
 if(t<v)t=v;if(u<w)u=w;
 cout<<v+w-1<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: expected ')' before ';' token
    6 | sort(a.begin();a.end());sort(b.begin();b.end());
      |     ~         ^
      |               )
a.cc:6:23: error: expected ';' before ')' token
    6 | sort(a.begin();a.end());sort(b.begin();b.end());
      |                       ^
      |                       ;
a.cc:6:21: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::end() [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator]', declared with attribute 'nodiscard' [-Wunused-result]
    6 | sort(a.begin();a.end());sort(b.begin();b.end());
      |                ~~~~~^~
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:893:7: note: declared here
  893 |       end() _GLIBCXX_NOEXCEPT
      |       ^~~
a.cc:6:39: error: expected ')' before ';' token
    6 | sort(a.begin();a.end());sort(b.begin();b.end());
      |                             ~         ^
      |                                       )
a.cc:6:47: error: expected ';' before ')' token
    6 | sort(a.begin();a.end());sort(b.begin();b.end());
      |                                               ^
      |                                               ;
a.cc:6:45: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::end() [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator]', declared with attribute 'nodiscard' [-Wunused-result]
    6 | sort(a.begin();a.end());sort(b.begin();b.end());
      |                                        ~~~~~^~
/usr/include/c++/14/bits/stl_vector.h:893:7: note: declared here
  893 |       end() _GLIBCXX_NOEXCEPT
      |       ^~~
a.cc:7:23: error: 't' was not declared in this scope
    7 |   int x=0,y=0,v=0;w=0,t=0,u=0;
      |                       ^
a.cc:7:27: error: 'u' was not declared in this scope
    7 |   int x=0,y=0,v=0;w=0,t=0,u=0;
      |                           ^
a.cc:13:21: error: expected '}' at end of input
   13 |  cout<<v+w-1<<endl;}
      |                     ^
a.cc:3:11: note: to match this '{'
    3 | int main(){int n,w;long m;cin>>n>>w>>m;
      |           ^
Language: C++

#include <bits/stdc++.h>

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"

using namespace std;
using ll = long long;
using P = pair<ll, ll>;

const ll MOD = 1000000007LL; // = 10^9 + 7
const double PI = 3.14159265358979;

void solve()
{
  ll h, w, m, hin, win;
  cin >> h >> w >> m;
  vector<ll> ah(h + 1, 0);
  vector<ll> aw(w + 1, 0);
  set<ll> hash;
  for(int i = 0; i < m; ++i)
  {
    cin >> hin >> win;
    ah[hin]++;
    aw[win]++;
    hash.insert((hin << 32LL) + win);
  }
  ll ah_max_ind = distance(ah.begin(), max_element(ah.begin(), ah.end()));
  ll aw_max_ind = distance(aw.begin(), max_element(aw.begin(), aw.end()));

  vector<ll> ah_ind;
  vector<ll> aw_ind;
  for(const auto& ih : ah) if (ih == ah[ah_max_ind])
  {
    ah_ind.emplace_back(i);
  }
  for(const auto& iw : aw) if (iw == aw[aw_max_ind])
  {
    aw_ind.emplace_back(i);
  }

  ll ans = ah[ah_max_ind] + aw[aw_max_ind];
  for(const auto& ih : ah_ind) for(const auto& iw : aw_ind)
  {
    if (hash.find( (ih << 32LL) + iw ) == hash.end())
    {
      cout << ans;
      return;
    }
  }

  if (hash.find( (ah_max_ind << 32LL) + aw_max_ind ) != hash.end()) ans--;
  cout << ans << endl;
}

int main()
{
  fastio;
  solve();

  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:34:25: error: 'i' was not declared in this scope; did you mean 'ih'?
   34 |     ah_ind.emplace_back(i);
      |                         ^
      |                         ih
a.cc:38:25: error: 'i' was not declared in this scope; did you mean 'iw'?
   38 |     aw_ind.emplace_back(i);
      |                         ^
      |                         iw
Language: C++

#include<iostream>
#include<set>
#include<map>
using namespace std;
int main()
{
    //freopen("in.txt","r",stdin);
    int n,m;
    scanf("%d %d",&n,&m);
    int q;
    scanf("%d",&q);
    set<pair<int,int> > s;
    map<int,int> countx;
    map<int,int> county;
    int temp=q;
    while(temp--)
    {
        int x,y;
        scanf("%d %d",&x,&y);
        s.insert({x,y});
        countx[x]++;
        county[y]++;
    }
    int maxm=INT_MIN;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            int x1=i+1;
            int x2=j+1;
            int cnt=countx[x1]+county[x2];
            pair<int ,int > p;
            p.first=x1;
            p.second=x2;
            if(s.find(p)==s.end())
                maxm=max(maxm,cnt);
            else 
                maxm=max(maxm,cnt-1);

        }
    }
    printf("%d\n",maxm);
    


}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:14: error: 'INT_MIN' was not declared in this scope
   24 |     int maxm=INT_MIN;
      |              ^~~~~~~
a.cc:4:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include<map>
  +++ |+#include <climits>
    4 | using namespace std;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){int n,w;long m;cin>>n>>w>>m;
   vector<int>a(m);vector<int>b(m)
   for(int i=0;i<m;i++){cin>>a.at(i)>>b.at(i);}
sort(a.begin();a.end());sort(b.begin();b.end());
  int x=0,y=0,v=0;w=0,t=0,u=0;
  for(int i=0;i<m;i++)
  {if(a.at(i)==x)v++;else {if(t<v)t=v;x=a.at(i);v=0;}}
for(int i=0;i<m;i++)
{if(b.at(i)==y)w++;else {if(u<w)u=w;y=b.at(i);w=0;}
 if(t<v)t=v;if(u<w)u=w;
 cout<<v+w-1<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:4: error: expected ',' or ';' before 'for'
    5 |    for(int i=0;i<m;i++){cin>>a.at(i)>>b.at(i);}
      |    ^~~
a.cc:5:16: error: 'i' was not declared in this scope
    5 |    for(int i=0;i<m;i++){cin>>a.at(i)>>b.at(i);}
      |                ^
a.cc:6:15: error: expected ')' before ';' token
    6 | sort(a.begin();a.end());sort(b.begin();b.end());
      |     ~         ^
      |               )
a.cc:6:23: error: expected ';' before ')' token
    6 | sort(a.begin();a.end());sort(b.begin();b.end());
      |                       ^
      |                       ;
a.cc:6:21: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::end() [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator]', declared with attribute 'nodiscard' [-Wunused-result]
    6 | sort(a.begin();a.end());sort(b.begin();b.end());
      |                ~~~~~^~
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:893:7: note: declared here
  893 |       end() _GLIBCXX_NOEXCEPT
      |       ^~~
a.cc:6:39: error: expected ')' before ';' token
    6 | sort(a.begin();a.end());sort(b.begin();b.end());
      |                             ~         ^
      |                                       )
a.cc:6:47: error: expected ';' before ')' token
    6 | sort(a.begin();a.end());sort(b.begin();b.end());
      |                                               ^
      |                                               ;
a.cc:6:45: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::end() [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator]', declared with attribute 'nodiscard' [-Wunused-result]
    6 | sort(a.begin();a.end());sort(b.begin();b.end());
      |                                        ~~~~~^~
/usr/include/c++/14/bits/stl_vector.h:893:7: note: declared here
  893 |       end() _GLIBCXX_NOEXCEPT
      |       ^~~
a.cc:7:23: error: 't' was not declared in this scope
    7 |   int x=0,y=0,v=0;w=0,t=0,u=0;
      |                       ^
a.cc:7:27: error: 'u' was not declared in this scope
    7 |   int x=0,y=0,v=0;w=0,t=0,u=0;
      |                           ^
a.cc:13:21: error: expected '}' at end of input
   13 |  cout<<v+w-1<<endl;}
      |                     ^
a.cc:3:11: note: to match this '{'
    3 | int main(){int n,w;long m;cin>>n>>w>>m;
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using Graph=vector<vector<int>>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
typedef long long ll;
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main(){
    ll H,W;
    cin>>H>>W;
    ll M;
    cin>>M;
    vector<pair<ll,ll>>B(H);
    for(ll i=0;i<H;i++){
        B[i]=make_pair(0,i);
    }
    vector<pair<ll,ll>>C(W);
    for(ll i=0;i<W;i++){
        C[i]=make_pair(0,i);
    }
    set<pair<ll,ll>>A;
    for(ll i=0;i<M;i++){
        ll h,w;
        cin>>h>>w;
        h--;w--;
        A.insert(make_pair(h,w));
        B[h].first++;
        C[w].first++;
    }
    sort(B.begin(),B.end());
    reverse(B.begin(),B.end());
    sort(C.begin(),C.end());
    reverse(C.begin(),C.end());
    ll ans=0;
    ans=B[0].first+C[0].first;
    if(set.count(make_pair(B[0].second,C[0].second)){
        cout<<ans<<endl;
    }
    else{
        ll cnt1=1;
        ll cnt2=1;
        for(ll i=1;i<H;i++){
            if(B[i].first<B[i-1].first){
                break;
            }
            else{
                cnt1++;
            }
        }
        for(ll i=1;i<W;i++){
            if(C[i].first<C[i-1].first){
                break;
            }
            else{
                cnt2++;
            }
        }
        bool frag=false;
        for(ll i=0;i<cnt1;i++){
            for(ll j=0;j<cnt2;j++){
                if(set.count(make_pair(B[i].second,C[i].second)){
                    frag=true;
                }
            }
        }
        if(frag){
            cout<<ans<<endl;
        }
        else{
            cout<<ans-1<<endl;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:11: error: expected unqualified-id before '.' token
   48 |     if(set.count(make_pair(B[0].second,C[0].second)){
      |           ^
a.cc:84:6: error: expected ')' before '}' token
   84 |     }
      |      ^
      |      )
   85 | }
      | ~     
a.cc:48:7: note: to match this '('
   48 |     if(set.count(make_pair(B[0].second,C[0].second)){
      |       ^
a.cc:85:1: error: expected primary-expression before '}' token
   85 | }
      | ^
Language: C++

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using P = pair<int, int>;

void Main(){
    int h, w, m; cin >> h >> w >> m;
    vector<P> exist;
    vi cx(h, 0);
    vi cy(w, 0);

    rep(i, m){
        int x, y; cin >> x >> y; x--; y--;
        cx[x]++;
        cy[y]++;
        exist.pb({x, y});
    }
    
    vector<P> cntx(h), cnty(w);
    rep(i, h) cntx[i] = {cx[i], i};
    rep(i, w) cnty[i] = {cy[i], i};
    
    sort(rall(cntx));
    sort(rall(cnty));
    
    /*
    for(auto [c, i] : cntx) cout << c << " " << i << endl;
    cout << endl;
    for(auto [c, i] : cnty) cout << c << " " << i << endl;
    */
    
    int ans = 0;
    for(auto [x, y] : exist){
        ans = max(ans, cx[x] + cy[y] - 1);
    }
    
    int mx = cntx[0].fi + cnty[0].fi;
    // cout << mx << endl << endl;
    if(ans >= mx) {
        cout << ans << endl;
        return;
    }
    
    vi candx, candy;
    rep(i, h){
        if(cntx[i].fi == cntx[0].fi) candx.pb(cntx[i].se);
        else break;
    }
    rep(i, w){
        if(cnty[i].fi == cnty[0].fi) candy.pb(cnty[i].se);
        else break;
    }

    for(auto x : candx){
        for(auto y : candy){
            // cout << x << " " << y << endl;
            //*
            if(bomb[x][y] == 0){
                cout << mx << endl;
                return;
            }
            //*/
        }
    }
    cout << mx - 1 << endl;
    return;
}

int main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}

Compiler output:
a.cc: In function 'void Main()':
a.cc:72:16: error: 'bomb' was not declared in this scope
   72 |             if(bomb[x][y] == 0){
      |                ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
int main()
{
  int h,w,m,a,b,i,j;
  unordered_set s<pair<int int> >;
  unordered_map<int ,int>m1,m2;
  cin>>m;
  for(i=0;i<m;i++)
  {cin>>a>>b;
   s.insert(mp(a,b));
   m1[a]++;
   m2[b]++;
  }
  int mx=INT_MIN;
  unordered_map<int ,int>::iterator it,ia;
  for(it=m1.begin();it!=m1.end();it++)
  {
    for(ia=m2.begin();ia!=m2.end();ia++)
    {
      	int u=it->second+ia->second;
        if(s.count(mp(it->first,ia->first)))
          u-=1;
        mx=max(u,mx);
      
    }
  }
  cout<<mx<<endl;
}
   

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: expected initializer before '<' token
    7 |   unordered_set s<pair<int int> >;
      |                  ^
a.cc:12:4: error: 's' was not declared in this scope
   12 |    s.insert(mp(a,b));
      |    ^
a.cc:23:12: error: 's' was not declared in this scope
   23 |         if(s.count(mp(it->first,ia->first)))
      |            ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define vv(T) vector<vector<T>>
using namespace std;
using ll = long long;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using vll = vector<long long>;
using vvll = vector<vector<long long>>;
using vbool = vector<bool>;
using vvbool = vector<vector<bool>>;
using qint = queue<int>;
using sint = stack<int>;
using pii = pair<int, int>;


int main(){
    int h, w, m;
    cin >> h >> w >> m;
    vector<vector<bool>> target(h, vector<bool>(w, false));
    rep(i, m){
        int th, tw;
        cin >> th >> tw;
        th--;
        tw--;
        target[th][tw] = true;
    }

    // for(auto row:target){
    //     for(auto element : row){
    //         cout << element;
    //     }
    //     cout << endl;
    // }

    vector<pair<ll, int>> rowInfo(h), columnInfo(w);
    rep(i, h){
        ll tmp = accumulate(target[i].begin(), target[i].end(), 0);
        rowInfo[i] = make_pair(-tmp, i);
    }
    rep(i, w){
        ll tmp = 0;
        rep(j, h){
            tmp += target[j][i];
        }
        columnInfo[i] = make_pair(-tmp, i);
    }

    sort(rowInfo.begin(), rowInfo.end());
    sort(columnInfo.begin(), columnInfo.end());

    ll ans = 0;
    // int row = 0;
    // ll rowNum = -rowInfo[row].first;
    // int i = rowInfo[row].second;
    // int column = 0;
    // ll columnNum = -columnInfo[column].first;
    // int j = columnInfo[column].second;
    // ll tmp = rowNum + columnNum;
    // if(target[i][j] == 1){
    //     tmp--;
    // }
    // ans = max(ans, tmp);
    for(int row = 0; row < h; row++){
        bool flag = false;
        ll previous = 0;
        ll tgt = -rowInfo[row].first;
        int i = rowInfo[row].second;
        for(int column = 0; column < w; column++){
            ll num = -columnInfo[column].first;
            if(flag && !prevous == num) break;
            int j = columnInfo[column].second;
            ll tmp = tgt + num;
            if(target[i][j] == true){
                tmp--;
            }
            ans = max(ans, tmp);
            if(tmp < ans) flag = true;
            previous = num;
        }
    }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:71:25: error: 'prevous' was not declared in this scope; did you mean 'previous'?
   71 |             if(flag && !prevous == num) break;
      |                         ^~~~~~~
      |                         previous
Language: C++

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

int main(){
  int H = 0;
  int W = 0;
  int M = 0;
  int hozon = 0;
  int counter = 0;
  cin >> H >> W >> M;
  vector<int> h(M);
  vector<int> w(M);
  for(int i = 0; i < M; i++){
    cin >> h.at(i) >> w.at(i);
  }
  
  /*for(int i = 0; i < M; i++){
    cout << h.at(i) << w.at(i) << endl;
  }*/
  
  for(int i = 0; i < H; i++){	//surveyの高さ
    for(int j = 0; j < W; j++){	//横
      for(int k = 0; k < M; k++) {	//爆弾の座標用
        if(h.at(k) == i + 1 || w.at(k) == j + 1) {
          counter++;
      }
      if(counter > hozon) {
        hozon = counter;
      }
      counter = 0;
    }
  }
  cout << hozon << endl;
}

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

#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
int main()
{
  int h,w,m,a,b;
  unordered_set s<pair>;
  unordered_map<int ,int>m1,m2;
  cin>>m;
  for(i=0;i<m;i++)
  {cin>>a>>b;
   s.insert(mp(a,b));
   m1[a]++;
   m2[b]++;
  }
  int mx=INT_MIN;
  unordered_map<int ,int>::iterator it,ia;
  for(it=m1.begin();it!=m1.end();it++)
  {
    for(ia=m2.begin();ia!=m2.end();ia++)
    {
      	int u=it->second+ia->second;
        if(s.count(mp(it->first,ia->first)))
          u-=1;
        mx=max(u,mx);
      
    }
  }
  cout<<mx<<endl;
}
   

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: expected initializer before '<' token
    7 |   unordered_set s<pair>;
      |                  ^
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   for(i=0;i<m;i++)
      |       ^
a.cc:12:4: error: 's' was not declared in this scope
   12 |    s.insert(mp(a,b));
      |    ^
a.cc:23:12: error: 's' was not declared in this scope
   23 |         if(s.count(mp(it->first,ia->first)))
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1000000010
#define EPS 1e-9
#define F first
#define S second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define lp(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"

typedef pair<int,int> PII;
typedef pair<int,string> PIS;
typedef pair<string,int> PSI;
PII H[h],W[w];
map<PII,int> mp;


signed main(){
  cin.tie(0);	
  ios::sync_with_stdio(false);
  int h,w,m;
  cin>>h>>w>>m;
  
  rep(i,h){
    H[i]=make_pair(0,i);
  }
  rep(i,w){
    W[i]=make_pair(0,i);
  }
  int ans=0;
  
  rep(i,m){
    int a,b;
    cin>>a>>b;
    H[a-1].F++;
    W[b-1].F++;
    mp[make_pair(a-1,b-1)]++;
  }
  sort(H,H+h);
  sort(W,W+w);
  //rep(i,h) cout<<H[i].F<<endl;
  int hmx=H[h-1].F,wmx=W[w-1].F;
  int nowh=h-1,noww=w-1;
  while(H[nowh].F==hmx){
    noww=w-1;
    while(W[noww].F==wmx){
      if(mp.find(make_pair(H[nowh].S,W[noww].S))==mp.end() ){
	cout<<hmx+wmx<<endl;
	return 0;
      }
      noww--;
    }
    nowh--;
  }
  cout<<max(hmx+wmx-1,(int)0)<<endl;
    


  return 0;
}


Compiler output:
a.cc:21:7: error: 'h' was not declared in this scope
   21 | PII H[h],W[w];
      |       ^
a.cc:21:12: error: 'w' was not declared in this scope
   21 | PII H[h],W[w];
      |            ^
a.cc: In function 'int main()':
a.cc:32:5: error: 'H' was not declared in this scope
   32 |     H[i]=make_pair(0,i);
      |     ^
a.cc:35:5: error: 'W' was not declared in this scope
   35 |     W[i]=make_pair(0,i);
      |     ^
a.cc:42:5: error: 'H' was not declared in this scope
   42 |     H[a-1].F++;
      |     ^
a.cc:43:5: error: 'W' was not declared in this scope
   43 |     W[b-1].F++;
      |     ^
a.cc:46:8: error: 'H' was not declared in this scope
   46 |   sort(H,H+h);
      |        ^
a.cc:47:8: error: 'W' was not declared in this scope
   47 |   sort(W,W+w);
      |        ^
a.cc:53:22: error: 'wmx' was not declared in this scope; did you mean 'hmx'?
   53 |     while(W[noww].F==wmx){
      |                      ^~~
      |                      hmx
a.cc:62:17: error: 'wmx' was not declared in this scope; did you mean 'hmx'?
   62 |   cout<<max(hmx+wmx-1,(int)0)<<endl;
      |                 ^~~
      |                 hmx
Language: C++

#include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
int64_t sea(int64_t x,int64_t* a,int64_t b){
  int64_t ans=0;
   
int64_t n=b;
  int64_t lb=-1, ub=n;
  while(ub-lb>1){
  int64_t mid=(lb+ub)/2;
    if(a[mid]==x)
    {ans=1;
     return 1; 
    break;}
    if(a[mid]>x)
    {ub=mid;}
     if(a[mid]<x)
    {lb=mid;}
  }
  if(ans==0){return 0;}
}

int main(void) {
int64_t h,w,m;
  cin>>h>>w>>m;
   vector<vector<int64_t>> data(m, vector<int64_t>(2));
  
  
  
  //vector<vector<int>> data(3, vector<int>(4));
 
  
  
  
  for(int64_t i=0;i<m;i++){
  cin>>data.at(i).at(0)>>data.at(i).at(1);
  }
  vector<int64_t> one(h);
  vector<int64_t> two(w);
  for(int64_t i=0;i<m;i++){
  one.at(data.at(i).at(0)-1)++;
  }
  for(int64_t i=0;i<m;i++){
  two.at(data.at(i).at(1)-1)++;
  }
   vector<int64_t> oc(m);
  vector<int64_t> tc(m);
  for(int64_t i=0;i<m;i++){
  oc.at(i)=data.at(i).at(0);
  }
   for(int64_t i=0;i<m;i++){
  tc.at(i)=data.at(i).at(1);
  }
   sort(oc.begin(), oc.end());
   sort(tc.begin(), tc.end());
  int64_t a=oc.at(m-1);
   int64_t b=tc.at(m-1);
  vector<int64_t> os;
  vector<int64_t> ts;
  for(int64_t i=0;i<m;i++){
  if(a==data.at(i).at(0)){os.push_back(i); }
  }
  for(int64_t i=0;i<m;i++){
  if(b==data.at(i).at(1)){ts.push_back(i); }
  }
  int64_t o=os.size();
  int64_t t=ts.size();
  sort(os.begin(), os.end());
  sort(ts.begin(), ts.end());
  int64_t qq;
  for(int64_t i=0;i<m;i++){
   if((sea(data.at(i).at(0),os,o)==1)&&(sea(data.at(i).at(1),ts,t)==1)){qq++;}
  }
  if(qq==o*t){cout<<a+b-1<<endl;}
  else{cout<<a+b<<endl;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:29: error: cannot convert 'std::vector<long int>' to 'int64_t*' {aka 'long int*'}
   72 |    if((sea(data.at(i).at(0),os,o)==1)&&(sea(data.at(i).at(1),ts,t)==1)){qq++;}
      |                             ^~
      |                             |
      |                             std::vector<long int>
a.cc:4:32: note:   initializing argument 2 of 'int64_t sea(int64_t, int64_t*, int64_t)'
    4 | int64_t sea(int64_t x,int64_t* a,int64_t b){
      |                       ~~~~~~~~~^
a.cc:72:62: error: cannot convert 'std::vector<long int>' to 'int64_t*' {aka 'long int*'}
   72 |    if((sea(data.at(i).at(0),os,o)==1)&&(sea(data.at(i).at(1),ts,t)==1)){qq++;}
      |                                                              ^~
      |                                                              |
      |                                                              std::vector<long int>
a.cc:4:32: note:   initializing argument 2 of 'int64_t sea(int64_t, int64_t*, int64_t)'
    4 | int64_t sea(int64_t x,int64_t* a,int64_t b){
      |                       ~~~~~~~~~^
a.cc: In function 'int64_t sea(int64_t, int64_t*, int64_t)':
a.cc:21:1: warning: control reaches end of non-void function [-Wreturn-type]
   21 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <map>

using namespace std;

int main()
{
	int h, w, m;
	cin >> h >> w >> m;
	map<pair<int, int>, int> mp;
	vector<pair<int, int>> H(h), W(w);
	for (int i = 0; i < m; i++) {
		int a, b;
		cin >> a >> b;
		a--;
		b--;
		mp[make_pair(a, b)]++;
		H[a].first++;
		W[b].first++;
	}

	for (int i = 0; i < h; i++) {
		H[i].second = i;
	}
	for (int i = 0; i < w; i++) {
		W[i].second = i;
	}
	sort(H.rbegin(), H.rend());
	sort(W.rbegin(), W.rend());
	int s = min(h, 5);
	int t = min(w, 5);
	int ans = 0;
	for (int i = 0; i < s; i++) {
		for (int j = 0; j < t; j++) {
			ans = max(ans, H[i].first + W[j].first -
				(mp[make_pair(H[i].second, W[j].second)] == 0 ? 0 : mp[make_pair(H[i].second, W[j].second)]));
		}
	}
	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   32 |         sort(H.rbegin(), H.rend());
      |         ^~~~
      |         short
Language: C

int row[H], col[W];
int main(void) {
  int H, W, M;
  scanf("%d %d %d", &H, &W, &M);
  int bigR = 0, bigC = 0;
  for (int i = 0; i < M; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    
    row[a - 1]++;
    col[b - 1]++;
    
    if (bigR < row[a - 1])
      bigR = row[a - 1];
    if (bigC < col[b - 1])
      bigC = col[b - 1];
  }
  
  printf("%d", bigR + bigC);
  return 0;
}

Compiler output:
main.c:1:9: error: 'H' undeclared here (not in a function)
    1 | int row[H], col[W];
      |         ^
main.c:1:17: error: 'W' undeclared here (not in a function)
    1 | int row[H], col[W];
      |                 ^
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("%d %d %d", &H, &W, &M);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int row[H], col[W];
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%d %d %d", &H, &W, &M);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:19:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   19 |   printf("%d", bigR + bigC);
      |   ^~~~~~
main.c:19:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:19:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:19:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <cmath>
#include <numeric>
#include <iomanip>
#include <deque>
#include <tuple>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <sstream>
#include <stdexcept>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

#define rep(i, x) for (int i = 0; i < (int)(x); i++)
#define FOR(i, a, done) for (int i = (a); i < (done); ++i)
#define all(a) (a).begin(), (a).end()
#define x first
#define y second
#define debug(a) cout << (a) << endl
namespace mp = boost::multiprecision;
using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;
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 (a > b)
	{
		a = b;
		return 1;
	}
	return 0;
}

ll M = 1000000007;

void solve()
{
	int h,w,m;
	cin>>h>>w>>m;
	set<int>hs,ws;
	vector<int>hm(3e5+1),wm(3e5+1);
	unordered_map<pair<int,int>,int>target;
	rep(i,m){
		int hi,wi;
		cin>>hi>>wi;
		target[make_pair(hi,wi)]++;
		hm[hi]++;
		wm[wi]++;
		hs.insert(hi);
		ws.insert(wi);
	}
	int hmax=0;
	deque<int>hcand;
	for(auto i=hs.begin(); i!=hs.end(); i++){
		if(hmax<hm[*i]){
			hmax=hm[*i];
		}
	}
	for(auto i=hs.begin(); i!=hs.end(); i++){
		if(hmax==hm[*i]){
			hcand.push_back(*i);
		}
	}
	
	int wmax=0;
	deque<int>wcand;
	for(auto i=ws.begin(); i!=ws.end(); i++){
		if(wmax<wm[*i]){
			wmax=wm[*i];
		}
	}
	for(auto i=ws.begin(); i!=ws.end(); i++){
		if(wmax==wm[*i]){
			wcand.push_back(*i);
		}
	}
	//cout<<hmax<<" "<<wmax<<endl;
	int ans=0;
	rep(i,size(hcand))rep(j,size(wcand)){
		if(target[make_pair(hcand[i],wcand[j])]){
			ans=max(ans,hmax+wmax-1);
		}else{
			ans=max(ans,hmax+wmax);
		}
	}
	cout<<ans<<endl;

}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	solve();
	return 0;
}


Compiler output:
a.cc:19:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
   19 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include<bits/stdc++.h>
#define ll long long int
#define lld long double
#define F first
#define S second
#define f(i,a,b) for(int i=a;i<=b;i++)
#define g(i,a,b) for(int i=a;i>=b;i--)
#define pb push_back
#define mh make_heap
#define ph push_heap
#define pq priority_queue
#define bits(x) __builtin_popcountll(x)
#define op(x) cout<<"Case #"<<x<<": "
#define op1(x) cout<<"Scenario #"<<x<<": "
#define endl "\n"
using namespace std;
const ll mod = 1000000007;
const ll INF = 1e18;
const int N = 18;


map<ll, ll> x, y;

bool cmp(ll x, ll y)
{
	if(mp[x]<mp[y]) return true;
	return false;

}

void solve(int t)
{
	ll h, w, m;
	cin >> h >> w >> m;

	
	map<pair<ll,ll>,ll> mp;
	for (int i = 0; i < m; i++)
	{
		ll p, q;
		cin >> p >> q;
		x[p]++;
		y[q]++;
		mp[{p,q}]++;
	}

	ll ans = 0;

	for(auto i:x)
	{
		for(auto j:y)
		{
			ans = max(ans,i.S+j.S-mp[{i.F,j.F}]);
		}
	}

	cout<<ans<<endl;



}


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




	int t = 1;
	//cin >> t;



	for (int i = 1; i <= t; i++)
	{
		solve(i);

	}
}

Compiler output:
a.cc: In function 'bool cmp(long long int, long long int)':
a.cc:27:12: error: 'mp' was not declared in this scope; did you mean 'cmp'?
   27 |         if(mp[x]<mp[y]) return true;
      |            ^~
      |            cmp
Language: C++

#include<bits/stdc++.h>
2
using namespace std;
3
​
4
int main(){
5
  int H = 0;
6
  int W = 0;
7
  int M = 0;
8
  int hozon = 0;
9
  int counter = 0;
10
  cin >> H >> W >> M;
11
  vector<int> h(M);
12
  vector<int> w(M);
13
  for(int i = 0; i < M; i++){
14
    cin >> h.at(i) >> w.at(i);
15
  }
16
  
17
  /*for(int i = 0; i < M; i++){
18
    cout << h.at(i) << w.at(i) << endl;
19
  }*/
20
  
21
  for(int i = 0; i < H; i++){   //surveyの高さ
22
    for(int j = 0; j < W; j++){ //横
23
      for(int k = 0; k < M; k++) {  //爆弾の座標用
24
        if(h.at(k) == i || w.at(k) == j) counter++;
25
      }
26
      if(counter > hozon) {
27
        hozon = counter;
28
      }
29
      counter = 0;
30
    }
31
  }
32
  cout << hozon << endl;
33
}

Compiler output:
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 2
      | ^
a.cc:4:1: error: expected unqualified-id before numeric constant
    4 | 3
      | ^