Language: C++

#include<bits/stdc++.h>
using namespace std;
main(){
  int w,h,n;
  cin>>w>>h>>n;
  vector<bool>white(h,vector<bool>(w,true));
  while(n--){
    int a,b,c;
    cin>>a>>b>>c;
    if(c==1){
      for(int i=0;i<h;++i)
        for(int j=0;j<a;++j)
          white[i][j]=false;
    }
    else if(c==2){
      for(int i=0;i<h;++i)
        for(int j=a;j<w;++j)
          white[i][j]=false;
    }
    else if(c==3){
      for(int i=0;i<b;++i)
        for(int j=0;j<w;++j)
          white[i][j]=false;
    }
    else if(c==4){
      for(int i=b;i<h;++i)
        for(int j=0;j<w;++j)
          white[i][j]=false;
    }
  }
  int ans=0;
  for(auto y:white)for(auto x:y)ans+=x;
  cout<<ans<<endl;
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:43: error: no matching function for call to 'std::vector<bool>::vector(int&, std::vector<bool>)'
    6 |   vector<bool>white(h,vector<bool>(w,true));
      |                                           ^
In file included from /usr/include/c++/14/vector:67,
                 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_bvector.h:870:9: note: candidate: 'template<class _InputIterator, class> std::vector<bool, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Alloc = std::allocator<bool>]'
  870 |         vector(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:870:9: note:   template argument deduction/substitution failed:
a.cc:6:43: note:   deduced conflicting types for parameter '_InputIterator' ('int' and 'std::vector<bool>')
    6 |   vector<bool>white(h,vector<bool>(w,true));
      |                                           ^
/usr/include/c++/14/bits/stl_bvector.h:857:7: note: candidate: 'std::vector<bool, _Alloc>::vector(std::initializer_list<bool>, const allocator_type&) [with _Alloc = std::allocator<bool>; allocator_type = std::allocator<bool>]'
  857 |       vector(initializer_list<bool> __l,
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:857:37: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<bool>'
  857 |       vector(initializer_list<bool> __l,
      |              ~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_bvector.h:849:7: note: candidate: 'std::vector<bool, _Alloc>::vector(const std::vector<bool, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Alloc = std::allocator<bool>; std::__type_identity_t<_Alloc> = std::allocator<bool>]'
  849 |       vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:849:28: note:   no known conversion for argument 1 from 'int' to 'const std::vector<bool>&'
  849 |       vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
      |              ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_bvector.h:842:7: note: candidate: 'std::vector<bool, _Alloc>::vector(std::vector<bool, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Alloc = std::allocator<bool>; std::__type_identity_t<_Alloc> = std::allocator<bool>]'
  842 |       vector(vector&& __x, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:842:23: note:   no known conversion for argument 1 from 'int' to 'std::vector<bool>&&'
  842 |       vector(vector&& __x, const __type_identity_t<allocator_type>& __a)
      |              ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_bvector.h:827:7: note: candidate: 'std::vector<bool, _Alloc>::vector(std::vector<bool, _Alloc>&&, const allocator_type&, std::false_type) [with _Alloc = std::allocator<bool>; allocator_type = std::allocator<bool>; std::false_type = std::false_type]'
  827 |       vector(vector&& __x, const allocator_type& __a, false_type)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:827:7: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_bvector.h:822:7: note: candidate: 'std::vector<bool, _Alloc>::vector(std::vector<bool, _Alloc>&&, const allocator_type&, std::true_type) [with _Alloc = std::allocator<bool>; allocator_type = std::allocator<bool>; std::true_type = std::true_type]'
  822 |       vector(vector&& __x, const allocator_type& __a, true_type) noexcept
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:822:7: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_bvector.h:818:7: note: candidate: 'std::vector<bool, _Alloc>::vector(std::vector<bool, _Alloc>&&) [with _Alloc = std::allocator<bool>]'
  818 |       vector(vector&&) = default;
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:818:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_bvector.h:809:7: note: candidate: 'std::vector<bool, _Alloc>::vector(const std::vector<bool, _Alloc>&) [with _Alloc = std::allocator<bool>]'
  809 |       vector(const vector& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:809:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_bvector.h:795:7: note: candidate: 'std::vector<bool, _Alloc>::vector(size_type, const bool&, const allocator_type&) [with _Alloc = std::allocator<bool>; size_type = long unsigned int; allocator_type = std::allocator<bool>]'
  795 |       vector(size_type __n, const bool& __value,
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:795:41: note:   no known conversion for argument 2 from 'std::vector<bool>' to 'const bool&'
  795 |       vector(size_type __n, const bool& __value,
      |                             ~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:790:7: note: candidate: 'std::vector<bool, _Alloc>::vector(size_type, const allocator_type&) [with _Alloc = std::allocator<bool>; size_type = long unsigned int; allocator_type = std::allocator<bool>]'
  790 |       vector(size_type __n, const allocator_type& __a = allocator_type())
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:790:51: note:   no known conversion for argument 2 from 'std::vector<bool>' to 'const std::vector<bool>::allocator_type&' {aka 'const std::allocator<bool>&'}
  790 |       vector(size_type __n, const allocator_type& __a = allocator_type())
      |                             ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:784:7: note: candidate: 'std::vector<bool, _Alloc>::vector(const allocator_type&) [with _Alloc = std::allocator<bool>; allocator_type = std::allocator<bool>]'
  784 |       vector(const allocator_type& __a)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:784:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_bvector.h:777:7: note: candidate: 'std::vector<bool, _Alloc>::vector() [with _Alloc = std::allocator<bool>]'
  777 |       vector() = default;
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:777:7: note:   candidate expects 0 arguments, 2 provided
a.cc:13:19: error: no match for 'operator[]' (operand types are 'std::vector<bool>::reference' and 'int')
   13 |           white[i][j]=false;
      |                   ^
a.cc:18:19: error: no match for 'operator[]' (operand types are 'std::vector<bool>::reference' and 'int')
   18 |           white[i][j]=false;
      |                   ^
a.cc:23:19: error: no match for 'operator[]' (operand types are 'std::vector<bool>::reference' and 'int')
   23 |           white[i][j]=false;
      |                   ^
a.cc:28:19: error: no match for 'operator[]' (operand types are 'std::vector<bool>::reference' and 'int')
   28 |           white[i][j]=false;
      |                   ^
a.cc:32:31: error: no matching function for call to 'begin(std::_Bit_reference&)'
   32 |   for(auto y:white)for(auto x:y)ans+=x;
      |                               ^
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:   template argument deduction/substitution failed:
a.cc:32:31: note:   'std::_Bit_reference' is not derived from 'std::initializer_list<_Tp>'
   32 |   for(auto y:white)for(auto x:y)ans+=x;
      |                               ^
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:
/usr/include/c++/14/bits/range_access.h:52:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)'
   52 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:52:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&) [with _Container = std::_Bit_reference]':
a.cc:32:31:   required from here
   32 |   for(auto y:white)for(auto x:y)ans+=x;
      |                               ^
/usr/include/c++/14/bits/range_access.h:52:50: error: 'struct std::_Bit_reference' has no member named 'begin'
   52 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |                                           ~~~~~~~^~~~~
/usr/include/c++/14/bits/range_access.h:63:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)'
   63 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:63:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&) [with _Container = std::_Bit_reference]':
a.cc:32:31:   required from here
   32 |   for(auto y:white)for(auto x:y)ans+=x;
      |                               ^
/usr/include/c++/14/bits/range_access.h:63:56: error: 'const struct std::_Bit_reference' has no member named 'begin'
   63 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |                                                 ~~~~~~~^~~~~
/usr/include/c++/14/bits/range_access.h:95:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constex