Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
const ll INF=mod*mod;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(x) (x).begin(),(x).end()
ll min(ll a,ll b){
  if(a>b){
    return b;
    }
      else{
        return a;
      }
  }
  
  ll max(ll a,ll b){
    if(a>b){
      return a;
    }
    else{
      return b;
    }
  }

ll power(ll a,ll b){
 ll ans=1;
 for(ll i=1;i<=b;i++){
ans*=a;
  }
  return ans;
}

 ll gcd(ll m,ll n){
 	if(n==0){
       return m;
     }
   return gcd(n,m%n);
 }
ll lcm(ll a,ll b){
  ll g=gcd(a,b);
  return a/gcd(a,b)*b;
		

}
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
const ll INF=mod*mod;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(x) (x).begin(),(x).end()
ll min(ll a,ll b){
  if(a>b){
    return b;
    }
      else{
        return a;
      }
  }
  
  ll max(ll a,ll b){
    if(a>b){
      return a;
    }
    else{
      return b;
    }
  }

ll power(ll a,ll b){
 ll ans=1;
 for(ll i=1;i<=b;i++){
ans*=a;
  }
  return ans;
}

 ll gcd(ll m,ll n){
 	if(n==0){
       return m;
     }
   return gcd(n,m%n);
 }
ll lcm(ll a,ll b){
  ll g=gcd(a,b);
  return a/gcd(a,b)*b;
		

}
const ll limit=28;
ll a[limit];
ll b[limit];
bool G[limit][limit];
ll N,M;

ll dfs(ll v,bool visited[limit]){
  bool ALL=true;
  rep(i,N){
    if(visited[i]==false){
      ALL=false;
    }
  }

  if(ALL){
    return 1;//ALLの場合最終的には同じdfsにたどり着く？
  }
  
  ll ret=0;
  
  rep(i,M){
    
    if(G[v][i]==true&&visited[i]==false){
      visited[i]=true;
      ret+=dfs(i,visited);
      visited[i]=false;
    }

  }
  
  return ret;
}
 
    
      
    
    
int main(){
  
  cin>>N>>M;
  
  rep(i,M){
cin>>a[i]>>b[i];
    
    G[a[i]-1][b[i]-1]=G[b[i]-1][a[i]-1]=true;
  }
  bool visited[limit];
rep(i,N){
  visited[i]=false;
  
}
 
  visited[0]=true;//0スタート固定？
  

  cout<<dfs(0,visited)<<endl;
}

const ll limit=28;
ll a[limit];
ll b[limit];
bool G[limit][limit];


ll dfs(ll v,bool visited[limit]){
  bool ALL=true;
  rep(i,N){
    if(visited[i]==false){
      ALL=false;
    }
  }

  if(ALL){
    return 1;//ALLの場合最終的には同じdfsにたどり着く？
  }
  
  ll ret=0;
  
  rep(i,M){
    
    if(G[v][i]==true&&visited[i]==false){
      visited[i]=true;
      ret+=dfs(i,visited);
      visited[i]=false;
    }

  }
  
  return ret;
}
 
    
      
    
    
int main(){
  
  cin>>N>>M;
  
  rep(i,M){
cin>>a[i]>>b[i];
    
    G[a[i]-1][b[i]-1]=G[b[i]-1][a[i]-1]=true;
  }
  bool visited[limit];
rep(i,N){
  visited[i]=false;
  
}
 
  visited[0]=true;//0スタート固定？
  

  cout<<dfs(0,visited)<<endl;
}


Compiler output:
a.cc:49:10: error: redefinition of 'const ll mod'
   49 | const ll mod=1e9+7;
      |          ^~~
a.cc:4:10: note: 'const ll mod' previously defined here
    4 | const ll mod=1e9+7;
      |          ^~~
a.cc:50:10: error: redefinition of 'const ll INF'
   50 | const ll INF=mod*mod;
      |          ^~~
a.cc:5:10: note: 'const ll INF' previously defined here
    5 | const ll INF=mod*mod;
      |          ^~~
a.cc:53:4: error: redefinition of 'll min(ll, ll)'
   53 | ll min(ll a,ll b){
      |    ^~~
a.cc:8:4: note: 'll min(ll, ll)' previously defined here
    8 | ll min(ll a,ll b){
      |    ^~~
a.cc:62:6: error: redefinition of 'll max(ll, ll)'
   62 |   ll max(ll a,ll b){
      |      ^~~
a.cc:17:6: note: 'll max(ll, ll)' previously defined here
   17 |   ll max(ll a,ll b){
      |      ^~~
a.cc:71:4: error: redefinition of 'll power(ll, ll)'
   71 | ll power(ll a,ll b){
      |    ^~~~~
a.cc:26:4: note: 'll power(ll, ll)' previously defined here
   26 | ll power(ll a,ll b){
      |    ^~~~~
a.cc:79:5: error: redefinition of 'll gcd(ll, ll)'
   79 |  ll gcd(ll m,ll n){
      |     ^~~
a.cc:34:5: note: 'll gcd(ll, ll)' previously defined here
   34 |  ll gcd(ll m,ll n){
      |     ^~~
a.cc:85:4: error: redefinition of 'll lcm(ll, ll)'
   85 | ll lcm(ll a,ll b){
      |    ^~~
a.cc:40:4: note: 'll lcm(ll, ll)' previously defined here
   40 | ll lcm(ll a,ll b){
      |    ^~~
a.cc:149:10: error: redefinition of 'const ll limit'
  149 | const ll limit=28;
      |          ^~~~~
a.cc:91:10: note: 'const ll limit' previously defined here
   91 | const ll limit=28;
      |          ^~~~~
a.cc:150:4: error: redefinition of 'll a [28]'
  150 | ll a[limit];
      |    ^
a.cc:92:4: note: 'll a [28]' previously declared here
   92 | ll a[limit];
      |    ^
a.cc:151:4: error: redefinition of 'll b [28]'
  151 | ll b[limit];
      |    ^
a.cc:93:4: note: 'll b [28]' previously declared here
   93 | ll b[limit];
      |    ^
a.cc:152:6: error: redefinition of 'bool G [28][28]'
  152 | bool G[limit][limit];
      |      ^
a.cc:94:6: note: 'bool G [28][28]' previously declared here
   94 | bool G[limit][limit];
      |      ^
a.cc:155:4: error: redefinition of 'll dfs(ll, bool*)'
  155 | ll dfs(ll v,bool visited[limit]){
      |    ^~~
a.cc:97:4: note: 'll dfs(ll, bool*)' previously defined here
   97 | ll dfs(ll v,bool visited[limit]){
      |    ^~~
a.cc:186:5: error: redefinition of 'int main()'
  186 | int main(){
      |     ^~~~
a.cc:128:5: note: 'int main()' previously defined here
  128 | int main(){
      |     ^~~~