Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
  int H, W;
  char G[102][102];
  // 出力しない行
  vector<int> v1;
  // 出力しない列
  vector<int> v2;

  cin >> H >> W;

  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> G[i][j];
    }
    G[i][W] = '\n';
  }

  for (int i = 0; i < H; i++) {
    bool flag = true;
    for (int j = 0; j < W; j++) {
      if (G[i][j] == '#') {
        flag = false;
      }
    }
    if (flag) { v1.push_back(i); }
  }

  for (int i = 0; i < W; i++) {
    bool flag = true;
    for (int j = 0; j < H; j++) {
      if (G[j][i] == '#') {
        flag = false;
      }
    }
    if (flag) { v2.push_back(i); }
  }

  for (int i = 0; i < H; i++) {
    for (int j = 0; j <= W; j++) {
      if (find(v1.begin(), v1.end(), i) != v1.end()) {
        continue;
      }
      if (find(v2.begin(), v2.end(), j) != v2.end()) {
        continue;
      }
      cout << G[i][j];
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:15: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   45 |       if (find(v1.begin(), v1.end(), i) != v1.end()) {
      |           ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:45:15: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   45 |       if (find(v1.begin(), v1.end(), i) != v1.end()) {
      |           ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:48:15: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   48 |       if (find(v2.begin(), v2.end(), j) != v2.end()) {
      |           ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:48:15: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   48 |       if (find(v2.begin(), v2.end(), j) != v2.end()) {
      |           ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~