Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using p = pair<int,int>;
using Graph = vector<vector<int>>;

const double PI = acos(-1);

int H,W,K;
int cnt;
int rep;
vector<vector<int>> field;

void dfs(int h, int w, vector<vector<int>> field) {
    //cout << "実行" << endl;
    int tmp = 0;
    for(int i = 0; i < W; ++i) {
    	field[h][i] = 0;
    }
  	for(int i = 0; i < H; ++i) {
    	field[i][w] = 0;
    }
    for(int i = 0; i < H; ++i) {
    	for(int j = 0; j < W; ++j) {
            //cout << "arr[" << i << "][" << j << "]:" << arr[i][j] << endl;
        	tmp+=field[i][j];
        }
    }
    cout << "tmp:" << tmp << endl;
    if(tmp == K) ++cnt;
    if(h+1 > H || w+1 > W) return;
    dfs(h,w+1,field[rep]);
  	dfs(h+1,w,field[rep]);
}

int main(){
    int count;
    cin >> H >> W >> K;
    field[0].assign(H, vector<int>(W,0));
  	// 入力 (2重ループを用いる)
    string in;
  	for (int i = 0; i < H; ++i) {
        cin >> in;
    	for (int j = 0; j < W; ++j) {
          	if(in[j] == '#') {
            	field.at(i).at(j) = 1;
            }
            //cout << "field[" << i << "][" << j << "]:" << field[i][j] << endl;
    	}
  	}
    // 探索開始
	dfs(0,0,field);
    cout << cnt << endl;
    return 0;
}  

Compiler output:
a.cc: In function 'void dfs(int, int, std::vector<std::vector<int> >)':
a.cc:33:8: error: could not convert 'field.std::vector<std::vector<int> >::operator[](((std::vector<std::vector<int> >::size_type)rep))' from 'vector<int>' to 'vector<std::vector<int>>'
   33 |     dfs(h,w+1,field[rep]);
      |     ~~~^~~~~~~~~~~~~~~~~~
      |        |
      |        vector<int>
a.cc:34:12: error: could not convert 'field.std::vector<std::vector<int> >::operator[](((std::vector<std::vector<int> >::size_type)rep))' from 'vector<int>' to 'vector<std::vector<int>>'
   34 |         dfs(h+1,w,field[rep]);
      |         ~~~^~~~~~~~~~~~~~~~~~
      |            |
      |            vector<int>
a.cc: In function 'int main()':
a.cc:40:20: error: no matching function for call to 'std::vector<int>::assign(int&, std::vector<int>)'
   40 |     field[0].assign(H, vector<int>(W,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:828:9: note: candidate: 'template<class _InputIterator, class> void std::vector<_Tp, _Alloc>::assign(_InputIterator, _InputIterator) [with <template-parameter-2-2> = _InputIterator; _Tp = int; _Alloc = std::allocator<int>]'
  828 |         assign(_InputIterator __first, _InputIterator __last)
      |         ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:828:9: note:   template argument deduction/substitution failed:
a.cc:40:20: note:   deduced conflicting types for parameter '_InputIterator' ('int' and 'std::vector<int>')
   40 |     field[0].assign(H, vector<int>(W,0));
      |     ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:808:7: note: candidate: 'void std::vector<_Tp, _Alloc>::assign(size_type, const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int; value_type = int]'
  808 |       assign(size_type __n, const value_type& __val)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:808:47: note:   no known conversion for argument 2 from 'std::vector<int>' to 'const std::vector<int>::value_type&' {aka 'const int&'}
  808 |       assign(size_type __n, const value_type& __val)
      |                             ~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/stl_vector.h:855:7: note: candidate: 'void std::vector<_Tp, _Alloc>::assign(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  855 |       assign(initializer_list<value_type> __l)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:855:7: note:   candidate expects 1 argument, 2 provided