Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#define maxn 100010
#define mod 1000000007
#define mp(x,y) make_pair(x,y)
#define se second
#define fi first
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
typedef unsigned long long ull;
int read()
{
    int x=0,f=1;
    char ch=getchar();
    while(ch-'0'<0||ch-'0'>9){if(ch=='-') f=-1;ch=getchar();}
    while(ch-'0'>=0&&ch-'0'<=9){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int f[20][(1<<16)+5];
int n,m,N;
int a[20];
int fac[(1<<16)+5],inv[(1<<16)+5];
int quick_pow(int x,int p)
{
    int an=1,po=x;
    while(p)
    {
        if(p&1)  an=1ll*an*po%mod;
        po=1ll*po*po%mod;
        p>>=1;
    }
    return an;
}
int C(int x,int y)
{
    if(x<0||y<0||x<y)  return 0;
    return 1ll*fac[x]*inv[y]%mod*inv[x-y]%mod;
}
int mix(int x,int y){return (x+y>=mod)?x+y-mod:x+y;}
void add(int &x,int y){x=mix(x,y);}
int size[(1<<16)+5];
int lb(int x)
{
    return x&(-x);
}
int main()
{
    n=read();m=read();N=(1<<n);
    for(int i=1;i<=m;i++)  a[i]=read();
    fac[0]=1;
    for(int i=1;i<=N;i++)  fac[i]=1ll*fac[i-1]*i%mod;
    inv[N]=quick_pow(fac[N],mod-2);
    for(int i=N-1;i>=0;i--)  inv[i]=1ll*inv[i+1]*(i+1)%mod;
    
    f[m+1][0]=1;
    for(int i=m;i>=1;i--)
    {
        for(int j=0;j<(1<<n);j++)
        {
            if(!f[i+1][j])  continue;
            add(f[i][j],f[i+1][j]);
            for(int k=0;k<n;k++)
            {
                if((j>>k)&1)  continue;
                int x=(N-a[i]+1)-j;
                f[i][j|(1<<k)]=(f[i][j|(1<<k)]+1ll*f[i+1][j]*C(x-1,(1<<k)-1)%mod*fac[(1<<k)])%mod;
            }
        }
    }
    
    for(int i=0;i<(1<<n);i++)  f[1][i]=1ll*f[1][i]*fac[N-i-1]%mod;
    for(int i=1;i<(1<<n);i++)  size[i]=size[i-lb(i)]+1;
    int ans=0;
    for(int i=0;i<(1<<n);i++)
    {
        if(size[i]&1)  add(ans,mod-f[1][i]);
        else           add(ans,f[1][i]);
    }
    ans=1ll*ans*(1<<n)%mod;
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:77:32: error: reference to 'size' is ambiguous
   77 |     for(int i=1;i<(1<<n);i++)  size[i]=size[i-lb(i)]+1;
      |                                ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:46:5: note:                 'int size [65541]'
   46 | int size[(1<<16)+5];
      |     ^~~~
a.cc:77:40: error: reference to 'size' is ambiguous
   77 |     for(int i=1;i<(1<<n);i++)  size[i]=size[i-lb(i)]+1;
      |                                        ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:46:5: note:                 'int size [65541]'
   46 | int size[(1<<16)+5];
      |     ^~~~
a.cc:81:12: error: reference to 'size' is ambiguous
   81 |         if(size[i]&1)  add(ans,mod-f[1][i]);
      |            ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:46:5: note:                 'int size [65541]'
   46 | int size[(1<<16)+5];
      |     ^~~~