Language: C++

#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
using ll=long long;
#define rep(i,a,b) for(ll i=a;i<b;i++)
inline constexpr int intpow(ll a,ll b){
    if(b==0) return 1;
    ll ans=intpow(a,b/2);
    return ans*ans*(b&1?a:1);
}
int main(){
    int h,w;
    cin>>h>>w;
    vector<vector<int>> v(h,vector<int>(w));
    rep(i,0,h){
        rep(j,0,w){
            cin>>v[i][j];
        }
    }
    int l=0;
    rep(i,0,h){
        int cnt=0;
        rep(j,0,w) {
            if (v[i][j]=='#') cnt++;
        }
        if(cnt==w) {
            v.erase(v[i][0],v[i][w]);
            l++;
        }
    }
    int m=0;
    rep(j,0,w){
        int cnt=0;
        rep(i,0,h-l){
            if (v[i][j]=='#') cnt++;
        }
        if(cnt==h-l) {
            rep(i,0,h-l){
                v.erase(v[i][j]);
            }
            m++;
        }
    }
    rep(i,0,h-l){
        rep(j,0,w-m){
            cout<<v[i][j];
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:20: error: no matching function for call to 'std::vector<std::vector<int> >::erase(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   33 |             v.erase(v[i][0],v[i][w]);
      |             ~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; iterator = std::vector<std::vector<int> >::iterator; const_iterator = std::vector<std::vector<int> >::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; iterator = std::vector<std::vector<int> >::iterator; const_iterator = std::vector<std::vector<int> >::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:28: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'std::vector<std::vector<int> >::const_iterator'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |             ~~~~~~~~~~~~~~~^~~~~~~
a.cc:45:24: error: no matching function for call to 'std::vector<std::vector<int> >::erase(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   45 |                 v.erase(v[i][j]);
      |                 ~~~~~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; iterator = std::vector<std::vector<int> >::iterator; const_iterator = std::vector<std::vector<int> >::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:28: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'std::vector<std::vector<int> >::const_iterator'
 1536 |       erase(const_iterator __position)
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; iterator = std::vector<std::vector<int> >::iterator; const_iterator = std::vector<std::vector<int> >::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note:   candidate expects 2 arguments, 1 provided