Language: C++

void solve(){
	int h,w,m; cin >> h >> w >> m;
	int a[h][w];
	for(int i=0 ; i<h ; ++i){
		for(int j=0 ; j<w ; ++j){
			a[i][j]=0;
		}
	}
	map<int,int>row,col;
	for(int i=0 ; i<m ; ++i){
		int x,y; cin >> x >> y;
		a[--x][--y]=1;
		row[x]++;
		col[y]++;
	}
	vector<int> mrow,mcol;
	int rmax=0;
	for(auto itr:row)
		rmax = max(rmax , itr.ss);
	for(auto itr : row)
		if(itr.ss==rmax)
			mrow.pb(itr.ff);

	int cmax=0;
	for(auto itr:col)
		cmax = max(cmax , itr.ss);
	for(auto itr : col)
		if(itr.ss==cmax)
			mcol.pb(itr.ff);

	int ans=-inf;
	for(int i=0 ; i<(int)mrow.size() ; ++i){
		for(int j=0 ; j<(int)mcol.size() ; ++j){
			int cnt=row[mrow[i]];
			cnt+=col[mcol[j]];
			if(a[mrow[i]][mcol[j]])
				--cnt;
		ans = max(ans , cnt);
		}
	}
	cout << ans << endl;
}

int32_t main(){	
	__;
	file();
	solve();
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:2:20: error: 'cin' was not declared in this scope
    2 |         int h,w,m; cin >> h >> w >> m;
      |                    ^~~
a.cc:9:9: error: 'map' was not declared in this scope
    9 |         map<int,int>row,col;
      |         ^~~
a.cc:9:13: error: expected primary-expression before 'int'
    9 |         map<int,int>row,col;
      |             ^~~
a.cc:13:17: error: 'row' was not declared in this scope
   13 |                 row[x]++;
      |                 ^~~
a.cc:14:17: error: 'col' was not declared in this scope
   14 |                 col[y]++;
      |                 ^~~
a.cc:16:9: error: 'vector' was not declared in this scope
   16 |         vector<int> mrow,mcol;
      |         ^~~~~~
a.cc:16:16: error: expected primary-expression before 'int'
   16 |         vector<int> mrow,mcol;
      |                ^~~
a.cc:18:22: error: 'row' was not declared in this scope
   18 |         for(auto itr:row)
      |                      ^~~
a.cc:19:24: error: 'max' was not declared in this scope; did you mean 'rmax'?
   19 |                 rmax = max(rmax , itr.ss);
      |                        ^~~
      |                        rmax
a.cc:20:24: error: 'row' was not declared in this scope
   20 |         for(auto itr : row)
      |                        ^~~
a.cc:22:25: error: 'mrow' was not declared in this scope
   22 |                         mrow.pb(itr.ff);
      |                         ^~~~
a.cc:25:22: error: 'col' was not declared in this scope
   25 |         for(auto itr:col)
      |                      ^~~
a.cc:26:24: error: 'max' was not declared in this scope; did you mean 'cmax'?
   26 |                 cmax = max(cmax , itr.ss);
      |                        ^~~
      |                        cmax
a.cc:27:24: error: 'col' was not declared in this scope
   27 |         for(auto itr : col)
      |                        ^~~
a.cc:29:25: error: 'mcol' was not declared in this scope
   29 |                         mcol.pb(itr.ff);
      |                         ^~~~
a.cc:31:18: error: 'inf' was not declared in this scope; did you mean 'int'?
   31 |         int ans=-inf;
      |                  ^~~
      |                  int
a.cc:32:30: error: 'mrow' was not declared in this scope
   32 |         for(int i=0 ; i<(int)mrow.size() ; ++i){
      |                              ^~~~
a.cc:33:38: error: 'mcol' was not declared in this scope
   33 |                 for(int j=0 ; j<(int)mcol.size() ; ++j){
      |                                      ^~~~
a.cc:34:33: error: 'row' was not declared in this scope
   34 |                         int cnt=row[mrow[i]];
      |                                 ^~~
a.cc:35:30: error: 'col' was not declared in this scope
   35 |                         cnt+=col[mcol[j]];
      |                              ^~~
a.cc:38:23: error: 'max' was not declared in this scope; did you mean 'cmax'?
   38 |                 ans = max(ans , cnt);
      |                       ^~~
      |                       cmax
a.cc:41:9: error: 'cout' was not declared in this scope
   41 |         cout << ans << endl;
      |         ^~~~
a.cc:41:24: error: 'endl' was not declared in this scope
   41 |         cout << ans << endl;
      |                        ^~~~
a.cc: At global scope:
a.cc:44:1: error: 'int32_t' does not name a type
   44 | int32_t main(){
      | ^~~~~~~
a.cc:1:1: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
  +++ |+#include <cstdint>
    1 | void solve(){