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


//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>


using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x*x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define loop(n) FOR(i,0,n)
#define rrep(i,a,b) for(int i=(a);i>=(b);--i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int n, m;
int G[10][10];

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

	for (int i = 0; i < m; i++) {
		int a, b; cin >> a >> b;
		a--; b--;
		G[a][b] = G[b][a] = 1;
	}

	vector<int> v(n - 1);

	for (int i = 1; i < n; i++)v[i - 1] = i;
	sort(v.begin(), v.end());
	int ans = 0;

	//必ず0からスタート。
	do {
		int now = 0;
		for (int i = 0; i < v.size(); i++) {
			if (G[now][v[i]] == 0)break;

			//つながってたら。更新。
			now = v[i];
			if (i == v.size() - 1)ans++;
		}
	
	} while (next_permutation(v.begin(), v.end())));

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:102:55: error: expected ';' before ')' token
  102 |         } while (next_permutation(v.begin(), v.end())));
      |                                                       ^
      |                                                       ;
a.cc:102:55: error: expected primary-expression before ')' token
Language: C++

#include<iostream>
#include <algorithm>
#include<string>
#include <bitset>
#include <vector>
#include <functional>
#include <climits>
#include <iomanip>
#include <utility>
#include <stack>
#include <queue>
#include <math.h>
#include <iomanip>
using namespace std;
using ll = long long;
ll n, m;
ll sum = 0;
	ll memo[50][50] = {};
void kansuu(ll num, ll visited[10]) {
	ll flag = 0;
	for (int i = 2; i <= n; i++)
	{
		if (visited[i]==0)
		{
			flag = 1;
		}
	}
	if (flag==0)
	{
		sum++;
		return;
	}
			ll x[10] = {};
	for (ll i = 1; i <= n; i++)
	{
		if (memo[num][i]==1&&visited[i]==0)
		{
			memcpy(x, visited, sizeof(ll)*10);
			/*cout << "x=" ;
			for (ll z = 1; z <= n; z++)
			{
				cout << x[z];
			}
			cout << endl;
			cout << "visited=";
			for (ll z = 1; z <= n; z++)
			{
				cout << visited[z];
			}
			cout << endl;
			cout << endl;
*/
			x[i]=1;
			kansuu(i, x);
		}
	}
	
}
int main()
{
	ll a, b = 0, c = 0, d = 0;
	ll l;
	char C[1000][1000] = {};
	ll h, w, sy, sx, gy, gx;
	queue<int> x, y;
	cin >> n;
	cin >> m;
	for (int i = 0; i < m; i++)
	{
		cin >> a;
		cin >> b;
		memo[a][b] = 1;
		memo[b][a] = 1;
	}
	ll zz[10] = {};
	zz[1] = 1;
	kansuu(1,zz);


	cout << sum << endl;

	return 0;
}


Compiler output:
a.cc: In function 'void kansuu(ll, ll*)':
a.cc:38:25: error: 'memcpy' was not declared in this scope
   38 |                         memcpy(x, visited, sizeof(ll)*10);
      |                         ^~~~~~
a.cc:13:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   12 | #include <math.h>
  +++ |+#include <cstring>
   13 | #include <iomanip>
Language: C++

#include<iostream>
#include <algorithm>
#include<string>
#include <bitset>
#include <vector>
#include <functional>
#include <climits>
#include <iomanip>
#include <utility>
#include <stack>
#include <queue>
#include <math.h>
#include <iomanip>
using namespace std;
using ll = long long;
ll n, m;
ll sum = 0;
	ll memo[50][50] = {};
void kansuu(ll num, ll visited[10]) {
	ll flag = 0;
	for (int i = 2; i <= n; i++)
	{
		if (visited[i]==0)
		{
			flag = 1;
		}
	}
	if (flag==0)
	{
		sum++;
		return;
	}
			ll x[10] = {};
	for (ll i = 1; i <= n; i++)
	{
		if (memo[num][i]==1&&visited[i]==0)
		{
			memcpy(x, visited, sizeof(ll)*n);
			/*cout << "x=" ;
			for (ll z = 1; z <= n; z++)
			{
				cout << x[z];
			}
			cout << endl;
			cout << "visited=";
			for (ll z = 1; z <= n; z++)
			{
				cout << visited[z];
			}
			cout << endl;
			cout << endl;
*/
			x[i]=1;
			kansuu(i, x);
		}
	}
	
}
int main()
{
	ll a, b = 0, c = 0, d = 0;
	ll l;
	char C[1000][1000] = {};
	ll h, w, sy, sx, gy, gx;
	queue<int> x, y;
	cin >> n;
	cin >> m;
	for (int i = 0; i < m; i++)
	{
		cin >> a;
		cin >> b;
		memo[a][b] = 1;
		memo[b][a] = 1;
	}
	ll zz[10] = {};
	zz[1] = 1;
	kansuu(1,zz);


	cout << sum << endl;

	return 0;
}


Compiler output:
a.cc: In function 'void kansuu(ll, ll*)':
a.cc:38:25: error: 'memcpy' was not declared in this scope
   38 |                         memcpy(x, visited, sizeof(ll)*n);
      |                         ^~~~~~
a.cc:13:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   12 | #include <math.h>
  +++ |+#include <cstring>
   13 | #include <iomanip>
Language: C++

#include<iostream>
#include <algorithm>
#include<string>
#include <bitset>
#include <vector>
#include <functional>
#include <climits>
#include <iomanip>
#include <utility>
#include <stack>
#include <queue>
#include <math.h>
#include <iomanip>
using namespace std;
using ll = long long;
ll n, m;
ll sum = 0;
	ll memo[50][50] = {};
void kansuu(ll num, ll visited[10]) {
	ll flag = 0;
	for (int i = 2; i <= n; i++)
	{
		if (visited[i]==0)
		{
			flag = 1;
		}
	}
	if (flag==0)
	{
		sum++;
		return;
	}
			ll x[10] = {};
	for (ll i = 1; i <= n; i++)
	{
		if (memo[num][i]==1&&visited[i]==0)
		{
			memcpy(x, visited, 10*8);
			/*cout << "x=" ;
			for (ll z = 1; z <= n; z++)
			{
				cout << x[z];
			}
			cout << endl;
			cout << "visited=";
			for (ll z = 1; z <= n; z++)
			{
				cout << visited[z];
			}
			cout << endl;
			cout << endl;
*/
			x[i]=1;
			kansuu(i, x);
		}
	}
	
}
int main()
{
	ll a, b = 0, c = 0, d = 0;
	ll l;
	char C[1000][1000] = {};
	ll h, w, sy, sx, gy, gx;
	queue<int> x, y;
	cin >> n;
	cin >> m;
	for (int i = 0; i < m; i++)
	{
		cin >> a;
		cin >> b;
		memo[a][b] = 1;
		memo[b][a] = 1;
	}
	ll zz[10] = {};
	zz[1] = 1;
	kansuu(1,zz);


	cout << sum << endl;

	return 0;
}


Compiler output:
a.cc: In function 'void kansuu(ll, ll*)':
a.cc:38:25: error: 'memcpy' was not declared in this scope
   38 |                         memcpy(x, visited, 10*8);
      |                         ^~~~~~
a.cc:13:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   12 | #include <math.h>
  +++ |+#include <cstring>
   13 | #include <iomanip>
Language: C++

#include<iostream>
#include <algorithm>
#include<string>
#include <bitset>
#include <vector>
#include <functional>
#include <climits>
#include <iomanip>
#include <utility>
#include <stack>
#include <queue>
#include <math.h>
#include <iomanip>
using namespace std;
using ll = long long;
ll n, m;
ll sum = 0;
	ll memo[50][50] = {};
void kansuu(ll num, ll visited[10]) {
	ll flag = 0;
	for (int i = 2; i <= n; i++)
	{
		if (visited[i]==0)
		{
			flag = 1;
		}
	}
	if (flag==0)
	{
		sum++;
		return;
	}
			ll x[10] = {};
	for (ll i = 1; i <= n; i++)
	{
		if (memo[num][i]==1&&visited[i]==0)
		{
			memcpy(x, visited, n*8);
			/*cout << "x=" ;
			for (ll z = 1; z <= n; z++)
			{
				cout << x[z];
			}
			cout << endl;
			cout << "visited=";
			for (ll z = 1; z <= n; z++)
			{
				cout << visited[z];
			}
			cout << endl;
			cout << endl;
*/
			x[i]=1;
			kansuu(i, x);
		}
	}
	
}
int main()
{
	ll a, b = 0, c = 0, d = 0;
	ll l;
	char C[1000][1000] = {};
	ll h, w, sy, sx, gy, gx;
	queue<int> x, y;
	cin >> n;
	cin >> m;
	for (int i = 0; i < m; i++)
	{
		cin >> a;
		cin >> b;
		memo[a][b] = 1;
		memo[b][a] = 1;
	}
	ll zz[10] = {};
	zz[1] = 1;
	kansuu(1,zz);


	cout << sum << endl;

	return 0;
}


Compiler output:
a.cc: In function 'void kansuu(ll, ll*)':
a.cc:38:25: error: 'memcpy' was not declared in this scope
   38 |                         memcpy(x, visited, n*8);
      |                         ^~~~~~
a.cc:13:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   12 | #include <math.h>
  +++ |+#include <cstring>
   13 | #include <iomanip>
Language: C++

import itertools
na = lambda: list(map(int, input().split()))

n, m = na()
t = [[0] * 10 for _ in range(10)]
for _ in range(m):
    a, b = na()
    a -= 1
    b -= 1
    t[a][b] = t[b][a] = 1

ans = 0
for l in itertools.permutations(range(m)):
    if l[0]: continue
    flag = 1
    for i in range(1, n):
        if t[l[i]][l[i-1]] == 0:
            flag = 0
    if flag:
        ans += 1

print(ans)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import itertools
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>

#define rep(i, N) for(int (i) = 0; (i) < (N); (i) ++)
typedef long long ll;
using namespace std;
vector<vector<int>> dp;
vector<vector<bool>> edges;

ll memo(int a, int p, int end){
    if(dp[a][p] != -1){
        return dp[a][p];
    }
    if(p == end){
        return dp[a][p] = 1;
    }
    ll ans = 0;
    rep(i, edges.size()){
        bitset<TMP> pb = (p);
        if(edges[a][i] && !(pb[i])){
            pb.set(i);
            int p_n = pb.to_ulong();
            ans += memo(i, p_n, end);
        }
    }
    return (dp[a][p] = ans);
}


int main(){
    int N, M;
    cin >> N >> M;
    int size = (1 << (N));
    dp = vector<vector<int>>(N, vector<int>(size, -1));
    edges = vector<vector<bool>>(N, vector<bool>(N, false));
    rep(i, M){
        int a, b;
        cin >> a >> b;
        a --;
        b --;
        edges[a][b] = edges[b][a] = true;
    }

    ll ans = memo(0, 1, size - 1);

    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'll memo(int, int, int)':
a.cc:22:16: error: 'TMP' was not declared in this scope
   22 |         bitset<TMP> pb = (p);
      |                ^~~
a.cc:22:19: error: template argument 1 is invalid
   22 |         bitset<TMP> pb = (p);
      |                   ^
a.cc:23:31: error: invalid types 'int[int]' for array subscript
   23 |         if(edges[a][i] && !(pb[i])){
      |                               ^
a.cc:24:16: error: request for member 'set' in 'pb', which is of non-class type 'int'
   24 |             pb.set(i);
      |                ^~~
a.cc:25:26: error: request for member 'to_ulong' in 'pb', which is of non-class type 'int'
   25 |             int p_n = pb.to_ulong();
      |                          ^~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>

#define rep(i, N) for(int (i) = 0; (i) < (N); (i) ++)
typedef long long ll;
using namespace std;

#define TMP 9

void print_dp(vector<vector<int>> dp){
    int y = dp.size();
    int x = dp[0].size();
    cout << endl;
    rep(i, x){
        cout.width(TMP - 1);
        cout << bitset<TMP - 1>(i) << " ";
    }
    cout << endl;
    rep(i, y){
        rep(j, x){
            cout.width(TMP - 1);
            cout << dp[i][j] << " ";
        }
        cout << endl;
    }
}

vector<vector<int>> dp;
vector<vector<bool>> edges;

ll memo(int a, int p, int end){
    if(dp[a][p] != -1){
        return dp[a][p];
    }
    if(p == end){
        return dp[a][p] = 1;
    }
    ll ans = 0;
    rep(i, edges.size()){
        bitset<TMP> pb = (p);
        if(edges[a][i] && !(pb[i])){
            pb.set(i);
            int p_n = pb.to_ulong();
            ans += memo(i, p_n, end);
        }
    }
    return (dp[a][p] = ans);
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<cstdio>
#include<vector>

using namespace std;
vector<int> G[100]

int dfs(int n, int mask, int now) {
  int res = 0;
  if(mask == (1<<n)-1) return 1;
  
  for(auto v : G[now]) {
    if(~mask & (1<<v)) res += dfs(n, mask | (1<<v), v);
  }
  return res;
}

int main(void) {
  int n,m;
  scanf("%d%d",&n,&m);
  for(int i=0; i<m; i++) {
    int a,b;
    scanf("%d%d",&a,&b);
    a--, b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  printf("%d\n",dfs(n, 0, 0));
}

Compiler output:
a.cc:7:1: error: expected initializer before 'int'
    7 | int dfs(int n, int mask, int now) {
      | ^~~
a.cc: In function 'int main()':
a.cc:24:5: error: 'G' was not declared in this scope
   24 |     G[a].push_back(b);
      |     ^
a.cc:27:17: error: 'dfs' was not declared in this scope
   27 |   printf("%d\n",dfs(n, 0, 0));
      |                 ^~~
Language: C++

#include <cstdio>

using namespace std;

const int nmax = 8;
bool graph[nmax][nmax];
int n;


int dfs(int v, bool visited[nmax])
{
    bool all_visited = true;

    for (int i = 0; i < n; i++) {
        if (visited[i] = false)
            all_visited = false;
    }

    if (all_visited)
        return 1;

    int ret = 0;

    for (int i = 0; i < n; i++) {
        if (graph[v][i] == false)
            continue;
        if (visited[i])
            continue;
        
        visitet[i] = true;
        ret += dfs(i, n, visited);
        visited[i] = false;
    }   

    return ret;
}

int main(void)
{
    int m;
    scanf("%d%d", &n, &m);

    for (int i = 0; i < m; i++) {
        int A, B;
        scanf("%d%d", &A, &B);
        graph[A-1][B-1] = graph[B-1][A-1] = true;
    }

    bool visitetd[nmax];
    for (int i = 0; i < n; i++)
        visitet[i] = false;

    visitet[0] = true;
    printf("%d\n", dfs(0, n, visited));
    return 0;
}

Compiler output:
a.cc: In function 'int dfs(int, bool*)':
a.cc:30:9: error: 'visitet' was not declared in this scope; did you mean 'visited'?
   30 |         visitet[i] = true;
      |         ^~~~~~~
      |         visited
a.cc:31:23: error: invalid conversion from 'int' to 'bool*' [-fpermissive]
   31 |         ret += dfs(i, n, visited);
      |                       ^
      |                       |
      |                       int
a.cc:31:19: error: too many arguments to function 'int dfs(int, bool*)'
   31 |         ret += dfs(i, n, visited);
      |                ~~~^~~~~~~~~~~~~~~
a.cc:10:5: note: declared here
   10 | int dfs(int v, bool visited[nmax])
      |     ^~~
a.cc: In function 'int main()':
a.cc:51:9: error: 'visitet' was not declared in this scope; did you mean 'visitetd'?
   51 |         visitet[i] = false;
      |         ^~~~~~~
      |         visitetd
a.cc:53:5: error: 'visitet' was not declared in this scope; did you mean 'visitetd'?
   53 |     visitet[0] = true;
      |     ^~~~~~~
      |     visitetd
a.cc:54:30: error: 'visited' was not declared in this scope; did you mean 'visitetd'?
   54 |     printf("%d\n", dfs(0, n, visited));
      |                              ^~~~~~~
      |                              visitetd
Language: C++

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

int temp[10][10] = {}, N, M;
int foo(int n,int coun,int bb[]){//cout<<coun<<" "<<n<<endl;
    if(coun == N)return 1;
    int tee[10][10], ans =0, aa[10]={},C=0;
    for(int i = 1; i <= coun;i++){aa[bb[i]]=1;
  for(int i = 1; i <= N; i++){
    if(aa[i]==1)continue;
    //tee[n][i]=1;
    bb[coun+1]=i;
    if(temp[n][i])ans += foo(i,coun+1,bb);
    
    //tee[n][i]=0;
    
  }
  return ans;
}

int main(){
  int a, b, te[10][10]={}, bb[10] = {};
  cin>>N>>M;
  te[1][1] = 1;bb[1]=1;
  for(int i = 0; i < M; i++){
    cin>>a>>b;
    temp[a][b]=1;
    temp[b][a]=1;
  }

  cout<<foo(1,1,bb)<<endl;

  return 0;
}


Compiler output:
a.cc: In function 'int foo(int, int, int*)':
a.cc:21:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   21 | int main(){
      |         ^~
a.cc:21:9: note: remove parentheses to default-initialize a variable
   21 | int main(){
      |         ^~
      |         --
a.cc:21:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:21:11: error: a function-definition is not allowed here before '{' token
   21 | int main(){
      |           ^
a.cc:34:2: error: expected '}' at end of input
   34 | }
      |  ^
a.cc:5:33: note: to match this '{'
    5 | int foo(int n,int coun,int bb[]){//cout<<coun<<" "<<n<<endl;
      |                                 ^
a.cc:34:2: warning: control reaches end of non-void function [-Wreturn-type]
   34 | }
      |  ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

int numlen( int n ) {
	std::string s = std::to_string( n );
	return s.size();
}

bool chk_permu( int n, int i ) {
	std::string ns = std::to_string( n );
	std::sort( ns.begin(), ns.end() );
	std::string is = std::to_string( i );
	std::sort( is.begin(), is.end() );

	return ( ns == is );
}

int next_permu( int n ) {

	int len = numlen( n );
	int nmax = std::pow( 10, len - 1 ) * 2;

	int p = 0;
	for( int i = n + 1; i < nmax; i++ ) {
		bool ispermu = chk_permu( n, i );
		if( ispermu ) {
			p = i;
			break;
		}
	}
	return p;
}

bool isallconnected( int n, int m, int a[], int b[] ) {
	std::vector<int> nv;
	while( n > 0 ) {
		nv.insert( nv.begin(), n % 10 );
		n = n / 10;
	}

	int branch = 0;
	for( int i = 0; i < nv.size() - 1; i++ ) {
		for( int j = 0; j < m; j++ ) {
			if( ( nv[ i ] == a[ j ] and nv[ i + 1 ] == b[ j ] ) or
					( nv[ i ] == b[ j ] and nv[ i + 1 ] == a[ j ] ) ) {
				branch += 1;
			}
		}
	}

	return ( branch == m - 1 ? true : false );
}

int main( void )
{
	int n, m;
	std::cin >> n >> m;

	const int dmax = 28;
	int a[ dmax ], b[ dmax ];
	for( int i = 0; i < m; i++ ) {
		std::cin >> a[ i ] >> b[ i ];
	}

	int np = 0;
	for( int i = 1; i <= n; i++ ) {
		np = np * 10 + i;
	}

	int cnt = 0;
	while( np > 0 ) {
		bool isall = isallconnected( np, m, a, b );
		if( isall ) {
			cnt += 1;
		}

		np = next_permu( np );
	}

	std::cout << cnt << std::endl;
	return 0;
}



Compiler output:
a.cc: In function 'int next_permu(int)':
a.cc:23:25: error: 'pow' is not a member of 'std'
   23 |         int nmax = std::pow( 10, len - 1 ) * 2;
      |                         ^~~
Language: C++

#include <iostream>
using namespace std;

/* define const */

/* finish defineing const */

int n, m;
long cnt = 0;
int a[10] = {};
int b[10] = {};
string table[50000];
pair<int, int> p[10];

bool allt(bool *b)
{
    bool f = true;
    for (int i = 1; i <= n; i++)
    {
        if (b[i] == false)
        {
            f = false;
        }
    }
    return f;
}

void solve(int a, bool *b)
{
    bool tmp[10];
    for (int i = 1; i <= n; i++)
    {
        tmp[i] = b[i];
    }
    // コピー
    tmp[a] = true;

    if (allt(tmp))
    {
        cnt++;
        return;
    }
    else
    {
        for (int i = 0; i < m; i++)
        {
            if (p[i].first == a)
            {
                if (tmp[p[i].second] == false)
                {
                    // tmp[p[i].second] = true;
                    solve(p[i].second, tmp);
                }
                else
                {
                    continue;
                }
            }
            else if (p[i].second == a)
            {
                if (tmp[p[i].first] == false)
                {
                    // tmp[p[i].first] = true;
                    solve(p[i].first, tmp);
                }
                else
                {
                    continue;
                }
            }
        }
    }
}

int main()
{
    cin >> n >> m;
    for (int i = 0; i < m; i++)
    {
        cin >> a[i] >> b[i];
        p[i] = make_pair(a[i], b[i]);
    }
    sort(p, p + n);
    bool b[10] = {false, true};
    solve(1, b);

    cout << cnt << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:83:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   83 |     sort(p, p + n);
      |     ^~~~
      |     short
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll =int long long;
map <int ,int> mpa,mpb;

const int nmax= 8;
bool graph[nmax][nmax];

int DFS(int v, int N, bool visited[nmax]){
  bool all_visited=true;

  for(int i=0;i<N;i++){
    if(visited[i]==false){
      all_visited=false;
    }

  if(all_visited){
    return 1;
  }

  int ret=0;
  for(int i=0;i<N;i++){
    if(graph[v][i]==false) continue;
    if(visited[i]) continue;

    visited[i]=true;
    ret+=DFS(i,N,visited);
    visited[i]=false;
  }
      return ret;
}



int main(void){
  int N,M;
  cin >> N >> M;

  for(int i=0;i<M;i++){
    int A,B;
    cin >> A>> B;
    graph[A-1][B-1]=graph[B-1][A-1]=true;
  }

  bool visited[nmax];
  for(int i=0;i<N;i++){
    visited[i]=false;
}
  visited[0]=true;
  cout << DFS(0,N,visited) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int DFS(int, int, bool*)':
a.cc:44:15: error: a function-definition is not allowed here before '{' token
   44 | int main(void){
      |               ^
a.cc:61:2: error: expected '}' at end of input
   61 | }
      |  ^
a.cc:18:42: note: to match this '{'
   18 | int DFS(int v, int N, bool visited[nmax]){
      |                                          ^
a.cc:61:2: warning: control reaches end of non-void function [-Wreturn-type]
   61 | }
      |  ^
Language: C++

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

int adj[8][8];
int N, M;
int answer;

void search(int src, int visited[]) {
    // cout << "search(" << src << ", [";
    // for (int i = 1; i <= N; i++) {
    //     cout << visited[i] << ", ";
    // }
    // cout << "])" << endl;
    int newVisited[9];
    if (accumulate(visited, visited + 9, 0) == N) {
        // cout << "finish!" << endl;
        answer++;
    } else {
        for (int dst = 1; dst <= N; dst++) {
            if (adj[src][dst] && !visited[dst]) {
                memcpy(newVisited, visited, sizeof(int) * 9);
                newVisited[dst] = 1;
                search(dst, newVisited);
            }
        }
    }
}

int main() {
    memset(adj, 0, sizeof(adj));
    answer = 0;
    cin >> N >> M;
    for (int i = 0; i < M; i++) {
        int a, b;
        cin >> a >> b;
        adj[a][b] = 1;
        adj[b][a] = 1;
    }

    int visited[9] = {0, 1, 0, 0, 0, 0, 0, 0, 0};
    search(1, visited);

    cout << answer << endl;
}


Compiler output:
a.cc: In function 'void search(int, int*)':
a.cc:22:17: error: 'memcpy' was not declared in this scope
   22 |                 memcpy(newVisited, visited, sizeof(int) * 9);
      |                 ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <numeric>
  +++ |+#include <cstring>
    3 | using namespace std;
a.cc: In function 'int main()':
a.cc:31:5: error: 'memset' was not declared in this scope
   31 |     memset(adj, 0, sizeof(adj));
      |     ^~~~~~
a.cc:31:5: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

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

int n, m;
bool used[10];
vector<int> g[10];

int dfs(int s, int num) {
  if(num == n-1)  {
    //cout << s << endl;
    return 1;
  }

  int ret = 0;
  for(int i=0;i<g[s].size();i++) {
    if(!used[g[s][i]]) {
      used[g[s][i]] = true;
      ret += dfs(g[s][i], num+1);
      used[g[s][i]] = false;
    }
  }
  return ret;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> m;
  vector<int> v(n);
  iota(v.begin(), v.end(), 0);

  for(int i=0;i<n;i++) {
    int ai, bi;
    cin >> ai >> bi;
    ai--;bi--;
    g[ai].push_back(bi);
    g[bi].push_back(ai);
  }

  ll ans = 0;
  memset(used, false, sizseof(used));
  used[0] = true;
  ans += dfs(0, 0);
  /*do {

  } while(next_permutation(v.begin(), v.end());
  */

  cout << ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:23: error: 'sizseof' was not declared in this scope
   42 |   memset(used, false, sizseof(used));
      |                       ^~~~~~~
Language: C++

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

int main() {
  int N,M,i,j;
  int ans=0;
  cin>>N>>M;
  vector<int>a(M),b(M),c(M),r(N);
  for(i=0;i<M;i++){
    cin>>a[i]>>b[i];
    c[i]=a[i]*b[i]*100+a[i]+b[i];
  }
  for(i=0;i<N;i++)r[i]=i+1;
  if(r[0]!=1)continue;
  for(i=0;i<N-1;i++){
    for(j=0;j<M;j++){
      if(r[i]*r[i+1]*100+r[i]+r[i+1]==c[j])break;
    }
    if(j==M)break;
}
if(i==N-1)ans++;
  while(next_permutation(r.begin(),r.end())){
    if(r[0]!=1)continue;
    for(i=0;i<N-1;i++){
      for(j=0;j<M;j++){
        if(r[i]*r[i+1]*100+r[i]+r[i+1]==c[j])break;
      }
      if(j==M)break;
  }
  if(i==N-1)ans++;
}
cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: continue statement not within a loop
   14 |   if(r[0]!=1)continue;
      |              ^~~~~~~~
Language: Java

import java.util.Scanner;

/*
 * AtCoder Beginner Contest 054
 * 2017/02/11
 * C - One-stroke Path
 *
 * https://beta.atcoder.jp/contests/abc054/tasks/abc054_c
 * */
public class OneStrokePath {

	static int[] a, b;
	static int N, M, ans;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		M = sc.nextInt();
		a = new int[M];
		b = new int[M];
		boolean[] flg = new boolean[N];

		for (int i = 0; i < M; i++) {
			a[i] = sc.nextInt() - 1;
			b[i] = sc.nextInt() - 1;
		}

		int now = 0;
		flg[now] = true;
		dfs(now, flg);

		System.out.println(ans);
	}

	public static void dfs(int now, boolean[] flg) {
		for (int i = 0; i < M; i++) {
			if (a[i] == now && !flg[b[i]]) {
				flg[b[i]] = true;
				dfs(b[i], flg);
				flg[b[i]] = false;
			}
			if (b[i] == now && !flg[a[i]]) {
				flg[a[i]] = true;
				dfs(a[i], flg);
				flg[a[i]] = false;
			}
		}

		for ( int i = 0; i < N; i++) {
			if ( flg[i] == false) {
				return;
			}
		}
		ans++;
		return;
	}

}


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

#include <iostream>
#include <list>
using namespace std;
const int nmax = 8;
int N = nmax;
bool graph[nmax][nmax];

int dsf(int v,bool visited[nmax]){
	int i;
	for(i = 0;i < N;++i)if(!visited[i])break;
	if(i == N)return 1;
	int ret=0;
	for (i = 0; i < N; ++i)
	{
		if(visited[i])continue;
		visited[i]=true;
		ret+=dsf(i,visited);
		visited[i]=false;
	}
	return ret;
}

int main(){
	int n,m,a,b;
	
	cin >> N >> m;
	for(int i = 0;i < m;i++){
		cin >> a >> b;
		graph[a - 1][b - 1] = graph[b - 1][a - 1] = true;
	}
	bool visited[max];
	visited[0] = true;
	cout << dsf(0,visited) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:25: error: cannot resolve overloaded function 'max' based on conversion to type 'long unsigned int'
   31 |         bool visited[max];
      |                         ^
a.cc:31:14: error: size of array 'visited' has non-integral type '<unresolved overloaded function type>'
   31 |         bool visited[max];
      |              ^~~~~~~
Language: C++

#include <iostream>
#include <list>
using namespace std;
const int nmax = 8;
int N = nmax;
bool graph[nmax][nmax];

int dsf(int v,bool visited[nmax]){
	int i;
	for(i = 0;i < N;++i)if(!visited[i])break;
	if(i == N)return 1;
	int ret=0;
	for (i = 0; i < N; ++i)
	{
		if(visited[i])continue;
		visited[i]=true;
		ret+=dsf(i,visited);
		visited[i]=false;
	}
	return ret;
}

int main(){
	int n,m,a,b;
	
	cin >> N >> m;
	for(i = 0;i < m;i++){
		cin >> a >> b;
		graph[a - 1][b - 1] = graph[b - 1][a - 1] = true;
	}
	bool visited[max];
	visited[0] = true;
	cout << dsf(0,visited) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:13: error: 'i' was not declared in this scope
   27 |         for(i = 0;i < m;i++){
      |             ^
a.cc:31:25: error: cannot resolve overloaded function 'max' based on conversion to type 'long unsigned int'
   31 |         bool visited[max];
      |                         ^
a.cc:31:14: error: size of array 'visited' has non-integral type '<unresolved overloaded function type>'
   31 |         bool visited[max];
      |              ^~~~~~~
Language: C++

#include <iostream>
#include <list>
using namespace std;
const int nmax = 8
int N = nmax;
bool graph[nmax][nmax];

int dsf(int v,bool visited[nmax]){
	int i;
	for(i = 0;i < N;++i)if(!visited[i])break;
	if(i == N)return 1;
	int ret=0;
	for (i = 0; i < N; ++i)
	{
		if(visited[i])continue;
		visited[i]=true;
		ret+=dsf(i,visited);
		visited[i]=false;
	}
	return ret;
}

int main(){
	int n,m,a,b;
	
	cin >> N >> m;
	for(i = 0;i < m;i++){
		cin >> a >> b;
		graph[a - 1][b - 1] = graph[b - 1][a - 1] = true;
	}
	bool visited[max];
	visited[0] = true;
	cout << dsf(0,visited) << endl;
}

Compiler output:
a.cc:5:1: error: expected ',' or ';' before 'int'
    5 | int N = nmax;
      | ^~~
a.cc: In function 'int dsf(int, bool*)':
a.cc:10:23: error: 'N' was not declared in this scope
   10 |         for(i = 0;i < N;++i)if(!visited[i])break;
      |                       ^
a.cc:11:17: error: 'N' was not declared in this scope
   11 |         if(i == N)return 1;
      |                 ^
a.cc:13:25: error: 'N' was not declared in this scope
   13 |         for (i = 0; i < N; ++i)
      |                         ^
a.cc: In function 'int main()':
a.cc:26:16: error: 'N' was not declared in this scope
   26 |         cin >> N >> m;
      |                ^
a.cc:27:13: error: 'i' was not declared in this scope
   27 |         for(i = 0;i < m;i++){
      |             ^
a.cc:31:25: error: cannot resolve overloaded function 'max' based on conversion to type 'long unsigned int'
   31 |         bool visited[max];
      |                         ^
a.cc:31:14: error: size of array 'visited' has non-integral type '<unresolved overloaded function type>'
   31 |         bool visited[max];
      |              ^~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <string>
#include <cstdlib>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstring>
#include <climits>

using namespace std;

typedef long long ll;
typedef vector<int> ivec;
typedef pair<int, int> ipair;

int N, M;
bool ab[10][10];

int main() {
    int a, b;
    cin >> N >> M;
    memset(ab, 0, sizeof ab);
    for (int i = 0; i < M; i++) {
        cin >> a >> b;
        ab[a-1][b-1] = true;
        ab[b-1][a-1] = true;
    }

    ivec p(N);
    p[0] = 0;
    iota(p.begin() + 1, p.end(), 1);
    int count = 0;
    do {
        count++;
        for (int i = 0; i < N - 1; i++) {
            a = p[i];
            b = p[i+1];
            if (!ab[a][b]) {
                count--;
                break;
            }
        }
    } while (next_permutation(p.begin()+ 1, p.end()));

    cout << count << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:5: error: 'iota' was not declared in this scope
   35 |     iota(p.begin() + 1, p.end(), 1);
      |     ^~~~
Language: C++

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

int main(void) {
    int n, m, ans = 0;
    vector<int> g[8];
    cin >> n >> m;
    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    queue<pair<int, vector<bool>>> que;
    pair<int, vector<bool>> s;
    s.first = 0;
    s.second.resize(8, false);
    que.push(temp);
    while (!que.empty()) {
        auto p = que.front(); que.pop();
        p.second[p.first] = true;
        bool flag = true;
        for (int i = 0; i < n; i++) {
            if (!p.second[i]) {
                flag = false;
                break;
            }
        }
        if (flag) {
            ans++;
            continue;
        }
        for (int i = 0; i < g[p.first].size(); i++) {
            if (!p.second[g[p.first][i]])
                que.push({g[p.first][i], p.second});
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:14: error: 'temp' was not declared in this scope; did you mean 'tm'?
   19 |     que.push(temp);
      |              ^~~~
      |              tm
Language: C++

		int v=p.second;
		if(d[v]<p.first)continue;
		for(int i=0;i<(signed)G[v].size();i++){
			edge e =G[v][i];
			if(d[e.to]>d[v]+e.cost){
				d[e.to]=d[v]+e.cost;
				que.push(P(d[e.to],e.to));
			}
		}
	}
}

int main(){
	cout<<boolalpha;
	cin>>N>>M;
	REP(i,M){
		int a,b;
		cin>>a>>b;
		info[i]=P(a,b);
	}
	REP(Bit,1<<M){//111
		REP(i,10){
			G[i].clear();
		}
		int cost=0;
		for(int i=M-1;0<=i;i--){
            if (__builtin_popcount(Bit)!=N-1)continue;		
            if(Bit&(1<<i)){
				cost++;
				int a=info[i].first;
				int b=info[i].second;
				edge e;
				e.to=b-1,e.cost=1;
				G[a-1].push_back(e);
				e.to=a-1;
				G[b-1].push_back(e);
			}
		}
		Dijkstra(0);
		for(int i=1;i<N;i++){
			if(d[i]==N-1)ans++;
			ARDEB(i,d)END
		}
		DEB("restwe4twtw3t")END
		DEB(G[0].empty())END
	}
	cout<<ans<<endl;
	return 0;
}

    cin>>n>>m;

Compiler output:
a.cc:1:23: error: 'p' was not declared in this scope
    1 |                 int v=p.second;
      |                       ^
a.cc:2:17: error: expected unqualified-id before 'if'
    2 |                 if(d[v]<p.first)continue;
      |                 ^~
a.cc:3:17: error: expected unqualified-id before 'for'
    3 |                 for(int i=0;i<(signed)G[v].size();i++){
      |                 ^~~
a.cc:3:29: error: 'i' does not name a type
    3 |                 for(int i=0;i<(signed)G[v].size();i++){
      |                             ^
a.cc:3:51: error: 'i' does not name a type
    3 |                 for(int i=0;i<(signed)G[v].size();i++){
      |                                                   ^
a.cc:10:9: error: expected declaration before '}' token
   10 |         }
      |         ^
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
a.cc: In function 'int main()':
a.cc:14:9: error: 'cout' was not declared in this scope
   14 |         cout<<boolalpha;
      |         ^~~~
a.cc:14:15: error: 'boolalpha' was not declared in this scope
   14 |         cout<<boolalpha;
      |               ^~~~~~~~~
a.cc:15:9: error: 'cin' was not declared in this scope
   15 |         cin>>N>>M;
      |         ^~~
a.cc:15:14: error: 'N' was not declared in this scope
   15 |         cin>>N>>M;
      |              ^
a.cc:15:17: error: 'M' was not declared in this scope
   15 |         cin>>N>>M;
      |                 ^
a.cc:16:13: error: 'i' was not declared in this scope
   16 |         REP(i,M){
      |             ^
a.cc:16:9: error: 'REP' was not declared in this scope
   16 |         REP(i,M){
      |         ^~~
a.cc:21:13: error: 'Bit' was not declared in this scope
   21 |         REP(Bit,1<<M){//111
      |             ^~~
a.cc:47:15: error: 'ans' was not declared in this scope
   47 |         cout<<ans<<endl;
      |               ^~~
a.cc:47:20: error: 'endl' was not declared in this scope
   47 |         cout<<ans<<endl;
      |                    ^~~~
a.cc: At global scope:
a.cc:51:5: error: 'cin' does not name a type
   51 |     cin>>n>>m;
      |     ^~~
Language: C++

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

int main() {
  int N, M;
  cin >> N >> M;
  bool path[N][N];
  memset(path,false,sizeof(path));
  for (int i=0; i<M; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    path[a][b]=true;
    path[b][a]=true;
  }
  int vertex[N];
  for (int i=0; i<N; i++) {
    vertex[i]=i;
  }
  int ans=0;
  do {
    if (vertex[0]!=0) {
      continue;
    }
    for (int i=0; i<N-1; i++) {
      if (!path[vertex[i]][vertex[i+1]]) {
        break;
      }
      if (i==N-2) {
        ans++;
      }
    }
  } while (next_permutation(vertex,vertex+N));
  cout << ans << endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'memset' was not declared in this scope
    9 |   memset(path,false,sizeof(path));
      |   ^~~~~~
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 | #include <string>
a.cc:35:12: error: 'next_permutation' was not declared in this scope
   35 |   } while (next_permutation(vertex,vertex+N));
      |            ^~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  bool path[N][N];
  memset(path,false,sizeof(path));
  for (int i=0; i<M; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    path[a][b]=true;
    path[b][a]=true;
  }
  int vertex[N];
  for (int i=0; i<N; i++) {
    vertex[i]=i;
  }
  int ans=0;
  do {
    if (vertex[0]!=0) {
      continue;
    }
    for (int i=0; i<N-1; i++) {
      if (!path[vertex[i]][vertex[i+1]]) {
        break;
      }
      if (i==N-2) {
        ans++;
      }
    }
  } while (next_permutation(vertex,vertex+N));
  cout << ans << endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'memset' was not declared in this scope
    8 |   memset(path,false,sizeof(path));
      |   ^~~~~~
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;
a.cc:34:12: error: 'next_permutation' was not declared in this scope
   34 |   } while (next_permutation(vertex,vertex+N));
      |            ^~~~~~~~~~~~~~~~
Language: C++

#include <algorithm>
#include <cctype>
#include <complex>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>

using std::cin;
using std::cout;
using std::endl;

using std::string;
using std::to_string;
using std::vector;
using std::set;
using std::queue;
using std::priority_queue;

using std::min;
using std::max;
using std::sort;
using std::abs;

bool solve(int n, const vector<vector<bool>>& g, const vector<int>& p) {
    int me = 0;
    for (int i = 0; i < n - 1; i++) {
        if (!g[me][p[i]]) {
            return false;
        }
        me = p[i];
    }
    return true;
}

int main(void) {
    int n, m;
    cin >> n >> m;

    vector<vector<bool>> g(n, vector<bool>(n));
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        g[a - 1][b - 1] = true;
        g[b - 1][a - 1] = true;
    }

    int cnt = 0;
    vector<int> p(n - 1);
    std::iota(p.begin(), p.end(), 1);
    do {
        if (solve(n, g, p)) {
            cnt++;
        }
    } while (std::next_permutation(p.begin(), p.end()));

    cout << cnt << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:10: error: 'iota' is not a member of 'std'
   52 |     std::iota(p.begin(), p.end(), 1);
      |          ^~~~
Language: C++

#include <algorithm>
#include <cctype>
#include <complex>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>

using std::cin;
using std::cout;
using std::endl;

using std::string;
using std::to_string;
using std::vector;
using std::set;
using std::queue;
using std::priority_queue;

using std::min;
using std::max;
using std::sort;
using std::abs;

bool solve(int n, const vector<vector<bool>>& g, const vector<int>& p) {
    int me = 0;
    for (int i = 0; i < n - 1; i++) {
        if (!g[me][p[i]]) {
            return false;
        }
        me = p[i];
    }
    return true;
}

int main(void) {
    int n, m;
    cin >> n >> m;

    vector<vector<bool>> g(n, vector<bool>(n));
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        g[a - 1][b - 1] = true;
        g[b - 1][a - 1] = true;
    }

    int cnt = 0;
    vector<int> p(n - 1);
    iota(p.begin(), p.end(), 1);
    do {
        if (solve(n, g, p)) {
            cnt++;
        }
    } while (std::next_permutation(p.begin(), p.end()));

    cout << cnt << endl;

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:52:5: error: 'iota' was not declared in this scope
   52 |     iota(p.begin(), p.end(), 1);
      |     ^~~~
Language: C++

#include <algorithm>
#include <cctype>
#include <complex>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>

using std::cin;
using std::cout;
using std::endl;

using std::string;
using std::to_string;
using std::vector;
using std::set;
using std::queue;
using std::priority_queue;

using std::min;
using std::max;
using std::sort;
using std::abs;

bool solve(int n, const vector<vector<bool>>& g, const vector<int>& p) {
    int me = 0;
    for (int i = 0; i < n - 1; i++) {
        if (!g[me][p[i]]) {
            return false;
        }
        me = p[i];
    }
    return true;
}

int main(void) {
    int n, m;
    cin >> n >> m;

    vector<vector<bool>> g(n, vector<bool>(n));
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        g[a - 1][b - 1] = true;
        g[b - 1][a - 1] = true;
    }

    int cnt = 0;
    vector<int> p(n - 1);
    iota(p.begin(), p.end(), 1);
    do {
        if (solve(n, g, p)) {
            cnt++;
        }
    } while (std::next_permutation(p.begin(), p.end()));

    cout << cnt << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:5: error: 'iota' was not declared in this scope
   52 |     iota(p.begin(), p.end(), 1);
      |     ^~~~
Language: C++

{-# LANGUAGE FlexibleContexts, OverloadedStrings #-}
import Control.Applicative
import Control.Monad
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)
import Data.List
import Text.Printf
import Debug.Trace

istour g [_] = 1
istour g (x:y:ys) = if [x,y] `elem` g
                    then istour g (y:ys)
                    else 0

main = do
  [n,m] <- getInts
  es <- replicateM m $ getInts
  let g = es ++ map (\(x:y:_) -> [y,x]) es
  print $ sum $ map (istour g) $ map (1:) $ permutations [2..n]


-- util
getInts :: IO [Int]
getInts = map (fst . fromJust . B.readInt) . B.words <$> B.getLine

substr :: Int -> Int -> B.ByteString -> B.ByteString
substr b l s = B.take l $ B.drop b s


Compiler output:
a.cc:1:3: error: stray '#' in program
    1 | {-# LANGUAGE FlexibleContexts, OverloadedStrings #-}
      |   ^
a.cc:1:50: error: stray '#' in program
    1 | {-# LANGUAGE FlexibleContexts, OverloadedStrings #-}
      |                                                  ^
a.cc:11:30: error: stray '`' in program
   11 | istour g (x:y:ys) = if [x,y] `elem` g
      |                              ^
a.cc:11:35: error: stray '`' in program
   11 | istour g (x:y:ys) = if [x,y] `elem` g
      |                                   ^
a.cc:18:22: error: stray '\' in program
   18 |   let g = es ++ map (\(x:y:_) -> [y,x]) es
      |                      ^
a.cc:19:59: error: too many decimal points in number
   19 |   print $ sum $ map (istour g) $ map (1:) $ permutations [2..n]
      |                                                           ^~~~
a.cc:1:1: error: expected unqualified-id before '{' token
    1 | {-# LANGUAGE FlexibleContexts, OverloadedStrings #-}
      | ^
a.cc:2:1: error: 'import' does not name a type
    2 | import Control.Applicative
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
Language: Java

import org.junit.Test;
 
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
 
public class Main {
    static int n;
    static boolean[][] connected;
 
    static public int countPattern(int pos, Set<Integer> visited) {
        if (visited.size() == n) return 1;
 
        int count = 0;
        for (int i = 0; i < n; i++) {
            if (connected[pos][i] && !visited.contains(i)) {
                visited.add(i);
                count += countPattern(i, visited);
                visited.remove(i);
            }
        }
        return count;
    }
 
    static public void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        int m = sc.nextInt();
 
        connected = new boolean[n][n];
        for (int i = 0; i < m; i++) {
            int a = sc.nextInt() - 1;
            int b = sc.nextInt() - 1;
 
            connected[a][b] = true;
            connected[b][a] = true;
        }
 
        Set<Integer> visited = new HashSet<>();
        visited.add(0);
        int count = countPattern(0, visited);
        System.out.println(count);
    }
 
    @Test
    public void test() {
        Main m = new Main();
    }
}

Compiler output:
Main.java:1: error: package org.junit does not exist
import org.junit.Test;
                ^
Main.java:45: error: cannot find symbol
    @Test
     ^
  symbol:   class Test
  location: class Main
2 errors
Language: Java


import org.junit.Test;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
    static int n;
    static boolean[][] connected;

    static public int countPattern(int pos, Set<Integer> visited) {
        if (visited.size() == n) return 1;

        int count = 0;
        for (int i = 0; i < n; i++) {
            if (connected[pos][i] && !visited.contains(i)) {
                visited.add(i);
                count += countPattern(i, visited);
                visited.remove(i);
            }
        }
        return count;
    }

    static public void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        int m = sc.nextInt();

        connected = new boolean[n][n];
        for (int i = 0; i < m; i++) {
            int a = sc.nextInt() - 1;
            int b = sc.nextInt() - 1;

            connected[a][b] = true;
            connected[b][a] = true;
        }

        Set<Integer> visited = new HashSet<>();
        visited.add(0);
        int count = countPattern(0, visited);
        System.out.println(count);
    }

    @Test
    public void test() {
        Main m = new Main();
    }
}

Compiler output:
Main.java:2: error: package org.junit does not exist
import org.junit.Test;
                ^
Main.java:46: error: cannot find symbol
    @Test
     ^
  symbol:   class Test
  location: class Main
2 errors
Language: Java

package atcoder.beginnercontest.abc054.c;

import org.junit.Test;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
    static int n;
    static boolean[][] connected;

    static public int countPattern(int pos, Set<Integer> visited) {
        if (visited.size() == n) return 1;

        int count = 0;
        for (int i = 0; i < n; i++) {
            if (connected[pos][i] && !visited.contains(i)) {
                visited.add(i);
                count += countPattern(i, visited);
                visited.remove(i);
            }
        }
        return count;
    }

    static public void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        int m = sc.nextInt();

        connected = new boolean[n][n];
        for (int i = 0; i < m; i++) {
            int a = sc.nextInt() - 1;
            int b = sc.nextInt() - 1;

            connected[a][b] = true;
            connected[b][a] = true;
        }

        Set<Integer> visited = new HashSet<>();
        visited.add(0);
        int count = countPattern(0, visited);
        System.out.println(count);
    }

    @Test
    public void test() {
        Main m = new Main();
    }
}

Compiler output:
Main.java:3: error: package org.junit does not exist
import org.junit.Test;
                ^
Main.java:47: error: cannot find symbol
    @Test
     ^
  symbol:   class Test
  location: class Main
2 errors