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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;

const int maxn = 22;
ModInt dp[maxn][1<<maxn];
bool done[maxn][1<<maxn];

int n;
int a[maxn][maxn];

/* 
状態：今注目している男性・その時点でどの女性がマッチ済みかを表すビット集合。
*/
ModInt dfs(int i, int s) {
    if (i == n) return (s == (1<<n) - 1) ? 1 : 0;
    if (done[i][s]) return dp[i][s];
    for(int j = 0; j < n; j++) {
        if (a[i][j] == 0 || s & (1 << j)) continue;
        dp[i][s] += dfs(i + 1, s | (1 << j));
    }
    done[i][s] = true;
    return dp[i][s];
}

int main() {
    cin >> n;
    rep(i, n) {
        rep(j, n) {
            cin >> a[i][j];
        }
    }
    ModInt c = dfs(0, 0);
    cout << c << endl;
    return 0;
}


Compiler output:
a.cc:7:1: error: 'ModInt' does not name a type
    7 | ModInt dp[maxn][1<<maxn];
      | ^~~~~~
a.cc:16:1: error: 'ModInt' does not name a type
   16 | ModInt dfs(int i, int s) {
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:34:5: error: 'ModInt' was not declared in this scope
   34 |     ModInt c = dfs(0, 0);
      |     ^~~~~~
a.cc:35:13: error: 'c' was not declared in this scope
   35 |     cout << c << endl;
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int const mod=1e9+7
void add_self(int &a,int &b){
  a+=b;
  if(a>=mod)
    a-=mod;
}
int main(){
  int n;
  cin>>n;
  vector<vector<int>>v(n,vector<int>(n));
 for(int i=0;i<n;i++)
   for(int j=0;j<n;j++)
     cin>>v[i][j];
  
  vector<int>dp(1<<n);
  dp[0]=1;
 // for(int a=0;a<n;a++)
    for(int mask = 0;mask < (1<<n) - 1; mask++)
    { int a=__builtin_popcount(mask);
      for(int b=0;b<n;++b)
      { if(v[a][b] && !(mask&(1<<b)))
        { int m2= mask ^ (1<<b);
          add_self(dp[m2],dp[mask]);}
      }
    }
  
  printf("%d\n",dp[(1<<n)-1]);
}

Compiler output:
a.cc:4:1: error: expected ',' or ';' before 'void'
    4 | void add_self(int &a,int &b){
      | ^~~~
a.cc: In function 'int main()':
a.cc:25:11: error: 'add_self' was not declared in this scope
   25 |           add_self(dp[m2],dp[mask]);}
      |           ^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int const mod=1e9+7
void add_self(int &a,int &b){
  a+=b;
  if(a>=mod)
    a-=mod;
}
int main(){
  int n;
  cin>>n;
  vector<vector<int>>v(n,vector<int>(n));
 for(int i=0;i<n;i++)
   for(int j=0;j<n;j++)
     cin>>v[i][j];
  
  vector<int>dp(1<<n);
  dp[0]=1;
 // for(int a=0;a<n;a++)
    for(int mask = 0;mask < (1<<n) - 1; mask++)
    { int a=__builtin_popcount(mask);
      for(int b=0;b<n;++b)
      { if(v[a][b] && !(mask &&(1<<b)))
        { int m2= mask ^ (1<<b);
          add_self(dp[m2],dp[mask]);}
      }
    }
  
  printf("%d\n",dp[(1<<n)-1]);
}

Compiler output:
a.cc:4:1: error: expected ',' or ';' before 'void'
    4 | void add_self(int &a,int &b){
      | ^~~~
a.cc: In function 'int main()':
a.cc:25:11: error: 'add_self' was not declared in this scope
   25 |           add_self(dp[m2],dp[mask]);}
      |           ^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int const mod=1e9+7
void add_self(int &a,int &b){
  a+=b;
  if(a>=mod)
    a-=mod;
}
int main(){
  int n;
  cin>>n;
  vector<vector<int>>v(n,vector<int>(n));
 for(int i=0;i<n;i++)
   for(int j=0;j<m;j++)
     cin>>v[i][j];
  
  vector<int>dp(1<<n);
  dp[0]=1;
 // for(int a=0;a<n;a++)
    for(int mask = 0;mask < (1<<n) - 1; mask++)
    { int a=__builtin_popcount(mask);
      for(int b=0;b<n;++b)
      { if(v[a][b] && !(mask &&(1<<b)))
        { int m2= mask ^ (1<<b);
          add_self(dp[m2],dp[mask]);}
      }
    }
  
  printf("%d\n",dp[(1<<n)-1]);
}

Compiler output:
a.cc:4:1: error: expected ',' or ';' before 'void'
    4 | void add_self(int &a,int &b){
      | ^~~~
a.cc: In function 'int main()':
a.cc:14:18: error: 'm' was not declared in this scope
   14 |    for(int j=0;j<m;j++)
      |                  ^
a.cc:25:11: error: 'add_self' was not declared in this scope
   25 |           add_self(dp[m2],dp[mask]);}
      |           ^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
void add_self(int &a,int &b){
  a+=b;
  if(a>=mod)
    a-=mod;
}
int main(){
  int n;
  cin>>n;
  vector<vector<int>>v(n,vector<int>(n));
 for(int i=0;i<n;i++)
   for(int j=0;j<m;j++)
     cin>>v[i][j];
  
  vector<int>dp(1<<n);
  dp[0]=1;
 // for(int a=0;a<n;a++)
    for(int mask = 0;mask < (1<<n) - 1; mask++)
      int a=__builtin_popcount(mask);
      for(int b=0;b<n;++b)
        if(v[a][b] && !(mask &&(1<<b)))
          int m2= mask ^ (1<<b);
          add_self(dp[m2],dp[mask]);
  
  printf("%d\n",dp[(1<<n)-1]);
}

Compiler output:
a.cc: In function 'void add_self(int&, int&)':
a.cc:5:9: error: 'mod' was not declared in this scope; did you mean 'modf'?
    5 |   if(a>=mod)
      |         ^~~
      |         modf
a.cc: In function 'int main()':
a.cc:13:18: error: 'm' was not declared in this scope
   13 |    for(int j=0;j<m;j++)
      |                  ^
a.cc:22:14: error: 'a' was not declared in this scope
   22 |         if(v[a][b] && !(mask &&(1<<b)))
      |              ^
a.cc:22:25: error: 'mask' was not declared in this scope; did you mean 'std::filesystem::perms::mask'?
   22 |         if(v[a][b] && !(mask &&(1<<b)))
      |                         ^~~~
      |                         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:24:23: error: 'm2' was not declared in this scope
   24 |           add_self(dp[m2],dp[mask]);
      |                       ^~
a.cc:24:30: error: 'mask' was not declared in this scope; did you mean 'std::filesystem::perms::mask'?
   24 |           add_self(dp[m2],dp[mask]);
      |                              ^~~~
      |                              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: C++

#include<bits/stdc++.h>
using namespace std;
void add_self(int &a,int &b){
  a+=b;
  if(a>=mod)
    a-=mod;
}
int main(){
  int n;
  cin>>n;
  vector<vector<int>>v(n,vector<int>(n));
 for(int i=0;i<n;i++)
   for(int j=0;j<m;j++)
     cin>>v[i][j];
  
  vector<int>dp(1<<n);
  dp[0]=1;
  for(int a=0;a<n;a++)
    for(int mask=0;mask<(1<<n);mask++)
      for(int b=0;b<n;++b)
        if(v[a][b] && (mask &&(1<<b)))
          int m2=mask^(1<<b);
          add_self(dp[m2],dp[mask]);
  
  printf("\n",dp[(1<<n)-1]);
}

Compiler output:
a.cc: In function 'void add_self(int&, int&)':
a.cc:5:9: error: 'mod' was not declared in this scope; did you mean 'modf'?
    5 |   if(a>=mod)
      |         ^~~
      |         modf
a.cc: In function 'int main()':
a.cc:13:18: error: 'm' was not declared in this scope
   13 |    for(int j=0;j<m;j++)
      |                  ^
a.cc:23:23: error: 'm2' was not declared in this scope
   23 |           add_self(dp[m2],dp[mask]);
      |                       ^~
a.cc:23:30: error: 'mask' was not declared in this scope; did you mean 'std::filesystem::perms::mask'?
   23 |           add_self(dp[m2],dp[mask]);
      |                              ^~~~
      |                              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,
      |       ^~~~
Language: C++

#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace __gnu_pbds;
using namespace std;
#define int long long
//for set
// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;   
// for multiset
typedef tree<
pair<int, int>,
null_type,
less<pair<int, int>>,
rb_tree_tag,
tree_order_statistics_node_update> ordered_multiset;


#define ff first
#define ss second
#define endl "\n"
#define all(x) (x).begin(), (x).end()
// #define PI 3.1415926535897932384626433832795
#define PI acos(-1.0)
int MOD=1e9+7;
int powmod(int a,int l, int md){int res=1;while(l){if(l&1)res=res*a%md;l/=2;a=a*a%md;}return res;}
typedef long long ll; typedef vector<ll> vi; typedef pair<ll, ll> ii; typedef vector<ii> vii;
#define pb push_back
int __set(int b, int i) {return b|(1<<i);} //set ith bit
// int __unset(int b, int i) {return b&(!(1<<i));}
int __unset(int b, int i) {return b&(~(1UL<<i));}
int __check(int b, int i) {return b&(1<<i);} //returns 0 if ith bit is 0
int mul(int a, int b) {return ((a%MOD)*(b%MOD))%MOD;}
int add(int a, int b) {return (a+b)%MOD;}
int sub(int a, int b) {return (((a-b)%MOD)+MOD)%MOD;}
int __div(int a, int b) {return mul(a, powmod(b, MOD-2, MOD));} //if MOD is prime;
const ll inf = 0xFFFFFFFFFFFFFFFL; //very large number
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>> > pq; //for min priority_queue
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
clock_t time_p=clock();
void time()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}

// map<char, int> m;
// bool cmp(char a, char b) {
// 	return m[a]<m[b];
// }
int mod = 1000000007;
const int N=21;
int dp[N][(1<<N)];
int32_t main(void)
{
	IOS;
	int n; cin>>n;
	int mat[n][n];
	for(int i = 0; i < n; i++) {
		for(int j = 0; j < n; j++)
			cin>>mat[i][j];
	}
	for(int i = 0; i < (1<<n); i++) {
		for(int j = 0; j < n; j++) {
			if(__check(i, j) && mat[0][j] && __builtin_popcount(i)==1) {
				dp[0][i]=1;
		}
	}
	for(int i = 1; i < n; i++) {
		for(int j = 0; j < (1<<n); j++) {
			if(__builtin_popcount(j)!=i+1) continue;
			for(int k = 0; k < n; k++) {
				if(mat[i][k] && __check(j,k))
					dp[i][j] = (dp[i][j]+dp[i-1][__unset(j,k)])%mod;
			}
		}
	}
	cout<<dp[n-1][(1<<n)-1]<<endl;
   	time();
	return 0;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:81:2: error: expected '}' at end of input
   81 | }
      |  ^
a.cc:55:1: note: to match this '{'
   55 | {
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <iostream>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <list>
#include <stack>
#include <climits>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <stdio.h>
#define m7 1000000007
#define m9 1000000009
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define F first
#define S second

using namespace std;
int dp[1 << 22 + 1][21], allmask, X[21][21];
int n;

int solve(int mask,int pre_man) {
	if (mask == allmask) 
		return 1;
	if (pre_man == n || mask > allmask)
		return 0;
	if (dp[mask][pre_man] != -1) return dp[mask][pre_man];
	
	dp[mask][pre_man] = 0;
	
	for (int i = 0; i < n; i++) {
		if (X[pre_man][i] && !(mask & (1<<i)) ) {
			dp[mask][pre_man] = (dp[mask][pre_man] + solve( mask | (1 << i) ,pre_man + 1) ) % m7;
		}
	}
	//cout << mask << ' ' << pre_man <<' '<< dp[mask][pre_man] << endl;
	return dp[mask][pre_man];
}
int main()
{
	memset(dp, -1, sizeof dp);
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
			cin >> X[i][j];
	}
	allmask = (1 << n) - 1;
	cout<<solve(0, 0);

	

	return 0;
}

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:14:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   13 | #include <iomanip>
  +++ |+#include <cstring>
   14 | #include <stdio.h>
Language: C++

#include <iostream>
#include <vector>
#include <iostream>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <list>
#include <stack>
#include <climits>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#define m7 1000000007
#define m9 1000000009
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define F first
#define S second

using namespace std;
int dp[1 << 22 + 1][21], allmask, X[21][21];
int n;

int solve(int mask,int pre_man) {
	if (mask == allmask) 
		return 1;
	if (pre_man == n || mask > allmask)
		return 0;
	if (dp[mask][pre_man] != -1) return dp[mask][pre_man];
	
	dp[mask][pre_man] = 0;
	
	for (int i = 0; i < n; i++) {
		if (X[pre_man][i] && !(mask & (1<<i)) ) {
			dp[mask][pre_man] = (dp[mask][pre_man] + solve( mask | (1 << i) ,pre_man + 1) ) % m7;
		}
	}
	//cout << mask << ' ' << pre_man <<' '<< dp[mask][pre_man] << endl;
	return dp[mask][pre_man];
}
int main()
{
	memset(dp, -1, sizeof dp);
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
			cin >> X[i][j];
	}
	allmask = (1 << n) - 1;
	cout<<solve(0, 0);

	

	return 0;
}

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

#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <limits>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include "math.h"
#include "assert.h"

using namespace std;

int inf = std::numeric_limits<int>().max();

#define BUFF ios::sync_with_stdio(false)
#define epsilon 1e-07
#define pi 2 * acos(0.0);
#define mod 1000000007   // 1e9+7
#define ll long long
#define cerr if(false)cerr
#define watch(x) cerr << #x << " = " << x << endl;

int main() {

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

	vector<int> dp( 1<<n, 0);
	for(int s=1; s < 1<<n; s++) {
		bitset<30> b = s;
		int w = b.count() - 1;
		for(int k=0; k < n; k++) {

			if ((s & (1 << k))) {  

				int sl = s - (1 << k);

				if (cp[w][k]) {
					if (w == 0) dp[s] = 1;
					else {
						dp[s] += dp[sl];
						dp[s] %= mod;
					}

				}

				//bitset<10> b = s;
				//cout << " f(" << b << "->  " << w << "--" << k << ") " << dp[s] << endl;

			}
		}
	}

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

}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:17: error: 'bitset' was not declared in this scope
   41 |                 bitset<30> b = s;
      |                 ^~~~~~
a.cc:15:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
   14 | #include "assert.h"
  +++ |+#include <bitset>
   15 | 
a.cc:41:28: error: 'b' was not declared in this scope
   41 |                 bitset<30> b = s;
      |                            ^
Language: C++

#include <bits/stdc++.h>
#include <future>

using namespace std;

#define __builtin_popcount __popcnt

int dp[21][(1 << 21)];
int can[21][21];
int n;

int main()
{
	 cin >> n;

	for (auto i = 0; i < n; i++)
		for (auto j = 0; j < n; j++)
			cin >> can[i][j];

	for (auto i = 0; i < n; i++)
		dp[0][1 << i] = can[0][i];

		for (auto mask = 1; mask < (1 << n); mask++)
		{
			auto i = __builtin_popcount(mask);
			if (i == 1) continue;
			for (auto j = 0; j < n; j++)
				if (can[i-1][j] && (mask & (1 << j))) {
					dp[i-1][mask] += dp[i - 2][mask ^ (1 << j)];
					dp[i-1][mask] %= (int)(1e9 + 7);
				}
		}
			

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

}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:28: error: '__popcnt' was not declared in this scope
    6 | #define __builtin_popcount __popcnt
      |                            ^~~~~~~~
a.cc:25:34: note: in expansion of macro '__builtin_popcount'
   25 |                         auto i = __builtin_popcount(mask);
      |                                  ^~~~~~~~~~~~~~~~~~
Language: C

#include <stdio>

int dp[21][(1 << 21)];
int can[21][21];

int main()
{
	int n; cin >> n;

	for (auto i = 0; i < n; i++)
		for (auto j = 0; j < n; j++)
			scanf("%d", &can[i][j]);

	for (auto i = 0; i < n; i++)
		dp[0][1 << i] = can[0][i];

	for (auto i = 1; i < n; i++)
		for (auto mask = 1; mask < (1 << n); mask++)
			for (auto j = 0; j < n; j++)
				if (can[i][j] && (mask & (1 << j))) {
					dp[i][mask] += dp[i - 1][mask ^ (1 << j)];
					dp[i][mask] %= (int)(1e9 + 7);
				}

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


Compiler output:
main.c:1:10: fatal error: stdio: No such file or directory
    1 | #include <stdio>
      |          ^~~~~~~
compilation terminated.
Language: C++


#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define c(P)        cout<<P<<"\n"
#define dbg(P)      cout<<P<<" "
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define F           first
#define S           second
#define mem(a,val)  memset(a,val,sizeof(a))
#define fr(i,x,n)   for(ll i=x;i<n;i++)
#define frr(i,x,n)  for(ll i=n-1;i>=x;i--)


const ll N   =  22;
const ll mod = 1e9 + 7;

using namespace std;
  ll dp[(1<<N)][N],n;
  std::vector<ll> v[22];
fun(ll mask,ll id)
{

  if(mask==((1<<n)-1))
    return 1;
  if(id>=n)
    return 0;
  if(dp[mask][id]!=-1)
    return dp[mask][id];
  ll ans = fun(mask,id+1);
  for(auto it : v[id])
  {
    if((mask & (1<<it))==0)
    {
      ans += fun((mask | (1<<it)) , id + 1);
    if(ans>=mod)
      ans -=mod;
    }
  }
return dp[mask][id] = ans;
}
void solve()
{
// string s;
  ll x;
  cin>>n;
  fr(i,0,(1<<N))fr(j,0,N)dp[i][j] = -1;
  for (ll i = 0; i < n; ++i)
  {
    fr(j,0,n)
    {
  cin>>x;
  if(x==1)
  v[i].pb(j);
    }
  }
  c(fun(0,0));
}

signed main(){
     
      ios_base::sync_with_stdio(false);   
      cin.tie(NULL);
      ll T=1;
      //cin>>T;
      while(T--)
      {
      solve();
      }
      return 0;
    }


Compiler output:
a.cc:23:1: error: ISO C++ forbids declaration of 'fun' with no type [-fpermissive]
   23 | fun(ll mask,ll id)
      | ^~~
Language: C++


#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define c(P)        cout<<P<<"\n"
#define dbg(P)      cout<<P<<" "
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define F           first
#define S           second
#define mem(a,val)  memset(a,val,sizeof(a))
#define fr(i,x,n)   for(ll i=x;i<n;i++)
#define frr(i,x,n)  for(ll i=n-1;i>=x;i--)


const ll N   =  22;
const ll mod = 1e9 + 7;

using namespace std;
  ll dp[(1<<N)][N],n;
  std::vector<ll> v[22];
f(ll mask,ll id)
{

  if(mask==((1<<n)-1))
    return 1;
  if(id>=n)
    return 0;
  if(dp[mask][id]!=-1)
    return dp[mask][id];
  ll ans = f(mask,id+1);
  for(auto it : v[id])
  {
    if((mask & (1<<it))==0)
    {
      ans += f((mask | (1<<it)) , id + 1);
    if(ans>=mod)
      ans -=mod;
    }
  }
return dp[mask][id] = ans;
}
void solve()
{
// string s;
  ll x;
  cin>>n;
  fr(i,0,(1<<N))fr(j,0,N)dp[i][j] = -1;
  for (ll i = 0; i < n; ++i)
  {
    fr(j,0,n)
    {
  cin>>x;
  if(x==1)
  v[i].pb(j);
    }
  }
  c(f(0,0));
}

signed main(){
     
      ios_base::sync_with_stdio(false);   
      cin.tie(NULL);
      ll T=1;
      //cin>>T;
      while(T--)
      {
      solve();
      }
      return 0;
    }


Compiler output:
a.cc:23:1: error: ISO C++ forbids declaration of 'f' with no type [-fpermissive]
   23 | f(ll mask,ll id)
      | ^
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Matching {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int count = Integer.valueOf(reader.readLine());

        boolean[][] compatible = new boolean[count][count];

        for (int i = 0; i < count; ++i) {
            ArrayList<Integer> current = new ArrayList<>();
            String[] parts = reader.readLine().split(" ");
            for (int j = 0; j < count; ++j) {
                if (Integer.valueOf(parts[j]) == 1) {
                    compatible[i][j] = true;
                }
            }
        }
        long modulo = 1_000_000_007;

        int combinations = 1 << count;
        long[][] dp = new long[count + 1][combinations];
        dp[0][0] = 1;
        for (int i = 0; i < count; ++i) {
            for (int j = 0; j < count; ++j) {
                if (compatible[i][j]) {
                    for (int c = 0; c < combinations; ++c) {
                        if ((c & (1 << j)) != 0) {
                            dp[i + 1][c] += dp[i][c & ~(1 << j)];
                            dp[i + 1][c] %= modulo;
                        }
                    }
                }
            }
        }

        long res = 0;
        for (int c = 0; c < combinations; ++c) {
            res += dp[count][c];
            res %= modulo;
        }
        System.out.println(res);
    }
}


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

4
0 1 0 0
0 0 0 1
1 0 0 0
0 0 1 0


#~~ 1


3
0 1 1
1 0 1
1 1 1


#~~ 3


1
0


#~~ 0


21
0 0 0 0 0 0 0 1 1 0 1 1 1 1 0 0 0 1 0 0 1
1 1 1 0 0 1 0 0 0 1 0 0 0 0 1 1 1 0 1 1 0
0 0 1 1 1 1 0 1 1 0 0 1 0 0 1 1 0 0 0 1 1
0 1 1 0 1 1 0 1 0 1 0 0 1 0 0 0 0 0 1 1 0
1 1 0 0 1 0 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0
0 1 1 0 1 1 1 0 1 1 1 0 0 0 1 1 1 1 0 0 1
0 1 0 0 0 1 0 1 0 0 0 1 1 1 0 0 1 1 0 1 0
0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 1 1 1 1 1 1
0 0 1 0 0 1 0 0 1 0 1 1 0 0 1 0 1 0 1 1 1
0 0 0 0 1 1 0 0 1 1 1 0 0 0 0 1 1 0 0 0 1
0 1 1 0 1 1 0 0 1 1 0 0 0 1 1 1 1 0 1 1 0
0 0 1 0 0 1 1 1 1 0 1 1 0 1 1 1 0 0 0 0 1
0 1 1 0 0 1 1 1 1 0 0 0 1 0 1 1 0 1 0 1 1
1 1 1 1 1 0 0 0 0 1 0 0 1 1 0 1 1 1 0 0 1
0 0 0 1 1 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1
1 0 1 1 0 1 0 1 0 0 1 0 0 1 1 0 1 0 1 1 0
0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 1 0 0 1
0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 0 0 1 1 0 1
0 0 0 0 1 1 1 0 1 0 1 1 1 0 1 1 0 0 1 1 0
1 1 0 1 1 0 0 1 1 0 1 1 0 1 1 1 1 1 0 1 0
1 0 0 1 1 0 1 1 1 1 1 0 1 0 1 1 0 0 0 0 0


#~~ 102515160


3
0 1 1
1 0 1
1 1 1


#~~ 3


4
0 1 0 0
0 0 0 1
1 0 0 0
0 0 1 0


#~~ 1


1
0


#~~ 0


21
0 0 0 0 0 0 0 1 1 0 1 1 1 1 0 0 0 1 0 0 1
1 1 1 0 0 1 0 0 0 1 0 0 0 0 1 1 1 0 1 1 0
0 0 1 1 1 1 0 1 1 0 0 1 0 0 1 1 0 0 0 1 1
0 1 1 0 1 1 0 1 0 1 0 0 1 0 0 0 0 0 1 1 0
1 1 0 0 1 0 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0
0 1 1 0 1 1 1 0 1 1 1 0 0 0 1 1 1 1 0 0 1
0 1 0 0 0 1 0 1 0 0 0 1 1 1 0 0 1 1 0 1 0
0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 1 1 1 1 1 1
0 0 1 0 0 1 0 0 1 0 1 1 0 0 1 0 1 0 1 1 1
0 0 0 0 1 1 0 0 1 1 1 0 0 0 0 1 1 0 0 0 1
0 1 1 0 1 1 0 0 1 1 0 0 0 1 1 1 1 0 1 1 0
0 0 1 0 0 1 1 1 1 0 1 1 0 1 1 1 0 0 0 0 1
0 1 1 0 0 1 1 1 1 0 0 0 1 0 1 1 0 1 0 1 1
1 1 1 1 1 0 0 0 0 1 0 0 1 1 0 1 1 1 0 0 1
0 0 0 1 1 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1
1 0 1 1 0 1 0 1 0 0 1 0 0 1 1 0 1 0 1 1 0
0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 1 0 0 1
0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 0 0 1 1 0 1
0 0 0 0 1 1 1 0 1 0 1 1 1 0 1 1 0 0 1 1 0
1 1 0 1 1 0 0 1 1 0 1 1 0 1 1 1 1 1 0 1 0
1 0 0 1 1 0 1 1 1 1 1 0 1 0 1 1 0 0 0 0 0


#~~ 102515160


Compiler output:
a.cc:8:2: error: invalid preprocessing directive #~
    8 | #~~ 1
      |  ^
a.cc:17:2: error: invalid preprocessing directive #~
   17 | #~~ 3
      |  ^
a.cc:24:2: error: invalid preprocessing directive #~
   24 | #~~ 0
      |  ^
a.cc:51:2: error: invalid preprocessing directive #~
   51 | #~~ 102515160
      |  ^
a.cc:60:2: error: invalid preprocessing directive #~
   60 | #~~ 3
      |  ^
a.cc:70:2: error: invalid preprocessing directive #~
   70 | #~~ 1
      |  ^
a.cc:77:2: error: invalid preprocessing directive #~
   77 | #~~ 0
      |  ^
a.cc:104:2: error: invalid preprocessing directive #~
  104 | #~~ 102515160
      |  ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 4
      | ^
Language: C++

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

const int N(30);
const int mod(1e9 + 7);

int n, m, ans;
int match[N][N];
int f[N][1<<N];
//f[i][j] - the number of ways that first i men matches women and i's men matches j's women
void add_self(int &a, int b)
{
	a += b;
	if (a >= mod) a -= mod;
}
int main()
{
	cin>>n;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			cin>>match[i][j];
		}
	}
	f[0][0] = 1;
	for (int women = 0; women < (1 << n); women++)
	{
		int a =0// __builtin_popcount(women);
		for (int b = 0; b < n; b++)
		{
			if (match[a][b] && (((women >> b) & 1) == 0))
			{
				int now = women ^ (1 << b);
				add_self(f[a + 1][now], f[a][women]);
			}		
		}
	}
/*	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= 1<<n; j++)
		{
			printf("%d ", f[i][j]);
		}
		printf("\n");
	}*/
	printf("%d\n", f[n][(1 << n) - 1]);
	return 0;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:17: error: expected ',' or ';' before 'for'
   31 |                 for (int b = 0; b < n; b++)
      |                 ^~~
a.cc:31:33: error: 'b' was not declared in this scope
   31 |                 for (int b = 0; b < n; b++)
      |                                 ^
Language: C++

//https://atcoder.jp/contests/dp/tasks/dp_o
#include <bits/stdc++.h>
#define ALL(e) e.begin(), e.end()
#define RALL(e) e.rbegin(), e.rend()
#define mp(a, b) make_pair(a, b)
#define pb push_back
#define dbg(x) (cerr << #x << ":" << x)
#define mid (l + r) / 2
#define fi first
#define sc second
#define N 1000000009
#define mod 1e9 + 7

using namespace std;

typedef long long int lli;

int main(){
	ios::sync_with_stdio(0);
	int n; cin >> n;

	vector <vector <int>> ar(n+1, vector <int>(n+1, 0));

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

	lli mask = 1 << n;
	vector <lli> dp(mask+5, 0);

	dp[0] = 1;

	for(int i=0; i<mask; i++){
		int a = __builtin_popcount(i);
		//cerr << a << endl;
		for(int j=0; j<n; j++){
			if(ar[a][j] and !(i & (1 << j))){
				cerr << a << " " << j << endl; 
				dp[i | (1 << j)] += (dp[i] % mod);
			}
		}
	}

	cout << dp[mask-1] % mod << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:60: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} and 'double' to binary 'operator%'
   39 |                                 dp[i | (1 << j)] += (dp[i] % mod);
a.cc:44:28: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} and 'double' to binary 'operator%'
   44 |         cout << dp[mask-1] % mod << endl;
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int mod = 1e9+7;
void add_self(int &a,int b){
  a += b;
  if(a >= mod)a -= mod;
}
bool can[24][24];
int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;++i){
    for(int j=0;j<n;++j){
      cin>>can[i][j];
    }
  }
  vector<int> dp(1<<n);
  dp[0] = 1;
  for(int mask=0;mask<(1<<n);++mask){
    int a = __builtin_popcount(mask);
    for(int b=0;b<n;++b){
      if(can[a][b] && !(mask&(1<<b))){
        int m2 = mask ^ (1<<j);
        add_self(dp[m2] ,dp[mask]);
      }
    }
  }
  cout<<(dp[1<<n-1])<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:29: error: 'j' was not declared in this scope
   23 |         int m2 = mask ^ (1<<j);
      |                             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int mod = 1e9+7;
void add_self(int &a,int b){
  a += b;
  if(a >= mod)a -= mod;
}
bool can[24][24];
int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;++i){
    for(int j=0;j<n;++j){
      cin>>can[i][j];
    }
  }
  vector<int> dp(1<<n);
  dp[0] = 1;
  for(int mask=0;mask<(1<<n);++mask){
    int a = __builtin_popcount(mask);
    for(int b=0;b<n;++b){
      if(can[a][b] && !(mask&(1<<j))){
        int m2 = mask ^ (1<<j);
        add_self(dp[m2] ,dp[mask]);
      }
    }
  }
  cout<<(dp[1<<n-1])<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:34: error: 'j' was not declared in this scope
   22 |       if(can[a][b] && !(mask&(1<<j))){
      |                                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int mod = 1e9+7;
void add_self(int &a,int b){
  a += b;
  if(a >= mod)a -= mod;
}
bool can[24][24];
int main(){
  int n;
  scanf("%d",&n);
  for(int i=0;i<n;++i){
    for(int j=0;j<n;++j){
      cin>>can[i][j];
    }
  }
  vector<int> dp(1<<n);
  dp[0] = 1;
  for(int mask=0;mask<(1<<n);++mask){
    int a = __builtin_popcount(mask);
    for(int b=0;b<n;++b){
      if(can[a][b] && !(mask&(1<<j))){
        int m2 = mask ^ (1<<j);
        add_self(dp[m2] ,dp[mask]);
      }
    }
  }
  cout<<(dp[1<<n-1])<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:34: error: 'j' was not declared in this scope
   22 |       if(can[a][b] && !(mask&(1<<j))){
      |                                  ^
Language: C++

#include <bits/stdc++.h>
 
#define ff first
#define ss second
#define mp make_pair
 
using namespace std;
 
typedef long long ll;
 
const int MOD = 1e9+7;
int n, dp[21][(1<<21)+1], v[22][22];
bool mark[21][(1<<21)+1];

int f(int man, int mask) {
  if(mask == (1<<n)-1) return 1;
  if(mark[man][mask]) return dp[man][mask];
  mark[man][mask] = true;
  
  int ret = 0;
  for(int i = 0; i < n; i++) {
	if(mask&(1<<i)) continue;
    ret += f(man+1, mask | (1<<i));
    if(ret >= MOD) ret -= MOD;
  }
  
  return dp[man][mask] = ret;
}

int main() {
	scanf("%d", &n);
  	
  	for(int i = 0; i < n; i++)
      for(int j = 0; j < n; j++)
      	scanf("%d", &v[i][j]);
 
	printf("%d\n", f(0));
	
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:25: error: too few arguments to function 'int f(int, int)'
   37 |         printf("%d\n", f(0));
      |                        ~^~~
a.cc:15:5: note: declared here
   15 | int f(int man, int mask) {
      |     ^
Language: C++

#include <bits/stdc++.h>
 
#define ff first
#define ss second
#define mp make_pair
 
using namespace std;
 
typedef long long ll;
 
const int MOD = 1e9+7;
int n, dp[(1<<21)+1];
bool mark[(1<<21)+1];

int f(int mask) {
  if(mask == (1<<n)-1) return 1;
  if(mark[mask]) return dp[mask];
  mark[mask] = true;
  
  int ret = 0;
  for(int i = 0; i < n; i++) {
	if(mask&(1<<i)) continue;
    for(int j = 0; j < n; j++) {
      if(mask&(1<<j)) continue;
      ret += f(mask | (1<<i) | (1<<j));
      if(ret >= MOD) ret -= MOD;
  	}
  }
  
  return dp[mask] = ret;
}

int main() {
	scanf("%d", &n);
  	
  	for(int i = 0; i < n; i++)
      for(int j = 0; j < n; j++)
      	scanf("%d", &mat[i][j];
 
	printf("%d\n", f(0));
	
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:22: error: 'mat' was not declared in this scope
   38 |         scanf("%d", &mat[i][j];
      |                      ^~~
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
 
#define MAXN 21
#define MOD 1000000007
 
int N;
long long dp[MAXN][1<<MAXN];
int m[MAXN][MAXN];
 
int d(int i, int j) {
	if (dp[i][j] != -1) return dp[i][j];
  
  	dp[i][j] = 0;
  
  	for (int k = 0; k < N; k++) {
      if (m[i][k] == 1 && (j&(1<<k))) {
        dp[i][j] = (dp[i][j] + dp[i-1][j^(1<<k)])%MOD;
      }
    }
  
  return dp[i][j];
}
 
int main() {
	cin >> N;
  	for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        cin >> m[i][j];
      }
    }
  	for (int i = 0; i < N; i++) {
      for (int j = 0; j < (1<<N); j++) {
        dp[i][j] = -1;
      }
    }
  for (int i = 0; i < (1<<N); i++) {
    for (int j = 0; j < N; j++) {
      if (m[i][j] == 1 && (i&(1<<j)) {
        dp[0][i] = 1;
      }
          }
          }
  cout << d(N,(1<<N)-1) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:37: error: expected ')' before '{' token
   40 |       if (m[i][j] == 1 && (i&(1<<j)) {
      |          ~                          ^~
      |                                     )
a.cc:43:11: error: expected primary-expression before '}' token
   43 |           }
      |           ^
Language: C++

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

#define MAXN 21
#define MOD 1000000007

int N;
long long dp[MAXN][1<<MAXN];
int m[MAXN][MAXN];

int d(int i, int j) {
	if (dp[i][j] != -1) return dp[i][j];
  
  	dp[i][j] = 0;
  
  	for (int k = 0; k < N; k++) {
      if (a[i][k] == 1 && (j&(1<<k))) {
        dp[i][j] = (dp[i][j] + dp[i-1][j^(1<<k)])%MOD;
      }
    }
  
  return dp[i][j];
}

int main() {
	cin >> N;
  	for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        cin >> m[i][j];
      }
    }
  	for (int i = 0; i < N; i++) {
      for (int j = 0; j < (1<<N); j++) {
        dp[i][j] = -1;
      }
    }
  cout << d(N,(1<<N)-1) << endl;
}
  	

Compiler output:
a.cc: In function 'int d(int, int)':
a.cc:18:11: error: 'a' was not declared in this scope
   18 |       if (a[i][k] == 1 && (j&(1<<k))) {
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int f[22][1<<21];
int a[22][22];
int lowbit(int x)
{
    return x&-x;
}
int count1(int n)
{
    int ret=0;
    while(n)
    {
        ret++;
        n-=lowbit(n);
    }
    return ret;
}
int main()
{
    int i,j,k,l,n;
    scanf("%d",&n);
    f[0]=1;
    for(i=1;i<=n;i++)
        for(j=1;j<=n;j++)
            scanf("%d",&a[i][j]);
    for(j=1;j<(1<<n);j++)
    {
        for(l=0;l<n;l++)
        {
            if((j&(1<<l))==0||!a[count1(j)][n-l])
                continue;
            f[j]=(f[j]+f[j^(1<<l)])%1000000007;
        }
    }
    printf("%d",f[(1<<n)-1]);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: incompatible types in assignment of 'int' to 'int [2097152]'
   23 |     f[0]=1;
      |     ~~~~^~
a.cc:33:23: error: invalid operands of types 'int [2097152]' and 'int [2097152]' to binary 'operator+'
   33 |             f[j]=(f[j]+f[j^(1<<l)])%1000000007;
      |                   ~~~~^~~~~~~~~~~~
      |                      |           |
      |                      |           int [2097152]
      |                      int [2097152]
Language: C++

#include <bits/stdc++.h>
using namespace std;
int f[22][1<<21-1];
int lowbit(int x)
{
	return x&(-x);
}
int count1(int num)
{
	int ret=0;
	while(num)
	{	
		ret++;
		num-=lowbit(num);
	}
	return ret;
}
int main()
{
	int i,j,l;
	for(i=1;i<=n;i++)
	{
		for(j=1;j<1<<n;j++)
		{
			for(l=0;l<n;l++)
			{
				if((j&(1<<l))&&a[i][n-l])
				{
					f[i][j]=f[i][j]+f[i-1][j^(1<<l)];
				}
			}
		}
	}
	printf("%d",f[n][(1<<n)-1]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:20: error: 'n' was not declared in this scope
   21 |         for(i=1;i<=n;i++)
      |                    ^
a.cc:27:48: error: 'a' was not declared in this scope
   27 |                                 if((j&(1<<l))&&a[i][n-l])
      |                                                ^
a.cc:34:23: error: 'n' was not declared in this scope
   34 |         printf("%d",f[n][(1<<n)-1]);
      |                       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int f[(1<<22)+1];
int a[22][22];
int lowbit(int x)
{
	return x&(-x);
}
int count1(int num)
{
	int ret=0;
	while(num)
	{	
		ret++;
		num-=lowbit(num);
	}
	return ret;
}
int main()
{
	int i,j,l,n;
	scanf("%d",&n);
	f[0][0]=1;
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=n;j++)
		{
			scanf("%d",&a[i][j]);	
		}	
	}
	for(j=1;j<(1<<n);j++)
	{
		if(count1(j)!=i)
			continue;
		for(l=0;l<=n-1;l++)
		{
			if((j&(1<<l))!=0&&a[i][n-l]==1)
				f[j]=(f[j^(1<<l)]+f[j])%(1000000000+7);
		}
	}
	printf("%d",f[(1<<n)-1]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:13: error: invalid types 'int[int]' for array subscript
   23 |         f[0][0]=1;
      |             ^
Language: C++

#include <bitset>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>

std::vector<std::vector<int>> getArray(int n, const std::string &org) {
  std::vector<std::vector<int>> results(n);
  for (auto &row : results) {
    row.resize(n, 0);
  }
  std::istringstream iss(org);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      iss >> results[i][j];
    }
  }
  /*
  for (const auto &row : results) {
    for (const auto n : row) {
      std::cout <<n << " ";
    }
    std::cout << std::endl;
  }
  */
  return results;
}

int64_t getPairsNum(const std::vector<std::vector<int>> &possibles) {
  const int n = static_cast<int>(possibles.size());
  std::vector<std::vector<int64_t>> dp(n);
  for (auto &row : dp) {
    row.resize(static_cast<int>(std::pow(2, n)), 0);
  }
  std::vector<std::bitset<21>> pre_bits(n);
  for (int i = 0; i < n; ++i) {
    pre_bits[i] = static_cast<unsigned long long>(1LL << i);
  }

  for (int j = 0; j < n; ++j) {
    if (possibles[0][j]) {
      dp[0][1LL << j] = 1;
    }
  }
  /*
  std::cout << "i=" << 0 << std::endl;
  for (int n = 0; n < static_cast<int>(dp[0].size()); ++n) {
    std::cout << std::bitset<21>(static_cast<unsigned long long>(n)) << ": " <<
  dp[0][n] << std::endl;
  }
    std::cout << std::endl;
    */
  for (int i = 1; i < n; ++i) {
    const auto &prev = dp[i - 1];
    auto &current = dp[i];
    for (int k = 0; k < static_cast<int>(prev.size()); ++k) {
      if (!prev[k]) continue;
      std::bitset<21> bits(static_cast<unsigned long long>(k));
      const auto count = prev[k];
      for (int j = 0; j < n; ++j) {
        //        std::cout << bits << ", " << pre_bits[j] << ", " << bits[j] <<
        //        "," << possibles[i][j] << std::endl;
        if (!bits[j] && possibles[i][j]) {
          current[(bits | pre_bits[j]).to_ulong()] += count;
        }
      }
    }
    for (auto &count : current) {
      count %= 1000000007LL;
    }
    /*
    std::cout << "i=" << i << std::endl;
    for (int n = 0; n < static_cast<int>(dp[i].size()); ++n) {
      std::cout << std::bitset<21>(static_cast<unsigned long long>(n)) << ": "
    << dp[i][n] << std::endl;
    }
    std::cout << std::endl;
    */
  }
  return dp.back().back();
}

int main() {
  int n;
  std::cin >> n;
  std::vector<std::vector<int>> results(n);
  for (auto &row : results) {
    row.resize(n, 0);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      std::cin >> results[i][j];
    }
  }
  std::cout << getPairsNum(results) << std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int64_t getPairsNum(const std::vector<std::vector<int> >&)':
a.cc:33:38: error: 'pow' is not a member of 'std'
   33 |     row.resize(static_cast<int>(std::pow(2, n)), 0);
      |                                      ^~~
Language: C++

//$g++ -std=c++11 Template.cpp 

//#include <bits/stdc++.h>
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <climits>
#include <iomanip>

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define ROF(i, j, k) for(int i = (int)(j); i >= (int)(k); --i)
#define FORLL(i, n, m) for(long long i = n; i < (long long)(m); i++)
#define SORT(v, n) sort(v, v+n)
#define REVERSE(v) reverse((v).begin(), (v).end())

using namespace std;
using ll = long long;
const ll MOD=1000000007LL;
typedef pair<int, int> P;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }

priority_queue<int> q_descending;
priority_queue<int, vector<int>, greater<int> > q_ascending;

const int MAX = 25;
int dp[MAX][(1<<MAX)];
int a[MAX][MAX];

//解説AC
//https://atcoder.jp/contests/dp/submissions/4182721

int
main(void){  
  ios_base::sync_with_stdio(false);

  int n;  
  cin >> n;
  REP(i, n) REP(j, n) cin >> a[i][j];

  dp[0][(1<<n)-1] = 1;
  REP(i, n){
    REP(bit, (1<<n)){
      //bit数 != n-i
      if(__builtin_popcount(bit) != n-i) continue;
      REP(j, n){
	//好意 かつ j-bit立ってる
	if(a[i][j] && (bit&(1<<j))) (dp[i+1][bit&(~(1<<j))] += dp[i][bit])%=MOD;
      }
    }
  }

  cout << dp[n][0] << endl;
  
  return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
int dp[1<<21];
int a[22][22];
int N;

void solve()
{
    dp[0] = 1
   for(int mask = 1;mask<(1<<N);mask++){
       for(int j=0;j<N;j++)
       {
           if((mask&(1<<j) && a[__builtin_popcount(mask)-1][j]))
           {
               dp[mask] = (dp[mask] + dp[mask ^ (1<<j)])%1000000007;
           }
       }
   }
   cout<<dp[(1<<N)-1]<<"\n";
}


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

Compiler output:
a.cc: In function 'void solve()':
a.cc:9:14: error: expected ';' before 'for'
    9 |     dp[0] = 1
      |              ^
      |              ;
   10 |    for(int mask = 1;mask<(1<<N);mask++){
      |    ~~~        
a.cc:10:21: error: 'mask' was not declared in this scope; did you mean 'std::filesystem::perms::mask'?
   10 |    for(int mask = 1;mask<(1<<N);mask++){
      |                     ^~~~
      |                     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,
      |       ^~~~
Language: C++

#include<bits/stdc++.h>
#define MOD 1000000007
using namespace std;
long long int dp[2][2048*1024];
int main(){
    ios::base
    long long int n;
    cin >> n;
    vector< vector<long long int> >pow;
    pow.clear();
    pow.resize(n);
    long long int temp = 1;

    int inp;
    
    for (int i=0 ; i<n ; i++){
        temp = 1;
        for (int j=0 ; j<n ; j++){
            cin >> inp;

            if (inp){
                pow[i].push_back(temp);
 //               cout << temp << " ";
            }
            
            temp *= 2;
        }
        //cout << "\n";
    }
   // cout << temp << "\n";
    
    
    for (long long int i=0 ; i<n ; i++){
        for (long long int j=0 ; j<temp ; j++){
            dp[i%2][j] = 0;
            if (i==0){
                int len = pow[0].size();

                for (int k=0 ; k<len ; k++){
                    dp[0][pow[0][k]] = 1;
                } 

            }

            else{
                int len = pow[i].size();
                for (int k=0 ; k<len && j>=pow[i][k] ; k++){
                    dp[i%2][j] = (dp[i%2][j] + dp[(i-1)%2][j-pow[i][k]])%MOD; 
                }

            }
            //cout << dp[i][j] << " ";
        }
        //cout << "\n";
    }
    cout << dp[(n+1)%2][temp-1] << "\n";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 'base' is not a member of 'std::ios' {aka 'std::basic_ios<char>'}
    6 |     ios::base
      |          ^~~~
a.cc:8:12: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |     cin >> n;
      |            ^
      |            yn
Language: C++

//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")

#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>

using namespace std;

typedef pair <int, int> pii;
typedef pair <long long, long long> pll;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define endl "\n"
#define mt make_tuple
#define mp make_pair

template <typename T1, typename T2>
bool umax(T1 &a, const T2&b) { return a < b ? a = b, 1 : 0;}
template <typename T1, typename T2> 
bool umin(T1 &a, const T2 &b) {return a > b ? a = b, 1 : 0;}
template <typename T>
T sqr(T a) {return a * a;}
template <typename T1, typename T2>
void modadd(T1 &a, const T2 &b) {
    a += b;

    if (a >= mod)
        a -= mod;
}

mt19937 rng(20010709);
const int mod = 1000000007;
const int INF = 1000000001;
const int N = 1 << 21;

int n, a[22][22], dp[N], bit[22];
vector <int> e[22], mask[22];
vector <pii> cur;

ll get(int l, int r);

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;

    for (int i = 0; i < n; i++)
        bit[i] = 1 << i;

    dp[0] = 1;

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

            if (a[i][j])
                e[i].push_back(j);
        }

        for (int mask = (1 << n) - 1; mask > -1; mask--) {
            if (!dp[mask]) continue;

            for (auto jt : e[i]) {
                if (!((mask >> jt) & 1))
                    modadd(dp[mask | bit[jt]], dp[mask]);
            }

            dp[mask] = 0;
        }
    }

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

    return 0;
}

Compiler output:
a.cc: In function 'void modadd(T1&, const T2&)':
a.cc:29:14: error: 'mod' was not declared in this scope; did you mean 'modf'?
   29 |     if (a >= mod)
      |              ^~~
      |              modf
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod=1000000007;
int main(){
  ll n;cin>>n;
  ll a[n][n];
  for(ll i=0;i<n;i++)for(ll j=0;j<n;j++)cin>>a[i][j];
  ll dp[1<<n];
  fill(dp,dp+1<<n,0);
  dp[0]=1;
  for(ll i=1;i<1<<n;i++){
    ll j=__builtin_popcount(i)-1;
    for(ll k=0;k<n;k++){
      if(i&(1<<k)&&a[j][k]){
        dp[i]+=dp[i^(1<<k)];
        dp[i]%=mod;
      }
    }
  }
  cout<<dp[1<<n-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: invalid operands of types 'll*' {aka 'long long int*'} and 'll' {aka 'long long int'} to binary 'operator<<'
   10 |   fill(dp,dp+1<<n,0);
      |           ~~~~^~~
      |             |   |
      |             |   ll {aka long long int}
      |             ll* {aka long long int*}
Language: C++

#include <bits/stdc++.h>

using namespace std;

int N;
int arr[22][22];
long long pre[1<<22];
long long dp[1<<22];
long long MOD = 1000000007;

int main(){
    cin >> N;
    for(int i = 0; i<N; i++){
        for(int j = 0; j<N; j++){
            cin >> arr[i][j];
        }
    }
    dp[0] = 1;
    for(int i = 1; i<1<<N; i++){
        int j = __builtin_popcount-1;
        for(int k = 0; k<N; k++){
            if(arr[j][k] && ((1<<k)&i)){
                dp[i] += dp[i^(1<<k)];
            }
        }
        dp[i] %= MOD;
    }
    cout << dp[(1<<N)-1] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: built-in function '__builtin_popcount' must be directly called
   20 |         int j = __builtin_popcount-1;
      |                 ^~~~~~~~~~~~~~~~~~