Language: C++

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n,k;
    cin>>n>>k;
    
    map<int,bool>a(n,false);
  
    for(int i=0;i<k;k++)
    {
        int d=0;
        cin>>d; 
      
        int A[d]; 
       for(int j=0;j<d;j++)
       {
           cin>>A[j];
           
           if(!a.count(A[j]))
              {
                  a[A[j]]=true;
              } 
       }
    
    }
   int sum =0;
     for(int i=0;i<n;i++)
      {
          if(a.at(i)!=true)
            sum++;
      }       

     cout<<sum<<endl;
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:27: error: no matching function for call to 'std::map<int, bool>::map(int&, bool)'
    9 |     map<int,bool>a(n,false);
      |                           ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:302:9: note: candidate: 'template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator, const _Compare&, const allocator_type&) [with _Key = int; _Tp = bool; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, bool> >]'
  302 |         map(_InputIterator __first, _InputIterator __last,
      |         ^~~
/usr/include/c++/14/bits/stl_map.h:302:9: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_map.h:285:9: note: candidate: 'template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator) [with _Key = int; _Tp = bool; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, bool> >]'
  285 |         map(_InputIterator __first, _InputIterator __last)
      |         ^~~
/usr/include/c++/14/bits/stl_map.h:285:9: note:   template argument deduction/substitution failed:
a.cc:9:27: note:   deduced conflicting types for parameter '_InputIterator' ('int' and 'bool')
    9 |     map<int,bool>a(n,false);
      |                           ^
/usr/include/c++/14/bits/stl_map.h:268:9: note: candidate: 'template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator, const allocator_type&) [with _Key = int; _Tp = bool; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, bool> >]'
  268 |         map(_InputIterator __first, _InputIterator __last,
      |         ^~~
/usr/include/c++/14/bits/stl_map.h:268:9: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_map.h:262:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(std::initializer_list<std::pair<const _Key, _Val> >, const allocator_type&) [with _Key = int; _Tp = bool; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, bool> >; allocator_type = std::allocator<std::pair<const int, bool> >]'
  262 |       map(initializer_list<value_type> __l, const allocator_type& __a)
      |       ^~~
/usr/include/c++/14/bits/stl_map.h:262:40: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<std::pair<const int, bool> >'
  262 |       map(initializer_list<value_type> __l, const allocator_type& __a)
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:256:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(std::map<_Key, _Tp, _Compare, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Key = int; _Tp = bool; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, bool> >; std::__type_identity_t<_Alloc> = std::allocator<std::pair<const int, bool> >]'
  256 |       map(map&& __m, const __type_identity_t<allocator_type>& __a)
      |       ^~~
/usr/include/c++/14/bits/stl_map.h:256:17: note:   no known conversion for argument 1 from 'int' to 'std::map<int, bool>&&'
  256 |       map(map&& __m, const __type_identity_t<allocator_type>& __a)
      |           ~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:252:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(const std::map<_Key, _Tp, _Compare, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Key = int; _Tp = bool; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, bool> >; std::__type_identity_t<_Alloc> = std::allocator<std::pair<const int, bool> >]'
  252 |       map(const map& __m, const __type_identity_t<allocator_type>& __a)
      |       ^~~
/usr/include/c++/14/bits/stl_map.h:252:22: note:   no known conversion for argument 1 from 'int' to 'const std::map<int, bool>&'
  252 |       map(const map& __m, const __type_identity_t<allocator_type>& __a)
      |           ~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:248:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(const allocator_type&) [with _Key = int; _Tp = bool; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, bool> >; allocator_type = std::allocator<std::pair<const int, bool> >]'
  248 |       map(const allocator_type& __a)
      |       ^~~
/usr/include/c++/14/bits/stl_map.h:248:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_map.h:240:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(std::initializer_list<std::pair<const _Key, _Val> >, const _Compare&, const allocator_type&) [with _Key = int; _Tp = bool; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, bool> >; allocator_type = std::allocator<std::pair<const int, bool> >]'
  240 |       map(initializer_list<value_type> __l,
      |       ^~~
/usr/include/c++/14/bits/stl_map.h:240:40: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<std::pair<const int, bool> >'
  240 |       map(initializer_list<value_type> __l,
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:227:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(std::map<_Key, _Tp, _Compare, _Alloc>&&) [with _Key = int; _Tp = bool; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, bool> >]'
  227 |       map(map&&) = default;
      |       ^~~
/usr/include/c++/14/bits/stl_map.h:227:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_map.h:219:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(const std::map<_Key, _Tp, _Compare, _Alloc>&) [with _Key = int; _Tp = bool; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, bool> >]'
  219 |       map(const map&) = default;
      |       ^~~
/usr/include/c++/14/bits/stl_map.h:219:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_map.h:206:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(const _Compare&, const allocator_type&) [with _Key = int; _Tp = bool; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, bool> >; allocator_type = std::allocator<std::pair<const int, bool> >]'
  206 |       map(const _Compare& __comp,
      |       ^~~
/usr/include/c++/14/bits/stl_map.h:206:27: note:   no known conversion for argument 1 from 'int' to 'const std::less<int>&'
  206 |       map(const _Compare& __comp,
      |           ~~~~~~~~~~~~~~~~^~~~~~
/usr/include/c++/14/bits/stl_map.h:197:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map() [with _Key = int; _Tp = bool; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, bool> >]'
  197 |       map() = default;
      |       ^~~
/usr/include/c++/14/bits/stl_map.h:197:7: note:   candidate expects 0 arguments, 2 provided