Language: C++

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




int main(){
  int H , W , M ; 
  cin >> H >> W >> M ; 
  vector<int> A(H) ; 
  vector<int> B(W) ; 
  vector<vector<int>> C(H , vector<int>(W)) ;  
  
  for(int i = 0 ; i < M ; i++){
      int h , w ; 
      cin >> h >> w ; 
      A.at(h-1)++ ; 
      B.at(w-1)++ ; 
      C.at(h-1).at(w-1)++ ; 
    
  }
  

  //vector<int>::iterator iter = max_element(A.begin(),A.end()) ; 
  //size_t index = distance(A.begin(),iter) ; 
  //int index= max_element(A.begin(),A.end()) - A.begin();    
  //cout << index << endl ;
  
  //vector<int>::iterator iter2 = max_element(B.begin(),B.end()) ; 
  //size_t index2 = distance(B.begin(),iter2) ; 
  //int index2= max_element(B.begin(),B.end()) - B.begin();  
  //cout << index2 << endl ; 
  

  
  if(C.at(index).at(index2) > 0 ){
    cout << A.at(index) + B.at(index2) -1<<endl ; 
    return 0 ; 
  }
  else{

  
    cout << A.at(index) + B.at(index2) <<endl ; 
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:10: error: no matching function for call to 'std::vector<std::vector<int> >::at(<unresolved overloaded function type>)'
   36 |   if(C.at(index).at(index2) > 0 ){
      |      ~~~~^~~~~~~
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: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; reference = std::vector<int>&; size_type = long unsigned int]'
 1180 |       at(size_type __n)
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1180:20: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'}
 1180 |       at(size_type __n)
      |          ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1199:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::at(size_type) const [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; const_reference = const std::vector<int>&; size_type = long unsigned int]'
 1199 |       at(size_type __n) const
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1199:20: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'}
 1199 |       at(size_type __n) const
      |          ~~~~~~~~~~^~~
a.cc:36:21: error: 'index2' was not declared in this scope; did you mean 'index'?
   36 |   if(C.at(index).at(index2) > 0 ){
      |                     ^~~~~~
      |                     index
a.cc:37:17: error: no matching function for call to 'std::vector<int>::at(<unresolved overloaded function type>)'
   37 |     cout << A.at(index) + B.at(index2) -1<<endl ;
      |             ~~~~^~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1180:7: note: candidate: '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]'
 1180 |       at(size_type __n)
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1180:20: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1180 |       at(size_type __n)
      |          ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1199:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::at(size_type) const [with _Tp = int; _Alloc = std::allocator<int>; const_reference = const int&; size_type = long unsigned int]'
 1199 |       at(size_type __n) const
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1199:20: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1199 |       at(size_type __n) const
      |          ~~~~~~~~~~^~~
a.cc:43:17: error: no matching function for call to 'std::vector<int>::at(<unresolved overloaded function type>)'
   43 |     cout << A.at(index) + B.at(index2) <<endl ;
      |             ~~~~^~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1180:7: note: candidate: '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]'
 1180 |       at(size_type __n)
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1180:20: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1180 |       at(size_type __n)
      |          ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1199:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::at(size_type) const [with _Tp = int; _Alloc = std::allocator<int>; const_reference = const int&; size_type = long unsigned int]'
 1199 |       at(size_type __n) const
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1199:20: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1199 |       at(size_type __n) const
      |          ~~~~~~~~~~^~~