Language: C++

#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;

struct co{
	int z;
	int x;
}

int main(){
	ios_base::sync_with_stdio(false); 
	cin.tie(NULL);
	ll n,m;
	cin >> n >> m;
	vector<string> grid(n);
	for (int z=0;z<n;z++){
		cin >> grid[z];
	}
	bool ended = false;
	ll c = 0;
	vector <co> blacks;
	for (int z=0;z<n;z++){
		for (int x=0;x<m;x++){
			if (grid[z][x] == '#'){
				co temp;
				temp.z = z;
				temp.x = x;
				blacks.push_back(temp);
			}
		}
	}
	while (!ended){
		ended = true;
		vector <ll> newblacks;
		for (int y=0;y<blacks.size();y++){
			ll z = blacks[y].z;
			ll x = blacks[y].x;
			if (z != 0) {
				if (grid[z-1][x] == '.'){
					co temp;
					temp.z = z-1;
					temp.x = x;
					newblacks.push_back(temp);
					grid[z-1][x] = '#';
				}
			}
			if (z != n-1){
				if (grid[z+1][x] == '.'){
					co temp;
					temp.z = z+1;
					temp.x = x;
					newblacks.push_back(temp);
					grid[z+1][x] = '#';
				}
			}
			if (x != 0){
				if (grid[z][x-1] == '.'){
					co temp;
					temp.z = z;
					temp.x = x-1;
					newblacks.push_back(temp);
					grid[z][x-1] = '#';
				}
			}
			if (x != m-1){
				if (grid[z][x+1] == '.'){
					co temp;
					temp.z = z;
					temp.x = x+1;
					newblacks.push_back(temp);
					grid[z][x+1] = '#';
				}
			}
		}
		for (int z=0;z<n && ended;z++){
			for (int x=0;x<m && ended;x++){
				if (grid[z][x] == '.'){
					ended = false;
				}
			}
		}
		blacks = newblacks;
		c++;
	}
	cout << c-1 << endl;
	cin >> n;
	
}

Compiler output:
a.cc:10:2: error: expected ';' after struct definition
   10 | }
      |  ^
      |  ;
a.cc: In function 'int main()':
a.cc:45:60: error: no matching function for call to 'std::vector<long long int>::push_back(co&)'
   45 |                                         newblacks.push_back(temp);
      |                                         ~~~~~~~~~~~~~~~~~~~^~~~~~
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:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; value_type = long long int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'co' to 'const std::vector<long long int>::value_type&' {aka 'const long long int&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; value_type = long long int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'co' to 'std::vector<long long int>::value_type&&' {aka 'long long int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:54:60: error: no matching function for call to 'std::vector<long long int>::push_back(co&)'
   54 |                                         newblacks.push_back(temp);
      |                                         ~~~~~~~~~~~~~~~~~~~^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; value_type = long long int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'co' to 'const std::vector<long long int>::value_type&' {aka 'const long long int&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; value_type = long long int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'co' to 'std::vector<long long int>::value_type&&' {aka 'long long int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:63:60: error: no matching function for call to 'std::vector<long long int>::push_back(co&)'
   63 |                                         newblacks.push_back(temp);
      |                                         ~~~~~~~~~~~~~~~~~~~^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; value_type = long long int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'co' to 'const std::vector<long long int>::value_type&' {aka 'const long long int&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; value_type = long long int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'co' to 'std::vector<long long int>::value_type&&' {aka 'long long int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:72:60: error: no matching function for call to 'std::vector<long long int>::push_back(co&)'
   72 |                                         newblacks.push_back(temp);
      |                                         ~~~~~~~~~~~~~~~~~~~^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; value_type = long long int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'co' to 'const std::vector<long long int>::value_type&' {aka 'const long long int&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; value_type = long long int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'co' to 'std::vector<long long int>::value_type&&' {aka 'long long int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:84:26: error: no match for 'operator=' (operand types are 'std::vector<co>' and 'std::vector<long long int>')
   84 |                 blacks = newblacks;
      |                          ^~~~~~~~~
In file included from /usr/include/c++/14/vector:72:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = co; _Alloc = std::allocator<co>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'const std::vector<co>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = co; _Alloc = std::allocator<co>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'std::vector<co>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = co; _Alloc = std::allocator<co>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'std::initializer_list<co>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~