Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = (0); i < (n); ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define DEBUG(val) cout << #val << " : " << val << endl
#define MOD 1000000007

vector<string> data;
int h, w, n;

int judge(vector<int> a, vector<int> b) {
  int ret = 0;
  for (auto x : a) {
    for (auto y : b) {
      if (data[x][y] == '#') ret++;
    }
  }
  return ret;
}

int main() {
  cin >> h >> w >> n;
  unordered_map<int, int> h_map;
  unordered_map<int, int> w_map;
  int sum = 0;
  int ans = 0;
  REP(i, h) {
    string x;
    cin >> x;
    data.push_back(x);
  }

  REP(i, h) {
    REP(j, w) {
      if (data[i][j] == '#') {
        h_map[i]++;
        w_map[j]++;
        sum++;
      }
    }
  }

  for (int bit = 0; bit < (1 << h); ++bit) {
    for (int bit2 = 0; bit2 < (1 << w); ++bit2) {
      vector<int> a;
      vector<int> b;
      int tmp = 0;
      for (int i = 0; i < h; ++i) {
        if (bit & (1 << i)) {
          a.push_back(i);
          tmp += h_map[i];
        }
      }

      for (int j = 0; j < w; ++j) {
        if (bit2 & (1 << j)) {
          b.push_back(j);
          tmp += w_map[j];
        }
      }

      if (sum - tmp + judge(a, b) == n) {
        ans++;
      }
    }
  }

  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int judge(std::vector<int>, std::vector<int>)':
a.cc:17:11: error: reference to 'data' is ambiguous
   17 |       if (data[x][y] == '#') ret++;
      |           ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:10:16: note:                 'std::vector<std::__cxx11::basic_string<char> > data'
   10 | vector<string> data;
      |                ^~~~
a.cc: In function 'int main()':
a.cc:32:5: error: reference to 'data' is ambiguous
   32 |     data.push_back(x);
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:10:16: note:                 'std::vector<std::__cxx11::basic_string<char> > data'
   10 | vector<string> data;
      |                ^~~~
a.cc:37:11: error: reference to 'data' is ambiguous
   37 |       if (data[i][j] == '#') {
      |           ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:10:16: note:                 'std::vector<std::__cxx11::basic_string<char> > data'
   10 | vector<string> data;
      |                ^~~~