Language: C++

//#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include<algorithm>
#include<string>
#include <map>
#include <queue>
#include <stack>
#include<set>
#include<tuple>

#define DIV 1000000007
#define TE 2e5
using namespace std;
using ll = long long;
using ldb = long double;

int main() {
	int H, W, M; cin >> H >> W >> M;
	vector<pair<int, int>> bom(M+1);
	vector<int> tate(H+1), yoko(W+1);
	vector<int> h(3),w(3);
	vector<int> hh(3), ww(3);
	for (int i = 0; i < M; i++) {
		cin >> bom[i].first >> bom[i].second;
		tate[bom[i].first]++, yoko[bom[i].second]++;
		if (hh[1] < tate[bom[i].first] && h[2] != i) {
			hh[1] = tate[bom[i].first];
			h[1] = bom[i].first;
		}
	
		if (hh[2] < tate[bom[i].first] && h[1] != i) {
			hh[2] = tate[bom[i].first];
			h[2] = bom[i].first;
		}

		if (ww[1] < yoko[bom[i].second]&&w[2]!=i) {
			ww[1] = yoko[bom[i].second];
			w[1] = bom[i].second;
		}

		if (ww[2] < yoko[bom[i].second] && w[1] != i) {
			ww[2] = yoko[bom[i].second];
			w[2] = bom[i].second;
		}
	}

	
	ll ans = 0;



	for (int i = 1; i <= 2; i++) {
		int temp = 0;
		for (int j = 1; j <= 2; j++) {

			for (int i = 0; i < M; i++) {
				//cout << "i=" << i << endl;
				if (h[i] == bom[i].first || w[j] == bom[i].second) {
					temp++;
				}
			}
		}
		ans = max(ans, temp);
	}
	cout << ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:64:26: error: no matching function for call to 'max(ll&, int&)'
   64 |                 ans = max(ans, temp);
      |                       ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/vector:62,
                 from a.cc:2:
/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:64:26: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   64 |                 ans = max(ans, temp);
      |                       ~~~^~~~~~~~~~~
/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,
                 from a.cc:4:
/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:64:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   64 |                 ans = max(ans, temp);
      |                       ~~~^~~~~~~~~~~