Language: C++

#include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):x)
#define uint unsigned int
#define dbl long double
#define pi 3.14159265358979323846
using namespace std;
// mylittledoge

#ifdef DONLINE_JUDGE
	// palindromic tree is better than splay tree!
	#define lld I64d
#endif

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	int N,M;
	cin >> N >> M;
	vector< vector<int> > G(N);
	cat ans =1;
	for(int i =0; i < M; i++) {
		ans =(ans*2)%mod;
		int x,y;
		cin >> x >> y;
		if(x == 1 && y == 2) continue;
		G[N-x].push_back(N-y);}

	vector< vector<int> > deg(N,vector<int>(1<<N,0));
	for(int i =0; i < N; i++) for(int j =0; j < (1<<N); j++)
		ALL_THE(G[i],it) deg[i][j] +=(j>>*it)&1;

	vector<long long> cnt(1<<N,0);
	cnt[0] =1;
	long long mod =1000000007;
	for(int i =0; i < (1<<(N-2)); i++) if(cnt[i] != 0) {
		vector<int> v;
		int w,w2;
		for(int j =0; j < N; j++) if(((i>>j)&1) == 0) v.push_back(j);
		int sz =v.size();
		for(int j =0; j < (1<<(sz-2)); j++) for(int k =0; k < 2; k++) {
			w =0;
			for(int a =0; a < sz-2; a++) if((j>>a)&1) w +=1<<v[a];
			if(k) w +=(1<<(N-2))*3;
			if(w == 0) continue;
			w2 =(1<<N)-1-i-w;
			long long c =1;
			for(int a =0; a < N; a++) if((w2>>a)&1) c =(c*((1LL<<deg[a][w])-1))%mod;
			for(int a =0; a < N; a++) if((w>>a)&1) c =(c*(1LL<<deg[a][w2]))%mod;
			c =(c*cnt[i])%mod;
			cnt[i+w] =(cnt[i+w]+c)%mod;}
		}

	for(int i =0; i < (1<<N); i++) if((i>>(N-1))&1) if((i>>(N-2))&1) {
		int e =0;
		for(int j =0; j < N; j++) if(((i>>j)&1) == 0)
			ALL_THE(G[j],it) if(((i>>*it)&1) == 0) e++;
		ans =(ans-(1LL<<e)*cnt[i])%mod;}
	if(ans < 0) ans +=mod;
	cout << ans << "\n";
	return 0;}

// look at my code
// my code is amazing


Compiler output:
a.cc: In function 'int main()':
a.cc:46:9: error: 'cat' was not declared in this scope
   46 |         cat ans =1;
      |         ^~~
a.cc:48:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   48 |                 ans =(ans*2)%mod;
      |                 ^~~
      |                 abs
a.cc:48:30: error: 'mod' was not declared in this scope; did you mean 'modf'?
   48 |                 ans =(ans*2)%mod;
      |                              ^~~
      |                              modf
a.cc:83:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   83 |                 ans =(ans-(1LL<<e)*cnt[i])%mod;}
      |                 ^~~
      |                 abs
a.cc:84:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   84 |         if(ans < 0) ans +=mod;
      |            ^~~
      |            abs
a.cc:85:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   85 |         cout << ans << "\n";
      |                 ^~~
      |                 abs