criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<bits/stdc++.h> 
using namespace std;
#define mod 1e9+7;
int dp[22][(1<<22)];
int solve(int relation[][n],int wset,int men,int n){
	if(men==n+1){
      if(wset==0)
        return 1;
      return 0;}
  	if(dp[men][wset]!=-1)
      	return dp[men][wset];
  	int ans=0;
  	for(int w=0;w<n;w++){
    	bool present=(1<<w)&wset;
      	if(present){
          ans+=solve(relation,wset^(1<<w),men+1,n);
          ans%=mod;
    }
     return dp[men][wset]=ans;
}
int main(){
  	int n;
  	cin>>n;
  	int relation[n+1][n+1];
  	memset(dp,-1,sizeof dp);
  	for(int i=1;i<=n;i++){
      	for(int j=1;j<=n;j++){
          	cin>>relation[i][j];}}
  	cout<<solve(relation,1,0,n);

Compiler output:
a.cc:5:26: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 | int solve(int relation[][n],int wset,int men,int n){
      |                          ^
      |                          yn
a.cc:5:28: error: expected ')' before ',' token
    5 | int solve(int relation[][n],int wset,int men,int n){
      |          ~                 ^
      |                            )
a.cc:5:29: error: expected unqualified-id before 'int'
    5 | int solve(int relation[][n],int wset,int men,int n){
      |                             ^~~
Language: C++

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

int dp[22][(1<<22)];
int n;
int solve(int compat[][n+1],int i,int womenSubset,int N)
{
    if(i==N+1){
        if(womenSubset == 0)
            return 1;
        return 0;
        }
        if(dp[i][womenSubset] != -1){return dp[i][womenSubset];}
        long ans=0;
        for(int women=0;women<N;women++){
            int available = womenSubset & (1<<women) ? 1 : 0;
            if(available && compat[i][women+1]){
                ans = (ans + solve(compat, i+1, womenSubset^(1<<women), N))%1000000007;
            }

        }
        return dp[i][womenSubset] = ans;
    }

int32_t main()
{
    cin>>n;
    int compat[n+1][n+1];
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            cin>>compat[i][j];
        }
    }
    memset(dp,-1,sizeof dp);
    cout<<solve(compat, 1, (1<<n)-1, n);


}

Compiler output:
a.cc:6:25: error: size of array 'compat' is not an integral constant-expression
    6 | int solve(int compat[][n+1],int i,int womenSubset,int N)
      |                        ~^~
a.cc: In function 'int32_t main()':
a.cc:35:17: error: cannot convert 'int (*)[(n + 1)]' to 'int (*)[1]'
   35 |     cout<<solve(compat, 1, (1<<n)-1, n);
      |                 ^~~~~~
      |                 |
      |                 int (*)[(n + 1)]
a.cc:6:15: note:   initializing argument 1 of 'int solve(int (*)[1], int, int, int)'
    6 | int solve(int compat[][n+1],int i,int womenSubset,int N)
      |           ~~~~^~~~~~~~~~~~~
Language: C++

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

int dp[22][(1<<22)];
int n;
int solve(int compat[][n+1],int i,int womenSubset, int N)
{
    if(i==N+1){
        if(womenSubset == 0)
            return 1;
        return 0;
        }
        if(dp[i][womenSubset] != -1){return dp[i][womenSubset];}
        long ans=0;
        for(int women=0;women<N;women++){
            int available = womenSubset & (1<<women) ? 1 : 0;
            if(available && compat[i][women+1]){
                ans = (ans + solve(compat, i+1, womenSubset^(1<<women), N))%1000000007;
            }

        }
        dp[i][womenSubset] = ans;
    }
}
int32_t main()
{
    cin>>n;
    int compat[n+1][n+1];
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            cin>>compat[i][j];
        }
    }
    memset(dp,-1,sizeof dp);
    cout<<solve(compat, 1, (1<<n)-1, n);


}

Compiler output:
a.cc:7:25: error: size of array 'compat' is not an integral constant-expression
    7 | int solve(int compat[][n+1],int i,int womenSubset, int N)
      |                        ~^~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
a.cc: In function 'int32_t main()':
a.cc:36:17: error: cannot convert 'long long int (*)[(n + 1)]' to 'long long int (*)[1]'
   36 |     cout<<solve(compat, 1, (1<<n)-1, n);
      |                 ^~~~~~
      |                 |
      |                 long long int (*)[(n + 1)]
a.cc:7:15: note:   initializing argument 1 of 'long long int solve(long long int (*)[1], long long int, long long int, long long int)'
    7 | int solve(int compat[][n+1],int i,int womenSubset, int N)
      |               ^
a.cc: In function 'long long int solve(long long int (*)[1], long long int, long long int, long long int)':
a.cc:23:28: warning: control reaches end of non-void function [-Wreturn-type]
   23 |         dp[i][womenSubset] = ans;
      |         ~~~~~~~~~~~~~~~~~~~^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long MOD = 1e9+7;
int main()
{
    int n;
    cin >> n;
    vector<vector<int>> grid(n,vector<int>(n,0));
    for(int i =0;i<n;i++)
        for(int j = 0;j<n;j++)
        {
            cin >> grid[i][j];
        }
    
    vector<int> dp(1<<n);
    dp[0] = 1;
    for(int mask = 0;mask < (1 << n) -1; mask++)
    {
        int  a = __builtin_popcount(mask);
        for(int b = 0;b < n;b++)
        {
            if(grid[a][b] && !(mask & (1 << b)))
            {
                int m = mask | (1 << b);
                dp[m] += (dp[mask]%MOD);
            }
        }
    }
    
    cout << dp[(1<<n)-1]%MOD << endl;
    return 0;
}#include<bits/stdc++.h>
using namespace std;
long long MOD = 1e9+7;
int main()
{
    int n;
    cin >> n;
    vector<vector<int>> grid(n,vector<int>(n,0));
    for(int i =0;i<n;i++)
        for(int j = 0;j<n;j++)
        {
            cin >> grid[i][j];
        }
    
    vector<int> dp(1<<n);
    dp[0] = 1;
    for(int mask = 0;mask < (1 << n) -1; mask++)
    {
        int  a = __builtin_popcount(mask);
        for(int b = 0;b < n;b++)
        {
            if(grid[a][b] && !(mask & (1 << b)))
            {
                int m = mask | (1 << b);
                dp[m] += (dp[mask]%MOD);
            }
        }
    }
    
    cout << dp[(1<<n)-1]%MOD << endl;
    return 0;
}

Compiler output:
a.cc:32:2: error: stray '#' in program
   32 | }#include<bits/stdc++.h>
      |  ^
a.cc:32:3: error: 'include' does not name a type
   32 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:34:11: error: redefinition of 'long long int MOD'
   34 | long long MOD = 1e9+7;
      |           ^~~
a.cc:3:11: note: 'long long int MOD' previously defined here
    3 | long long MOD = 1e9+7;
      |           ^~~
a.cc:35:5: error: redefinition of 'int main()'
   35 | int main()
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main()
      |     ^~~~
Language: C++

#pragma GCC target("arch=ivybridge")
#pragma GCC optimize ("unroll-loops")

#include <iostream>
#include <vector>

using namespace std;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    const int MOD = 1000000007;
    int n, r;
    char p;
    cin >> n;
    int upbound = (1 << n);
    vector<int> g(n), dp(upbound);
    for (int i = 0; i < n; ++i)
        for (int j = 0; j < n; ++j) {
            cin >> p;
            if(p=='1')
            g[i] |= (1 << j);
        }
    dp[0] = 1;
    for (int x = 1; x < upbound; ++x) {
        p = __builtin_popcount(x), r = 0;
        for (int y = x & g[p - 1]; y; y &= y - 1)
        {
            r += dp[x & ~(y & -y)];
            if (r >= MOD) r -= MOD;
        }
        dp[x] = r;
    }
    cout << dp[upbound - 1];
}

Compiler output:
In file included from /usr/include/c++/14/string:43,
                 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:4:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::_Vector_base<int, std::allocator<int> >::_Vector_impl::~_Vector_impl()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = int]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_vector.h:132:14: note: called from here
  132 |       struct _Vector_impl
      |              ^~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
ll mod=1e9+7;
vector<vector<int>> v;
vector<vector<ll>> dp;
int size,n;
ll solve(int i,int x)
{
  if(i==n)
  return (x==0?1:0);
  if(dp[i][x]!=-1)
  return dp[i][x];
  ll ans=0;
  for(int j=0;j<n;j++)
  {
    if(v[i][j]==0||(((1<<j)&x)==0))
    continue;
    ans=(ans+solve(i+1,(x^(1<<j))))%mod;
  }
  return dp[i][x]=ans;
}
int main()
{
  cin>>n;
  v.resize(n,vector<int>(n));
  for(int i=0;i<n;i++)
  {
    for(int j=0;j<n;j++)
    {
      cin>>v[i][j];
    }
  }
  size=(1<<n)-1;
  dp.resize(n,vector<ll>((1<<n),-1));
  cout<<solve(0,size)<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:3: error: reference to 'size' is ambiguous
   34 |   size=(1<<n)-1;
      |   ^~~~
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,
                 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:7:5: note:                 'int size'
    7 | int size,n;
      |     ^~~~
a.cc:36:17: error: reference to 'size' is ambiguous
   36 |   cout<<solve(0,size)<<endl;
      |                 ^~~~
/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:7:5: note:                 'int size'
    7 | int size,n;
      |     ^~~~
Language: C++

#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <limits>
 
using namespace std;
 
int N;
size_t MASK;
vector<vector<int>> v;
vector<vector<int>> dp;
 
size_t get_mask()
{ 
  size_t mask = 0;
  for (int i = 0; i < N; ++i)
  { 
    mask |= (1 << i);
  }
  return mask;
}
 
inline size_t add(size_t res, size_t delta)
{ 
  return (res + delta) % 1000000007;
}
 
size_t solution(int i, size_t mask = 0)
{ 
  size_t res = 0; 
  for (int j = 0; j < N; ++j)
  { 
    if (v[i][j] && !(mask & (1<<j)))
    { 
      const size_t new_mask = mask | (1<<j);
      if (new_mask == MASK)
      { 
        res = add(res, 1);
        break;
      }
      if (dp[i+1][new_mask] == -1)
      { 
        dp[i+1][new_mask] = solution(i+1, new_mask);
      }
      res = add(res, dp[i+1][new_mask]);
    }
  }
  return res;
}
 
int main()
{
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
 
  cin >> N;
 
  MASK = get_mask();
 
  v = vector<vector<int>>(N, vector<int>(N));
  dp = vector<vector<int>>(N+1, vector<int>(1<<N, -1));
 
  for (int i = 0; i < N; ++i)
  {
    for (int j = 0; j < N; ++j)
    {   
      cin >> v[i][j];
    }   
  }
 
  cout << solution(0);
 
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:8: error: 'cin' is not a member of 'std'
   55 |   std::cin.tie(0);
      |        ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include <limits>
  +++ |+#include <iostream>
    6 | 
a.cc:57:3: error: 'cin' was not declared in this scope
   57 |   cin >> N;
      |   ^~~
a.cc:57:3: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:72:3: error: 'cout' was not declared in this scope
   72 |   cout << solution(0);
      |   ^~~~
a.cc:72:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

// #include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<math.h>
#include<map>
#include<queue>


using namespace std;
#define mod 1000000007
#define ll long long 

ll n, k;

ll arr[29][29];
ll dp[22][(1<<22)];



ll solve(ll idx, ll mask) {

	if(idx == n)
		return mask == (1 << n) - 1;

	if(dp[idx][mask] != -1)
		return dp[idx][mask];

	ll ans = 0;
	ll new_mask;

	for(int i = 0; i < n; i++) {
		if(!(mask&(1<<i)) && arr[idx][i]) {
			
			new_mask = mask | ( 1 << i);
			ans += solve(idx + 1, new_mask);
			ans %= mod;
		}
	}

	return dp[idx][mask] = ans;
}


int main() {
	memset(dp, -1, sizeof(dp));
	cin>>n;
    for(int i = 0; i < n; i++) {
    	for(int j = 0; j < n; j++) {
 			scanf("%lld", &arr[i][j]);   		
    	}
    }
    cout<<solve(0, 0)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:9: error: 'memset' was not declared in this scope
   46 |         memset(dp, -1, sizeof(dp));
      |         ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include<queue>
  +++ |+#include <cstring>
    8 |
Language: C++



#include <bits/stdc++.h> 
#define ll long long
#define ull unsigned long long
#define endl '\n'
#define pb push_back
#define mp make_pair
#define sp(x) fixed<<setprecision(x)
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
ll mod = 1e9+7;
ll dp[22][(1<<22)];

ll fun( vector< vector<int>> &comp, ll N, ll i, ll woman_bit)
{
    //Base case
    if(i == N+1)
    {
        if(woman_bit == 0)
        return 1;
        return 0;
    }
    
    //Lookup
    if(dp[i][woman_bit] != -1)
    return dp[i][woman_bit];
    
    //Rec case
    ll ans = 0;
    for(ll w=0;w<N;w++)
    {
        bool is_avail = ( ((1<<w) & woman_bit) == 0) ? 0 : 1;
        
        if(is_avail && comp[i][w+1])
        {
            ans += fun( comp,N,i+1, (woman_bit ^ (1<<w)));
            ans %= mod;
        }
    }
    return dp[i][woman_bit] = ans;
}

int main()
{
    fast_io;
    
    ll N;
    cin>>N;
    
    vector< vector<ll>> comp(N+1, vector<ll>(N+1));
   //int comp[22][22];
    for(ll i=1;i<=N;i++)
    {
        for(ll j=1;j<=N;j++)
        cin>>comp[i][j];
    }
    
    memset(dp,-1,sizeof(dp));
    cout<<fun(comp,N,1,(1<<N)-1)<<endl;
    
    return 0;
}






Compiler output:
a.cc: In function 'int main()':
a.cc:60:15: error: invalid initialization of reference of type 'std::vector<std::vector<int> >&' from expression of type 'std::vector<std::vector<long long int> >'
   60 |     cout<<fun(comp,N,1,(1<<N)-1)<<endl;
      |               ^~~~
a.cc:15:31: note: in passing argument 1 of 'long long int fun(std::vector<std::vector<int> >&, long long int, long long int, long long int)'
   15 | ll fun( vector< vector<int>> &comp, ll N, ll i, ll woman_bit)
      |         ~~~~~~~~~~~~~~~~~~~~~~^~~~
Language: C++



#include <bits/stdc++.h> 
#define ll long long
#define ull unsigned long long
#define endl '\n'
#define pb push_back
#define mp make_pair
#define sp(x) fixed<<setprecision(x)
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
ll mod = 1e9+7;
ll dp[22][(1<<22)];

ll fun( int &comp[22][22], ll N, ll i, ll woman_bit)
{
    //Base case
    if(i == N+1)
    {
        if(woman_bit == 0)
        return 1;
        return 0;
    }
    
    //Lookup
    if(dp[i][woman_bit] != -1)
    return dp[i][woman_bit];
    
    //Rec case
    ll ans = 0;
    for(ll w=0;w<N;w++)
    {
        bool is_avail = ( ((1<<w) & woman_bit) == 0) ? 0 : 1;
        
        if(is_avail && comp[i][w+1])
        {
            ans += fun( comp,N,i+1, (woman_bit ^ (1<<w)));
            ans %= mod;
        }
    }
    return dp[i][woman_bit] = ans;
}

int main()
{
    fast_io;
    
    ll N;
    cin>>N;
    
   // vector< vector<ll>> comp(N+1, vector<ll>(N+1));
   int comp[22][22];
    for(ll i=1;i<=N;i++)
    {
        for(ll j=1;j<=N;j++)
        cin>>comp[i][j];
    }
    
    memset(dp,-1,sizeof(dp));
    cout<<fun(comp,N,1,(1<<N)-1)<<endl;
    
    return 0;
}






Compiler output:
a.cc:15:14: error: declaration of 'comp' as array of references
   15 | ll fun( int &comp[22][22], ll N, ll i, ll woman_bit)
      |              ^~~~
a.cc:15:26: error: expected ')' before ',' token
   15 | ll fun( int &comp[22][22], ll N, ll i, ll woman_bit)
      |       ~                  ^
      |                          )
a.cc:4:12: error: expected unqualified-id before 'long'
    4 | #define ll long long
      |            ^~~~
a.cc:15:28: note: in expansion of macro 'll'
   15 | ll fun( int &comp[22][22], ll N, ll i, ll woman_bit)
      |                            ^~
Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
#define mod 1000000007
const int N=22;

ll n;
vector<vector<ll> > compat(N,vector<ll>(N);
ll dp[N][(i<<N)];

ll solve(ll i,ll wom_sub){
	if(i==n+1){
		if(wom_sub==0)
		return 1;
	    return 0;
	}
	
	if(dp[i][wom_sub]!=-1)
	return dp[i][wom_sub];
	
	ll ans=0;
	
	for(ll wom=0;wom <n;wom++){
		bool avail = (((1<<wom)&(wom_sub))==0)?0:1;
		if(avail && compat[i][wom+1]){
			ans+=(solve(i+1,wom_sub ^ (1<<wom)))%mod;
		}
	}
	return dp[i][wom_sub]=ans;
}

int main(){
	cin>>n;
	
	for(ll i=1;i<=n;i++){
		for(ll j=1;j<=n;j++){
			cin>>compat[i][j];
		}
	}
	memset(dp,-1,sizeof(dp));
	cout<<solve(i,(1<<n) - 1)<<endl;
	
}

Compiler output:
a.cc:8:43: error: expected ')' before ';' token
    8 | vector<vector<ll> > compat(N,vector<ll>(N);
      |                           ~               ^
      |                                           )
a.cc:9:11: error: 'i' was not declared in this scope
    9 | ll dp[N][(i<<N)];
      |           ^
a.cc: In function 'long long int solve(long long int, long long int)':
a.cc:18:12: error: 'dp' was not declared in this scope; did you mean 'dup'?
   18 |         if(dp[i][wom_sub]!=-1)
      |            ^~
      |            dup
a.cc:29:16: error: 'dp' was not declared in this scope; did you mean 'dup'?
   29 |         return dp[i][wom_sub]=ans;
      |                ^~
      |                dup
a.cc: In function 'int main()':
a.cc:40:16: error: 'dp' was not declared in this scope; did you mean 'dup'?
   40 |         memset(dp,-1,sizeof(dp));
      |                ^~
      |                dup
a.cc:41:21: error: 'i' was not declared in this scope
   41 |         cout<<solve(i,(1<<n) - 1)<<endl;
      |                     ^
Language: C++

#include<iostream>
#include<cstring>
using namespace std;

#define mod 1000000007

int a[22][22];
long mem[22][(1<<22)-1];

long rec(int curr, int mask, int n)
{
  if(curr==n)
    return mask==0;
  if(mem[curr][mask]!=-1)
    return mem[curr][mask];
  long ans=0;
  for(int j=0;j<n;j++)
  {
    bool available=mask&(1<<j);
    if(available&&a[curr][j])
      ans=(ans%mod+rec(curr+1,mask^(1<<j))%mod)%mod;
  }
  mem[curr][mask]=ans;
  return ans;
  
}

int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++)
  {
    for(int j=0;j<n;j++)
      cin>>a[i][j];
  }
  memset(mem,-1,sizeof(mem));
  
  cout<<rec(0,(1<<n)-1,n);
  

}

Compiler output:
a.cc: In function 'long int rec(int, int, int)':
a.cc:21:23: error: too few arguments to function 'long int rec(int, int, int)'
   21 |       ans=(ans%mod+rec(curr+1,mask^(1<<j))%mod)%mod;
      |                    ~~~^~~~~~~~~~~~~~~~~~~~
a.cc:10:6: note: declared here
   10 | long rec(int curr, int mask, int n)
      |      ^~~
Language: C++

#include<iostream>
using namespace std;

#define mod 1000000007

int a[22][22];
long mem[22][(1<<22)-1];

long rec(int curr, int mask, int n)
{
  if(curr==n)
    return mask==0;
  if(mem[curr][mask]!=-1)
    return mem[curr][mask];
  long ans=0;
  for(int i=0;i<n;i++)
  {
    bool available=mask&(1<<j);
    if(available&&a[curr][j])
      ans=(ans%mod+rec(curr+1,mask^(1<<j))%mod)%mod;
  }
  mem[curr][mask]=ans;
  return ans;
  
}

int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++)
  {
    for(int j=0;j<n;j++)
      cin>>a[i][j];
  }
  memset(mem,-1,sizeof(mem));
  
  cout<<rec(0,(1<<n)-1,n);
  

}

Compiler output:
a.cc: In function 'long int rec(int, int, int)':
a.cc:18:29: error: 'j' was not declared in this scope
   18 |     bool available=mask&(1<<j);
      |                             ^
a.cc: In function 'int main()':
a.cc:35:3: error: 'memset' was not declared in this scope
   35 |   memset(mem,-1,sizeof(mem));
      |   ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: Java

//Matching
import java.util.*;
public class Solution{
	static int n;
	static int[][] matrix;
	static int mod=(int)1e9+7;
	static int dp[][];
	public static int solve(int i,int mask){
		if(i==n){
		
			if(mask==0)
				return 1;
			return 0;
		}
		if(dp[i][mask]!=-1){
			return dp[i][mask];
		}
		int ans=0;

		for(int j=0;j<n;j++){
			int avai=mask&(1<<(j));
			if(matrix[i][j]==1&&avai!=0){
				ans=(ans+solve(i+1,mask&(~(1<<j))))%mod;

			}
		}
		return dp[i][mask]=ans;

	}
	public static void main(String[] args) {
		Scanner s=new Scanner(System.in);
		n=s.nextInt();
		matrix=new int[n][n];
		int finalBits=((1<<n)-1);
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				matrix[i][j]=s.nextInt();
			}
		}
		dp=new int[n][(1<<n)];
		for(int[] x:dp){
			Arrays.fill(x,-1);
		}
		System.out.println(solve(0,finalBits));
	   }
	}

Compiler output:
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java
public class Solution{
       ^
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;

const int N = 1 << 21;
const int MOD = 1e9 + 7;
int n, a[21][21];
long long dp[21][N];

long long solve2()
{
	int W = (1 << n) - 1;
	for (int i = 0; i <= n; i++)
	{
		for (int w = 0; w <= W; w++)
		{
			if (i == 0)
				dp[i][w] = 1;
			else
			{
				for (int j = 0; j < n; j++)
				{
					if (a[i][j] && ((1 << j)&w))
						dp[i][j] = (dp[i][j] + dp[i - 1][w - (1 << j)]) % MOD;
				}
			}
		}
	}

	return dp[n][W];
}

int main()
{
	cin >> n;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			cin >> a[i][j];
	memset(dp, -1, sizeof(dp));
	cout << solve(0, (1 << n) - 1) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:17: error: 'solve' was not declared in this scope; did you mean 'solve2'?
   40 |         cout << solve(0, (1 << n) - 1) << endl;
      |                 ^~~~~
      |                 solve2
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
//bool visited[50];
//int ct=0;
int dp[22][1<<22];
int solve(int a[][50],int n,int i,int womenset){

    if(i==n+1)
    {
        if(womenset==0)
        return 1;
        return 0;
    }
    if(dp[i][womenset]!=-1)return dp[i][womenset];
   int ans=0;
      for(int j=0;j<n;j++)
      {
          bool available=((1<<j)&womenset==0)?0:1;
          if(available&&a[i][j+1])
           ans=(ans+solve(a,n,i+1,womenset^(1<<j)))%mod;
           
      }
      dp[i][womenset]=ans
      return dp[i][womenset];
}
int main() {
 int n;
 cin>>n;
 int a[50][50];
 for(int i=1;i<=n;i++)
 {
     for(int j=1;j<=n;j++)
     {
         cin>>a[i][j];
     }
 }
 //memset(visited,0,sizeof(visited));
 memset(dp,-1,sizeof(dp));
 solve(a,n,1,(1<<(n)-1));
 cout<<ct%mod<<endl;

}


Compiler output:
a.cc: In function 'int solve(int (*)[50], int, int, int)':
a.cc:24:26: error: expected ';' before 'return'
   24 |       dp[i][womenset]=ans
      |                          ^
      |                          ;
   25 |       return dp[i][womenset];
      |       ~~~~~~              
a.cc: In function 'int main()':
a.cc:41:8: error: 'ct' was not declared in this scope
   41 |  cout<<ct%mod<<endl;
      |        ^~
a.cc: In function 'int solve(int (*)[50], int, int, int)':
a.cc:24:22: warning: control reaches end of non-void function [-Wreturn-type]
   24 |       dp[i][womenset]=ans
      |       ~~~~~~~~~~~~~~~^~~~
Language: C++

#include <bits/stdc++.h>

const int MOD = 1000000000 + 7;

int N;
int v[21][21];
int dp[21][1 << 21];

int solve(const int i, const int j)
{
 	if (dp[i][j] != -1)
    {
     	return dp[i][j] 
    }
  	
  	if (i == N)
    {
     	return dp[i][j] = 1; 
    }
  
  	int ans = 0;
  	for (int k = 0; k < N; k += 1)
    {
     	if (not v[i][k]) 
        {
         	continue; 
        }
      	if (j & (1 << k))
        {
         	ans += solve(i + 1, j | (1 << k)); 
          	if (ans > MOD)
            {
             	ans -= MOD; 
            }
        }
    }
	return dp[i][j] = ans;
}

int main()
{
	std::ios_base::sync_with_stdio(0);
	std::cin.tie(0);
    
  	std::cin >> N;
	for (int i = 0; i < N; i += 1)
    {
     	for (int j = 0; j < N; j += 1)
        {
         	std::cin >> v[i][j]; 
        }
    }
  
  	std::memset(dp, -1, sizeof dp);
  	std::cout << solve(0, (1 << N) - 1) << std::endl;
}


Compiler output:
a.cc: In function 'int solve(int, int)':
a.cc:13:24: error: expected ';' before '}' token
   13 |         return dp[i][j]
      |                        ^
      |                        ;
   14 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>

const int MOD = 1000000000 + 7;

int N;
int v[21][21];
int dp[21][1 << 21];

int solve(const int i, const int j)
{
 	if (dp[i][mask] != -1)
    {
     	return dp[i][j] 
    }
  	
  	if (i == N)
    {
     	return dp[i][j] = 1; 
    }
  
  	int ans = 0;
  	for (int k = 0; k < N; k += 1)
    {
     	if (not v[i][k]) 
        {
         	continue; 
        }
      	if (mask & (1 << k))
        {
         	ans += solve(i + 1, mask | (1 << k)); 
          	if (ans > MOD)
            {
             	ans -= MOD; 
            }
        }
    }
	return dp[i][j] = ans;
}

int main()
{
	std::ios_base::sync_with_stdio(0);
	std::cin.tie(0);
    
  	std::cin >> N;
	for (int i = 0; i < N; i += 1)
    {
     	for (int j = 0; j < N; j += 1)
        {
         	std::cin >> v[i][j]; 
        }
    }
  
  	std::memset(dp, -1, sizeof dp);
  	std::cout << solve(0, (1 << N) - 1) << std::endl;
}

Compiler output:
a.cc: In function 'int solve(int, int)':
a.cc:11:19: error: 'mask' was not declared in this scope; did you mean 'std::filesystem::perms::mask'?
   11 |         if (dp[i][mask] != -1)
      |                   ^~~~
      |                   std::filesystem::perms::mask
In file included from /usr/include/c++/14/filesystem:51,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
                 from a.cc:1:
/usr/include/c++/14/bits/fs_fwd.h:162:7: note: 'std::filesystem::perms::mask' declared here
  162 |       mask              = 07777,
      |       ^~~~
a.cc:13:24: error: expected ';' before '}' token
   13 |         return dp[i][j]
      |                        ^
      |                        ;
   14 |     }
      |     ~                   
a.cc:28:13: error: 'mask' was not declared in this scope; did you mean 'std::filesystem::perms::mask'?
   28 |         if (mask & (1 << k))
      |             ^~~~
      |             std::filesystem::perms::mask
/usr/include/c++/14/bits/fs_fwd.h:162:7: note: 'std::filesystem::perms::mask' declared here
  162 |       mask              = 07777,
      |       ^~~~
Language: Java

import java.io.*;
import java.util.*;


public class Solution {

	
	public static class FastReader {
		BufferedReader br;
		StringTokenizer root;
		
 
		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
 
		String next() {
			while (root == null || !root.hasMoreTokens()) {
				try {
					root = new StringTokenizer(br.readLine());
				} catch (Exception addd) {
					addd.printStackTrace();
				}
			}
			return root.nextToken();
		}
 
		int nextInt() {
			return Integer.parseInt(next());
		}
 
		double nextDouble() {
			return Double.parseDouble(next());
		}
 
		long nextLong() {
			return Long.parseLong(next());
		}
 
		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception addd) {
				addd.printStackTrace();
			}
			return str;
		}
	}
	

	public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));
	
	public static FastReader sc = new FastReader();
 
	static int mod = (int) (1e9+7),MAX=(int) (1e4);
	static List<Integer>[] edges;
    static Long[] dp;
    static int[][] a;
    static int n;
	
	public static void main(String[] args) throws IOException {
		
	n = sc.nextInt();
	a = new int[n][n];

	for(int i=0;i<n;++i) {
		for(int j=0;j<n;++j)
			a[i][j] = sc.nextInt();
	}
	
    dp = new Long[1<<n];
    out.println(f(0));    

out.close();
}
private static long f(int mask) {
	int row = Integer.bitCount(mask);
	if(row == n) return 1;
	
	if(dp[mask] != null) return dp[mask];
  
    long ans = 0;
	for(int col=0;col<n;++col)
         if(((mask>>col)&1) == 0 && a[row][col] == 1)
        	 ans=(ans + f(mask|1<<col))%mod;
	
	return dp[mask] = ans;
}
	
	}




Compiler output:
Main.java:5: error: class Solution is public, should be declared in a file named Solution.java
public class Solution {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define pii pair<ll,ll>
#define pll pair<long long, long long >
#define ll long long
#define lcm(a,b) (a)/__gcd((a),(b))*(b)
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define maxn 1000000007
#define endl '\n'
#define trace(x) cerr << #x << ": " << x << endl;
#define trace2(x, y) cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z) cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
bool check(ll mask,ll i)
{
  return mask&(1<<i);
}
ll Set(ll mask, ll i)
{
  return mask | (1 << i);
}
ll mod(ll x)
{
  if(x < maxn)return x;
  return x%maxn;
}
ll add(ll x, ll y)
{
  if(x+y<mod)
}
ll dir8[2][8] = {{1,-1,0,0,1,-1,1,-1},{0,0,1,-1,1,-1,-1,1}};
ll dir4[2][4] = {{1,-1,0,0},{0,0,1,-1}};
ll m,n,row,col,lim;
ll g[22][22];
ll memo[22][2200000];
ll dp(ll i,ll mask)
{
  if(i>=n && mask == lim)return 1;
  if(i>=n && mask!= lim)return 0;
  ll p = 0ll;
  if(memo[i][mask]!=-1)return memo[i][mask];
  for(ll w=0;w<n;w++)
  {
    if(!check(mask,w) && g[i][w] == 1)p = add(p,dp(i+1,Set(mask,w)));
  }
  memo[i][mask] = p;
  return memo[i][mask];
}
void solve()
{
  scanf("%lld",&n);
  lim = (1<<n)-1;
  memset(memo,-1,sizeof memo);
  for(ll w=0;w<n;w++)
  {
    for(ll q=0;q<n;q++)scanf("%lld",&g[w][q]);
  }
  cout << dp(0ll,0ll) << endl;
}
void test()
{
  ll t;
  //scanf("%d",&t);
  t = 1;
  for(ll test=1;test<=t;test++)
  {
    solve();
  }
}
int main()
{
  test();
  return 0;
}


Compiler output:
a.cc: In function 'long long int add(long long int, long long int)':
a.cc:32:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   32 |   if(x+y<mod)
      |         ^
a.cc:33:1: error: expected primary-expression before '}' token
   33 | }
      | ^
a.cc:33:1: warning: no return statement in function returning non-void [-Wreturn-type]
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N=1e5+1;
const int mod=1e9+7;
vector<int>g[N];
#define pb push_back
#define ll long long
ll n;
ll dp[N+1][2];

ll add(ll a,ll b)	{return (a + b)%mod; }
ll mul(ll a,ll b) 	{return (a * b)%ll(mod); }

ll dfs(int u,int par,int color){
	if(dp[u][color]!=-1) return dp[u][color];
	ll mn=1;
	for(auto v:g[u]){
		if(v==par) continue;
		ll temp=dfs(v,u,1);									
		if(color) temp=add(temp,dfs(v,u,0));				
 		mn=mul(mn,temp);
	}
	return dp[u][color]=mn;
}

int main(){
	cin>>n;
	memset(dp,-1,sizeof(dp));
	for(int i=0;i<n-1;i++){
		int u,v;
		cin>>u>>v;
		u--,v--;
		g[u].pb(v);
		g[v].pb(u);
	}
	cout<<add(dfs(0,-1,1),dfs(0,-1,0))<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'long long int mul(long long int, long long int)':
a.cc:7:12: error: expected primary-expression before 'long'
    7 | #define ll long long
      |            ^~~~
a.cc:12:41: note: in expansion of macro 'll'
   12 | ll mul(ll a,ll b)       {return (a * b)%ll(mod); }
      |                                         ^~
a.cc:12:41: error: expected ';' before 'long'
   12 | ll mul(ll a,ll b)       {return (a * b)%ll(mod); }
      |                                         ^
      |                                         ;
Language: C++

#include "bits/stdc++.h"


//region Template
#include "ext/pb_ds/assoc_container.hpp"

using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
const int MOD2 = 998244353;
const int MOD = 1000000007;
using namespace std;
#define finish(x) cout << x; exit(0);
#define fastIO cin.tie(0); cin.sync_with_stdio(false);
#define fi first
#define se second
void setIn(string s) { freopen(s.c_str(), "r", stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }

//const string USCAO_TAG = "mountains";
void usaco(const string& USACO_TAG) { setIn(USACO_TAG + ".in"); setOut(USACO_TAG + ".out"); }
#define is_empty(...) ( sizeof( (char[]){#__VA_ARGS__} ) == 1 )

void print() {}
template<typename T, typename... Args>
void print(T firstArg, Args... args) {
	#ifdef LOCAL
	cout << firstArg << endl;
	print(args...);
	#endif
}

//endregion

/* Notes:
 * Fry my kartoshka
 */

const int MAXN = 21;
const int INF = 2e9;

bool ok[MAXN][MAXN];

ll dp[22][1 << 21 + 1];

int main(){
	//usaco("milkvisits");

#ifdef LOCAL
	setIn("in.txt");
	setOut("out.txt");
#endif

	fastIO;

	int n;
	cin >> n;

	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			cin >> ok[i][j];
		}
	}

	for(int i = 0; i < n; i++){
		dp[0][1 << i] = ok[0][i];
	}


	for(int i = 1; i < n; i++){
		for(int j = 0; j < (1 << n); j++){
			for(int b = 0; b < n; b++){
				if(ok[i][b] && j & (1 << b)){
					dp[i][j] += dp[i - 1][j ^ (1 << b)];
					if(dp[i][j] >= MOD){
						dp[i][j] -= MOD:
					}
				}
			}
		}
	}

	ll ans = 0;

	ans = dp[n - 1][(1 << n) - 1] % MOD;
	cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:79:64: error: expected ';' before ':' token
   79 |                                                 dp[i][j] -= MOD:
      |                                                                ^
      |                                                                ;
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <bit>
#include <climits>

using namespace std;

int count(int n) {
    int res = 0;
    while(n) {
        res += n & 1;
        n >>= 1;
    }
    return res;
}
int main() {
    // freopen("1.txt", "r", stdin);
    int N, mod = 1e9 + 7;
    cin >> N;
    int a = 1 << N;
    int C[N][N], dp[a];
    memset(dp, 0, sizeof(dp));

    for(int i = 0; i < N; ++i)
        for(int j = 0; j < N; ++j)
            cin >> C[i][j];
    
    dp[0] = 1;
    for(int i = 1; i < a; ++i) {
        int ones = count(i);
        for(int j = 0; j < N; ++j) {
            if((i & (1 << j)) && C[ones - 1][j]) {
                dp[i] = (dp[i] + dp[i - (1 << j)]) % mod;
            }
        }
    }
    cout << dp[a - 1] << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: 'memset' was not declared in this scope
   23 |     memset(dp, 0, sizeof(dp));
      |     ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <climits>
  +++ |+#include <cstring>
    6 |
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <bit>

using namespace std;

int count(int n) {
    int res = 0;
    while(n) {
        res += n & 1;
        n >>= 1;
    }
    return res;
}
int main() {
    // freopen("1.txt", "r", stdin);
    int N, mod = 1e9 + 7;
    cin >> N;
    int a = 1 << N;
    int C[N][N], dp[a];
    memset(dp, 0, sizeof(dp));

    for(int i = 0; i < N; ++i)
        for(int j = 0; j < N; ++j)
            cin >> C[i][j];
    
    dp[0] = 1;
    for(int i = 1; i < a; ++i) {
        int ones = count(i);
        for(int j = 0; j < N; ++j) {
            if((i & (1 << j)) && C[ones - 1][j]) {
                dp[i] = (dp[i] + dp[i - (1 << j)]) % mod;
            }
        }
    }
    cout << dp[a - 1] << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:5: error: 'memset' was not declared in this scope
   22 |     memset(dp, 0, sizeof(dp));
      |     ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <cmath>
  +++ |+#include <cstring>
    4 | #include <bit>
Language: C++

#include<bits/stdc++.h>
using namespace std;
//using namespace __gnu_pbds;
//typedef tree<ii,null_type,less<ii>,rb_tree_tag,tree_order_statistics_node_update> set_t;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_front
#define SUM(v) accumulate(v.begin(),v.end(),lli(0))
#define rev(n,d) for(int i=n;i>=d;i--)
#define FOR0(n) for(int i=0;i<n;i++)
#define FOR(a,n) for(int i=a;i<n;i++)
#define FORQ(a,n) for(int i=a;i<=n;i++)
#define inf 1000000009
#define inff 0x3f3f3f3f
#define sz(a) int((a).size())
#define all(c) c.begin(), c.end()
#define ff first
#define ss second
#define endl "\n"
#define mod 1000000007
#define mem(ar,x) memset(ar,x,sizeof ar)
#define present(container, element) (container.find(element) != container.end())
#define max3(a,b,c) return (lli(a)>lli(b)?(lli(a)>lli(c)?a:c):(lli(b)>lli(c)?b:c))
#define max4(a,b,c,d) return (max3(a,b,c)>lli(d)?(max3(a,b,c)):d)
#define min3(a,b,c) return (lli(a)<lli(b)?(lli(a)<lli(c)?a:c):(lli(b)<lli(c)?b:c))
#define min4(a,b,c,d) return (max3(a,b,c)<lli(d)?(max3(a,b,c)):d)
typedef long long int lli;
typedef pair<int,int> pii;
typedef pair<int,pii>ppii;
typedef vector<int>vi;
typedef vector<vi>vvi;
typedef vector<pii>vpii;
const int N=78;
int dr8[]={0,0,1,-1,1,1,-1,-1};
int dc8[]={1,-1,0,0,-1,1,-1,1};
int dr4[]={0,1,-1,0};
int dc4[]={1,0,0,-1};
int dp[1<<22];
int main(){
	fast
	int n;
	cin>>n;
	int a[n][n];
	dp[0]=1;
	FOR0(n)
		for(int j=0;j<n;j++) cin>>a[i][j];	
	for(int i=0;i<n;i++){
		for(int mask=0;mask<(1<<n);mask++){
			for(int k=0;k<n;k++){
				if(!(mask&(1<<k))&&a[i][k]&&popcount(mask)==i){
					dp[mask^(1<<k)]=(1ll*dp[mask^(1<<k)]+dp[mask])%mod;
				}
			}
		}
	}
	cout<<dp[(1<<n)-1];
}



Compiler output:
a.cc: In function 'int main()':
a.cc:52:61: error: 'popcount' was not declared in this scope
   52 |                                 if(!(mask&(1<<k))&&a[i][k]&&popcount(mask)==i){
      |                                                             ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
#include<intrin.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
// #define __buildin_popcount __popcnt
typedef vector<int> VI;
typedef long long ll;
typedef pair<int, int> PII;
typedef double db;
// mt19937 mrand(random_device{}());
const ll mod = 1000000007;
// int rnd(int x) { return mrand() % x; }
ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1)res = res * a%mod; a = a * a%mod; }return res; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
// head
void add_self(int& a, int b) {
	a += b;
	if (a >= mod) {
		a -= mod;
	}
}
const int mxN = 21;
int n, dp[1 << mxN];
bool can[mxN][mxN];
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	cin >> n;
	rep(i, 0, n) rep(j, 0, n) cin >> can[i][j];

	dp[0] = 1;
	rep(mask, 0, (1 << n) - 1) {
		int man = __buildin_popcount(mask);
		rep(woman, 0, n) {
			if (can[man][woman] && !(mask & (1 << woman))) {
				int m2 = mask ^ (1 << woman);
				add_self(dp[m2], dp[mask]);
			}
		}
	}
	cout << dp[(1 << n) - 1] << endl;

	return 0;
}



Compiler output:
a.cc:2:9: fatal error: intrin.h: No such file or directory
    2 | #include<intrin.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>

#define ll long long
#define ff first
#define ss second
#define pb push_back

using namespace std;

const int N  = 1e6 + 69, INF = 1e9, mod = 1e9 + 7;

const ll INFLL = 1e18;

int n, K;
ll dp[405][1<<22], A[30][30], sum[405][405];

int main(){

        cin >> n;

        for(int i = 0; i < n; i++){
                for(int j = 0; j < n; j++){
                        cin >> A[i][j];
                }
        }

        for(int i = 0; i < n; i++){
                if(A[0][i] == 1){
                        dp[0][(1<<i)] = 1;
                }
        }

        for(int i = 0; i < n; i++){
                for(int mask = 0; mask < (1<<n); mask++){
                        if(!dp[i][mask]) continue;
                        for(int j = 0; j < n; j++){
                                if(mask&(1<<j) || !A[i+1][j]) continue;
                                dp[i+1][mask^(1<<j)] += dp[i][mask];
                                dp[i+1][mask^(1<<j)] %= mod;
                        }
                }
        }

        cout << dp[n-1][(1<<n)-1] << endl;

}


Compiler output:
/tmp/cc472U9L.o: in function `main':
a.cc:(.text+0x5a): relocation truncated to fit: R_X86_64_PC32 against symbol `A' defined in .bss section in /tmp/cc472U9L.o
a.cc:(.text+0xaa): relocation truncated to fit: R_X86_64_PC32 against symbol `A' defined in .bss section in /tmp/cc472U9L.o
a.cc:(.text+0x181): relocation truncated to fit: R_X86_64_PC32 against symbol `A' defined in .bss section in /tmp/cc472U9L.o
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
#include<intrin.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int, int> PII;
typedef double db;
// mt19937 mrand(random_device{}());
const ll mod = 1000000007;
// int rnd(int x) { return mrand() % x; }
ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1)res = res * a%mod; a = a * a%mod; }return res; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
// head
void add_self(int& a, int b) {
	a += b;
	if (a >= mod) {
		a -= mod;
	}
}
const int mxN = 21;
int n;
bool can[mxN][mxN];
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	cin >> n;
	rep(i, 0, n) rep(j, 0, n) cin >> can[i][j];
	VI dp(1 << n);
	dp[0] = 1;
	for (int mask = 0; mask < (1 << n) - 1; ++mask) {
		int a = __popcnt(mask);
		for (int b = 0; b < n; ++b) {
			if (can[a][b] && !(mask & (1 << b))) {
				int m2 = mask ^ (1 << b);
				add_self(dp[m2], dp[mask]);
			}
		}
	}
	cout << dp[(1 << n) - 1] << endl;
	return 0;
}



Compiler output:
a.cc:2:9: fatal error: intrin.h: No such file or directory
    2 | #include<intrin.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream> // cin, cout, cerr
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota
#include <cstdio> // printf, scanf
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <iomanip> // cout<<setprecision(n)
#include <functional> // function<void(int)>
#include <cmath>

#ifdef DEBUG
#include "debug.hpp"
#else
#define debug(...)
#endif

#define int long long // at least int64 > 9*10^18
#define ENDL '\n'
#define rep(i,n) for(int i = 0; i < (n); i++)
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
/* libraries */

constexpr int MOD = 1e9+7;
struct mint
{
	int v;
	mint():v(0){}
	mint(int v):v((v+MOD)%MOD){}
	mint operator-()const{ return mint(0) - *this; }
	mint& operator+=(const mint& a){ if((v+=a.v)>=MOD) v-=MOD; return *this; }
	mint& operator-=(const mint& a){ if((v+=MOD-a.v)>=MOD) v-=MOD; return *this; }
	mint& operator*=(const mint& a){ (v*=a.v)%=MOD; return *this; }
	mint& operator/=(const mint& a){ (*this) *= a.inv(); return *this; }
	mint operator+(const mint& a)const{ return mint(*this) += a; }
	mint operator-(const mint& a)const{ return mint(*this) -= a; }
	mint operator*(const mint& a)const{ return mint(*this) *= a; }
	mint operator/(const mint& a)const{ return mint(*this) /= a; }
	bool operator<(const mint& a)const{ return v < a.v; }
	bool operator==(const mint& a)const{ return v == a.v; }
	mint pow(int k)const{ mint r(1),t(v); while(k){ if(k&1) r*=t; t*=t; k>>=1; } return r; }
	mint inv()const{ return pow(MOD-2); }
	static mint comb(int n, int k) {
		if(n-k<k) k=n-k;
		mint num(1), dom(1);
		for(int i=0;i<k;i++) { num*=n-i; dom*=i+1; }
		return num/dom;
	}
};
std::istream& operator>>(std::istream&i,mint&a){ int t; i>>t; a=mint(t); return i; }
std::ostream& operator<<(std::ostream&o,const mint&a){ o<<a.v; return o; }

int powz(int v,int k) { int r(1),t(v); while(k){ if(k&1) r*=t; t*=t; k>>=1; } return r; }

signed main() {
	int n;
	std::cin >> n;
	std::vector<std::vector<int> > a(n,std::vector<int>(n));
	rep(i,n) rep(j,n) std::cin >> a[i][j];
	std::vector<std::vector<mint> > dp(n+1, std::vector<mint>(powz(2,n),0));
	dp[0][0]=1;
	rep(i,n) {
		rep(j,powz(2,n)) {
			if(dp[i][j]!=mint(0)) {
				rep(k,n) {
					if(a[i][k] && !(j&(1<<k))) {
						dp[i+1][j|(1<<k)] += dp[i][j];
					}
				}
			}
		}
	}
	print(dp[n][(1<<n)-1]);

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:68:36: error: no match for 'operator!=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<mint>, mint>::value_type' {aka 'mint'} and 'mint')
   68 |                         if(dp[i][j]!=mint(0)) {
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
int n;
int a[21];
int cnt[(1<<21)];
int dp[(1<<21)];
void builtin_popcount(){
	for(int i=1;i<(1<<21);++i){
		cnt[i]=cnt[i&(i-1)]+1;
	}
}
int main(){
	builtin_popcount();
	cin>>n;
	for(int i=0;i<n;++i){
		for(int j=0;j<n;++j){
			int x;
			cin>>x;
			a[i]|=(x<<j);
		}
	}
	int N=(1<<21)-1;
	for(int i=0;i<n;++i){
		for(int j=0;j<(1<<n);++j){
			if(cnt[j]!=i){
				continue;
			}
			int k=(j^m)&a[i];
			for(int l=k;l;l&=(l-1)){
				int now=l&(-l);
				dp[j|now]+=dp[j];
				if(dp[j|now]>mod){
					dp[j|now]-=mod;
				}
			}
		}
	}
	cout<<dp[N]<<'\n';
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:34: error: 'm' was not declared in this scope
   29 |                         int k=(j^m)&a[i];
      |                                  ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#define mod (int(1e9)+7)
using namespace std;

long long a[22][22],b[22][1<<22]={};
int N;

long long f(int n,int m)//已配n人,m為被配的↓←
{
	if(b[n][m]!=0)return b[n][m];
	if(n==N)return 1;
	long long tmp=0;
	for(int i=0;i<N;++i)
	{
		if(a[n][i]&&((m>>i)&1)==0)
			tmp=(tmp+f(n+1,m+(1<<i)))%mod;
	}
	return b[n][m]=tmp;
}

void main()
{
	cin>>N;
	for(int i=0;i<N;++i)
		for(int j=0;j<N;++j)
			cin>>a[i][j];
	cout<<f(0,0);
}

Compiler output:
a.cc:23:1: error: '::main' must return 'int'
   23 | void main()
      | ^~~~