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

#include <iostream>
#include<sstream>
#include<vector>
#include<iterator>
using namespace std;

void wfs(int pos, int& cnt, vector<bool> hist, const vector<vector<bool>>& table)
{
	hist[pos] = true;
	if(count(hist.begin(), hist.end(), false) == 0)
	{
		cnt++;
		return;
	}

	for(int i=1; i<table[pos].size(); i++)
	{
		if(table[pos][i] != true || hist[i] != false)
			continue;

		wfs(i, cnt, hist, table);
	}
}

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

	vector<vector<bool>> table(N, vector<bool>(N, false));
	for(int i=0; i<M; i++)
	{
		int a, b;
		cin >> a >> b;

		a--;
		b--;

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

	int ret = 0;
	wfs(0, ret, vector<bool>(N, false), table);

	cout << ret << endl;

	return 0;
}


Compiler output:
a.cc: In function 'void wfs(int, int&, std::vector<bool>, const std::vector<std::vector<bool> >&)':
a.cc:10:12: error: 'count' was not declared in this scope; did you mean 'cnt'?
   10 |         if(count(hist.begin(), hist.end(), false) == 0)
      |            ^~~~~
      |            cnt
Language: C++

#include <bits/stdc++.h>
#include "example.h"
using namespace std;
// Powered by caide (code generator, tester, and library code inliner)


class Solution {
  int n, m;
  vector<int> edge[8];
public:
  int dfs(int now, int bits)
  {
    if (bits & 1 << now) return 0;
    bits |= 1 << now;
    if (bits + 1 == (1 << n)) return 1;
    int res = 0;
    for(auto&& i : edge[now]) {
      if (bits & 1 << i) { continue; }
      res += dfs(i, bits);
    }
    return res;
  }

  void solve(std::istream& in, std::ostream& out)
  {
    in >> n >> m;
    for(int i = 0; i < m; i++) {
      int a, b;
      in >> a >> b;
      edge[--a].push_back(--b);
      edge[b].push_back(a);
    }
    out << dfs(0, 0) << "\n";
    for(int i = 0; i < n; i++) {
      edge[i].clear();
    }
  }
};

void solve(std::istream& in, std::ostream& out)
{
  out << std::setprecision(12);
  Solution solution;
  solution.solve(in, out);
}


Compiler output:
a.cc:2:10: fatal error: example.h: No such file or directory
    2 | #include "example.h"
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include"bits/stdc++.h"
//#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define print(x) cout<<x<<endl;
typedef long long ll;

int n, m;
int a[30], b[30];
bool exist = 0;
int cnt = 0;
bool check(bool flag[8]) {
	int c = 0;
	rep(i, 0, n) {
		if (flag[i] == 1)c += 1;
	}
	if (c == n)return 1;
	return 0;
}

bool is(int now, bool flag[8]) {
	int next[8] = { -1,-1,-1,-1,-1,-1,-1,-1, };
	flag[now] = 1;
	if (check(flag))return 1;
	rep(i, 0, m) {
		if (a[i] == now)next[i] = b[i];
		if (b[i] == now)next[i] = a[i];
	}
	rep(i, 0, m) {
		if (next[i] != -1 && flag[next[i]] == 0) { exist = is(next[i], flag); }
		if (exist)cnt += 1; return 1;
		flag[next[i]] = 0;
	}
	return 0;
}

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 <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
const int MAXN = 15;
const int MAXCASE = 25;
vector<int> m[MAXN];
int n, p;
int sum;
int vis[MAXN];
int judge[MAXN][MAXN];
void dfs(int cot,int num)
{
    if(num == n)
    {
        sum++;
        return;
    }
    for(int i = 0;i < m[cot].size();i++)
    {
        if(vis[m[cot][i]] == 0)
        {
            vis[m[cot][i]] = 1;
            dfs(m[cot][i],num + 1);
            vis[m[cot][i]] = 0;
        }
    }
}
int main()
{
    int Test, numCase = 0;
    //cin >> Test;
    while(cin >> n >> p)
    {

        assert(2 <= n && n <= 8);
        assert(1 <= p && p <= n * (n - 1) / 2);

        memset(judge, 0, sizeof(judge));
        numCase++;
        for(int i=1;i<=p;i++)
        {
            int v,u;
            cin >> v >> u;
            m[v].push_back(u);
            m[u].push_back(v);

            assert(1 <= v && v <= n);
            assert(1 <= u && u <= n);
            assert(u != v && judge[u][v] == judge[v][u] && judge[u][v] == 0);
            judge[u][v] = judge[v][u] = 1;
        }

        sum = 0;
        vis[1] = 1;
        dfs(1, 1);
        cout << sum << endl;
    }
    assert(numCase == MAXCASE);
    return 0;
}


Compiler output:
a.cc:8:1: error: 'vector' does not name a type
    8 | vector<int> m[MAXN];
      | ^~~~~~
a.cc: In function 'void dfs(int, int)':
a.cc:20:23: error: 'm' was not declared in this scope
   20 |     for(int i = 0;i < m[cot].size();i++)
      |                       ^
a.cc: In function 'int main()':
a.cc:37:9: error: 'assert' was not declared in this scope
   37 |         assert(2 <= n && n <= 8);
      |         ^~~~~~
a.cc:5:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    4 | #include <algorithm>
  +++ |+#include <cassert>
    5 | using namespace std;
a.cc:46:13: error: 'm' was not declared in this scope
   46 |             m[v].push_back(u);
      |             ^
a.cc:60:5: error: 'assert' was not declared in this scope
   60 |     assert(numCase == MAXCASE);
      |     ^~~~~~
a.cc:60:5: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
Language: C++

// 簡易競プロテンプレ
#include <bits/stdc++.h>
using namespace std;
int n, m;
int f[8][8];
int a,b;
int main(void){
 cin >> n >> m;
 for(int i=0;i<m;i++){cin >> a >> b; f[a-1][b-1] = f[b-1][a-1] = 1;}
 vector<int> p(n);
 for(int i=0;i<n;i++) p[i] = i;
 int ans = 0;
 do{
  if (p[0]!=0) continue;
  int ok = 1;
  for(int i=0;i+1<n;i++){if (f[p[i]][p[i+1]]==0) ok = 0;}
  if (ok) ans++;
 }while(next_permutation(p.begin(), p.end());
 cout << ans << endl;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:45: error: expected ')' before ';' token
   18 |  }while(next_permutation(p.begin(), p.end());
      |        ~                                    ^
      |                                             )
Language: C++

// 簡易競プロテンプレ
#include <bits/stdc++.h>
using namespace std;
int n, m;
int f[8][8];
int a,b;
int main(void){
 cin >> n >> m;
 for(int i=0;i<m;i++){cin >> a >> b; f[a-1][b-1] = f[b-1][a-1] = 1;}
 vector<int> p(n);
 for(int i=0;i<n;i++) p[i] = i;
 int ans = 0;
 do{
  if (p[i]!=0) continue;
  int ok = 1;
  for(int i=0;i+1<n;i++){if (f[p[i]][p[i+1]]==0) ok = 0;}
  if (ok) ans++;
 }while(next_permutation(p.begin(), p.end());
 cout << ans << endl;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'i' was not declared in this scope
   14 |   if (p[i]!=0) continue;
      |         ^
a.cc:18:45: error: expected ')' before ';' token
   18 |  }while(next_permutation(p.begin(), p.end());
      |        ~                                    ^
      |                                             )
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <queue>

using namespace std;

class Node
{
public:
	vector<int> visited;
	int count;
	int cur_pos;
	Node(int n_){
		count = 0;
		visited = vector<int>(n_, 0);
	}
};

class oneStrokePath
{
private:
	int n, m;
	vector<vector<int> > adj;
public:
	oneStrokePath(){
		cin >> n >> m;
		adj.resize(n);
		for (int i = 0; i < n; ++i)
		{
			adj[i].resize(n);
			for (int j = 0; j < n; ++j)
			{
				adj[i][j] = 0;
			}
		}

		for (int i = 0; i < m; ++i)
		{
			int tmp_a, tmp_b;
			cin >> tmp_a >> tmp_b;
			tmp_a--;
			tmp_b--;
			adj[tmp_a][tmp_b] = 1;
			adj[tmp_b][tmp_a] = 1;
		}
	}
	void execute();
};

void oneStrokePath::execute(){
	queue<Node> q;
	Node start = Node(n);
	start.visited[0] = 1;
	start.count = 1;
	start.cur_pos = 0;
	q.push(start);
	int ans = 0;
	while(!q.empty()){
		Node cur = q.front();
		q.pop();
		if(cur.count == n) ans++;
		for (int i = 0; i < n; ++i)
		{
			if(adj[cur_pos][i] == 1 && cur.visited[i] == 0){
				Node next = cur;
				next.visited[i] = 1;
				next.count++;
				next.cur_pos = i;
				q.push(next);
			}
		}
	}
	cout << ans << endl;
}

int main(){
	oneStrokePath osp = oneStrokePath();
	osp.execute();
}


Compiler output:
a.cc: In member function 'void oneStrokePath::execute()':
a.cc:65:32: error: 'cur_pos' was not declared in this scope
   65 |                         if(adj[cur_pos][i] == 1 && cur.visited[i] == 0){
      |                                ^~~~~~~
Language: Java

import java.util.*;

public class Main {
  static int count = 0;

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int[][] edge = new int[N][N];
    for(int i = 0; i < M; i++) {
      int a = sc.nextInt();
      int b = sc.nextInt();
      edge[a - 1][b - 1] = 1;
      edge[b - 1][a - 1] = 1;
    }
    dfs(N, edge, 0, new ArrayList<Integer>());
    System.out.println(count);
  }

  public static void dfs(int n, int[][] edge, int mask, ArrayList<Integer> list) {
    if(list.size() == n) {
      boolean flg = true;
      for(int i = 0; i < n - 1; i++) {
        if(edge[list.get(i)][list.get(i + 1)] == 0) {
          flg = false;
          break;
        }
      }
      if(flg) count++;
    } else {
      for(int j = 0; j < n; j++) {
        if(mask & (1 << j) == 0) {
          ArrayList<Integer> list2 = (ArrayList<Integer>)list.clone();
          list2.add(j);
          dfs(n, edge, mask + (1 << j), list2);
        }
      }
    }
  }
}

Compiler output:
Main.java:33: error: bad operand types for binary operator '&'
        if(mask & (1 << j) == 0) {
                ^
  first type:  int
  second type: boolean
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C++

#include<iostream>
using namespace std;


int main(void){

	int N,Ma,Mb;
	cin>>N>>Ma>>Mb;

	//それぞれ物質Aの含有量,Bの含有量,値段の合計の最大値
	const int amax=400;
	const int bmax=400;
	const int pmax=100000;

	//リストを作成してすべてを最大値に初期化
	int list[N+1][amax+1][bmax+1];
	for(int i=0;i<N+1;i++){
		for(int a=0;a<amax+1;a++){
			for(int b=0;b<bmax+1;b++){
				list[i][a][b]=pmax;
			}
		}
	}

	//物質AもBもないのは何も買わず、コストも0
	for(int i=0;i<=N;i++){
		list[i][0][0]=0;
	}

	//動的計画法のメイン部分
	int a,b,p;
	for(int i=1;i<=N;i++){

		cin>>a>>b>>p;
		for(int anow=0;anow<=amax;anow++){
			for(int bnow=0;bnow<=bmax;bnow++){
				if(anow<a || bnow<b) list[i][anow][bnow]=list[i-1][anow][bnow];
				else list[i][anow][bnow]=min(list[i-1][anow-a][bnow-b]+p,list[i-1][anow][bnow])
			}
		}


	}



	int cost=pmax;
	for(a=1;a<=bmax;a++){
		for(b=1;b<=bmax;b++){
			if(a*Mb==b*Ma&&list[N][a][b]<cost) cost=list[N][a][b];
		}
	}

	if(cost==pmax) cost=-1;
	cout<<cost<<endl;

	return 0;

}






Compiler output:
a.cc: In function 'int main()':
a.cc:38:112: error: expected ';' before '}' token
   38 |                                 else list[i][anow][bnow]=min(list[i-1][anow-a][bnow-b]+p,list[i-1][anow][bnow])
      |                                                                                                                ^
      |                                                                                                                ;
   39 |                         }
      |                         ~
Language: C++

#include<iostream>
using namespace std;


int main(void){

	int N,Ma,Mb;
	cin>>N>>Ma>>Mb;

	//それぞれ物質Aの含有量,Bの含有量,値段の合計の最大値
	const int amax=400;
	const int bmax=400;
	const int pmax=100000;

	//リストを作成してすべてを最大値に初期化
	int list[N+1][amax+1][bmax+1];
	for(int i=0;i<N+1;i++){
		for(int a=0;a<amax+1;a++){
			for(int b=0;b<bmax+1;b++){
				list[i][a][b]=pmax;
			}
		}
	}

	//物質AもBもないのは何も買わず、コストも0
	for(int i=0;i<=N;i++){
		list[i][0][0]=0;
	}

	//動的計画法のメイン部分
	int a,b,p;
	for(int i=1;i<=N;i++){

		cin>>a>>b>>p;
		for(int anow=0;anow<=amax;anow++){
			for(int bnow=0;bnow<=bmax;bnow++){
				if(anow<a || bnow<b) list[i][anow][bnow]=list[i-1][anow][bnow];
				else list[i][anow][bnow]=min(list[i-1][anow-a][bnow-b]+p,list[i-1][anow][bnow])
			}
		}


	}

		for(int anow=a;anow<=amax;anow++){
			for(int bnow=b;bnow<=bmax;bnow++){
				cout<<list[i][anow][bnow];
			}
			cout<<endl;
		}


	int cost=pmax;
	for(a=1;a<=bmax;a++){
		for(b=1;b<=bmax;b++){
			if(a*Mb==b*Ma&&list[N][a][b]<cost) cost=list[N][a][b];
		}
	}

	if(cost==pmax) cost=-1;
	cout<<cost<<endl;

	return 0;

}






Compiler output:
a.cc: In function 'int main()':
a.cc:38:112: error: expected ';' before '}' token
   38 |                                 else list[i][anow][bnow]=min(list[i-1][anow-a][bnow-b]+p,list[i-1][anow][bnow])
      |                                                                                                                ^
      |                                                                                                                ;
   39 |                         }
      |                         ~                                                                                       
a.cc:47:44: error: 'i' was not declared in this scope
   47 |                                 cout<<list[i][anow][bnow];
      |                                            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
template <class ForwardIterator, class T>
  void iota (ForwardIterator first, ForwardIterator last, T val)
{
  while (first!=last) {
    *first = val;
    ++first;
    ++val;
  }
}
int g[11][11];
int main()
{
    int n,m,x,y,res=0;
    cin>>n>>m;
    vector<int> island(n);
    iota(island.island(),p.end(),0);
    
    for(int i=0;i<m;i++){
        cin>>x>>y;
        g[x-1][y-1] = g[y-1][x-1] = 1;
    }
    do{
        bool flag = true;
        if(island[0])break;//始点が0の時のみ考える
        for(int i=1;i<n;i++){
            if(!g[island[i-1]][island[i]])flag=false;//つながってない
        }
        if(flag)res++;
    }while(next_permutation(island.begin(),island.end()));
    cout<<res<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'class std::vector<int>' has no member named 'island'
   18 |     iota(island.island(),p.end(),0);
      |                 ^~~~~~
a.cc:18:26: error: 'p' was not declared in this scope
   18 |     iota(island.island(),p.end(),0);
      |                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
template <class ForwardIterator, class T>
  void iota (ForwardIterator first, ForwardIterator last, T val)
{
  while (first!=last) {
    *first = val;
    ++first;
    ++val;
  }
}
int g[11][11]={0};
int main()
{
    int n,m,x,y,res=0;
    cin>>n>>m;
    vector<int> island(n);
    iota(island.island(),p.end(),0);
    
    for(int i=0;i<m;i++){
        cin>>x>>y;
        g[x-1][y-1] = g[y-1][x-1] = 1;
    }
    do{
        bool flag = true;
        if(island[0])break;//始点が0の時のみ考える
        for(int i=1;i<n;i++){
            if(!g[island[i-1]][island[i]])flag=false;//つながってない
        }
        if(flag)res++;
    }while(next_permutation(island.begin(),island.end()));
    cout<<res<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'class std::vector<int>' has no member named 'island'
   18 |     iota(island.island(),p.end(),0);
      |                 ^~~~~~
a.cc:18:26: error: 'p' was not declared in this scope
   18 |     iota(island.island(),p.end(),0);
      |                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
template <class ForwardIterator, class T>
  void iota (ForwardIterator first, ForwardIterator last, T val)
{
  while (first!=last) {
    *first = val;
    ++first;
    ++val;
  }
}
int g[11][11];
int main()
{
    int n,m,x,y,res=0;
    cin>>n>>m;
    vector<int> p(n);
    iota(p.begin(),p.end(),0);
    
    for(int i=0;i<m;i++){
        cin>>x>>y;
        g[x-1][y-1] = g[y-1][x-1] = 1;
    }
    do{
        bool flag = true;
        if(p[0])break;//視点が1の時はbreak
        for(int i=1;i<n;i++){
            if(!g[p[i-1]][p[i]])flag=false;//つながってない
        }
        if(flag)res++;
    }while(next_permutation(p.begin(),p.end()));
    cout<<res<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: call of overloaded 'iota(std::vector<int>::iterator, std::vector<int>::iterator, int)' is ambiguous
   18 |     iota(p.begin(),p.end(),0);
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~
a.cc:4:8: note: candidate: 'void iota(ForwardIterator, ForwardIterator, T) [with ForwardIterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; T = int]'
    4 |   void iota (ForwardIterator first, ForwardIterator last, T val)
      |        ^~~~
In file included from /usr/include/c++/14/numeric:62,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_numeric.h:88:5: note: candidate: 'void std::iota(_ForwardIterator, _ForwardIterator, _Tp) [with _ForwardIterator = __gnu_cxx::__normal_iterator<int*, vector<int> >; _Tp = int]'
   88 |     iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value)
      |     ^~~~
Language: C++

#include <iostream>
#include <vector>

int* E;
int N, M;
int eval(int ind,std::vector<int>& route)
{
	if (route.size() == N)
		return 1;

	int ans = 0;



	for (int i = 0; i < N; i++)
	{
		std::vector<int> route_n = route;

		if (!E[ind*N + i])
			continue;

		std::vector<int>::iterator iter = std::find(route.begin(), route.end(), i);

		if (iter != route.end())
			continue;

		route_n.push_back(i);

		ans += eval(i, route_n);
	}

	return ans;
}

int main()
{


	std::cin >> N >> M;

	E = new int[N*N];

	std::fill(E, E + N*N, 0);

	for (int i = 0; i < M; i++)
	{
		int a, b;

		std::cin >> a >> b;

		E[(a-1)*N + b-1] = E[(b-1)*N + a-1] = 1;
	}

	std::vector<int> route;
	route.push_back(0);

	int ans = eval(0,route);
	
	std::cout << ans << std::endl;

	return 0;
}

Compiler output:
a.cc: In function 'int eval(int, std::vector<int>&)':
a.cc:22:60: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   22 |                 std::vector<int>::iterator iter = std::find(route.begin(), route.end(), i);
      |                                                   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:22:60: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   22 |                 std::vector<int>::iterator iter = std::find(route.begin(), route.end(), i);
      |                                                   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>

int* E;
int N, M;
int eval(int ind,const std::vector<int>& route)
{
	if (route.size() == N)
		return 1;

	int ans = 0;



	for (int i = 0; i < N; i++)
	{
		std::vector<int> route_n = route;

		if (!E[ind*N + i])
			continue;

		std::vector<int>::const_iterator iter = std::find(route.cbegin(), route.cend(), i);

		if (iter != route.cend())
			continue;

		route_n.push_back(i);

		ans += eval(i, route_n);
	}

	return ans;
}

int main()
{


	std::cin >> N >> M;

	E = new int[N*N];

	std::fill(E, E + N*N, 0);

	for (int i = 0; i < M; i++)
	{
		int a, b;

		std::cin >> a >> b;

		E[(a-1)*N + b-1] = E[(b-1)*N + a-1] = 1;
	}

	std::vector<int> route;
	route.push_back(0);

	int ans = eval(0,route);
	
	std::cout << ans << std::endl;

	return 0;
}

Compiler output:
a.cc: In function 'int eval(int, const std::vector<int>&)':
a.cc:22:66: error: no matching function for call to 'find(std::vector<int>::const_iterator, std::vector<int>::const_iterator, int&)'
   22 |                 std::vector<int>::const_iterator iter = std::find(route.cbegin(), route.cend(), i);
      |                                                         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:22:66: note:   '__gnu_cxx::__normal_iterator<const int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   22 |                 std::vector<int>::const_iterator iter = std::find(route.cbegin(), route.cend(), i);
      |                                                         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>

int* E;
int N, M;
int eval(int ind,const std::vector<int>& route)
{
	if (route.size() == N)
		return 1;

	int ans = 0;



	for (int i = 0; i < N; i++)
	{
		std::vector<int> route_n = route;

		if (!E[ind*N + i])
			continue;

		std::vector<int>::const_iterator iter = std::find(route.cbegin(), route.cend(), i);

		if (iter != route.end())
			continue;

		route_n.push_back(i);

		ans += eval(i, route_n);
	}

	return ans;
}

int main()
{


	std::cin >> N >> M;

	E = new int[N*N];

	std::fill(E, E + N*N, 0);

	for (int i = 0; i < M; i++)
	{
		int a, b;

		std::cin >> a >> b;

		E[(a-1)*N + b-1] = E[(b-1)*N + a-1] = 1;
	}

	std::vector<int> route;
	route.push_back(0);

	int ans = eval(0,route);
	
	std::cout << ans << std::endl;

	return 0;
}

Compiler output:
a.cc: In function 'int eval(int, const std::vector<int>&)':
a.cc:22:66: error: no matching function for call to 'find(std::vector<int>::const_iterator, std::vector<int>::const_iterator, int&)'
   22 |                 std::vector<int>::const_iterator iter = std::find(route.cbegin(), route.cend(), i);
      |                                                         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:22:66: note:   '__gnu_cxx::__normal_iterator<const int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   22 |                 std::vector<int>::const_iterator iter = std::find(route.cbegin(), route.cend(), i);
      |                                                         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main()
{
	int N, M, a, b;
	cin >> N >> M;

	vector<vector<int>> arr(N);
	for (int i = 0; i < M; i++) {
		cin >> a >> b;
		arr[a - 1].push_back(b - 1);
		arr[b - 1].push_back(a - 1);
	}

	queue<vector<int>> roots;
	roots.push(vector<int>{ 0 });

	int cnt = 0;
	while (!roots.empty()) {
		auto root = roots.front();
		roots.pop();

		for (int val : arr[root.back()]) {
			if (find(root.begin(), root.end(), val) == root.end()) {
				vector<int> newRoot(root);
				newRoot.push_back(val);

				if (newRoot.size() == N)
					cnt++;
				else
					roots.push(newRoot);
			}
		}
	}

	cout << cnt << endl;

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:28:33: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   28 |                         if (find(root.begin(), root.end(), val) == root.end()) {
      |                             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:28:33: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   28 |                         if (find(root.begin(), root.end(), val) == root.end()) {
      |                             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main()
{
	int N, M, a, b;
	cin >> N >> M;

	vector<vector<int>> arr(N);
	for (int i = 0; i < M; i++) {
		cin >> a >> b;
		arr[a - 1].push_back(b - 1);
		arr[b - 1].push_back(a - 1);
	}

	queue<vector<int>> roots;
	roots.push(vector<int>{ 0 });
	
	int cnt = 0;
	while (!roots.empty()) {
		auto root = roots.front();
		roots.pop();

		for each(int val in arr[root.back()]) {
			if (find(root.begin(), root.end(), val) == root.end()) {
				vector<int> newRoot(root);
				newRoot.push_back(val);

				if (newRoot.size() == N)
					cnt++;
				else
					roots.push(newRoot);
			}
		}
	}

	cout << cnt << endl;

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:27:21: error: expected '(' before 'each'
   27 |                 for each(int val in arr[root.back()]) {
      |                     ^~~~
      |                     (
a.cc:27:26: error: expected primary-expression before 'int'
   27 |                 for each(int val in arr[root.back()]) {
      |                          ^~~
a.cc:27:21: error: 'each' was not declared in this scope
   27 |                 for each(int val in arr[root.back()]) {
      |                     ^~~~
a.cc:38:9: error: expected primary-expression before '}' token
   38 |         }
      |         ^
a.cc:37:18: error: expected ';' before '}' token
   37 |                 }
      |                  ^
      |                  ;
   38 |         }
      |         ~         
a.cc:38:9: error: expected primary-expression before '}' token
   38 |         }
      |         ^
a.cc:37:18: error: expected ')' before '}' token
   37 |                 }
      |                  ^
      |                  )
   38 |         }
      |         ~         
a.cc:27:21: note: to match this '('
   27 |                 for each(int val in arr[root.back()]) {
      |                     ^~~~
a.cc:38:9: error: expected primary-expression before '}' token
   38 |         }
      |         ^
Language: C

#include<cstdio>
#include<cstring>
int vis[10],map[10][10],n,m;
int dfs(int x)
{
	int i;
	for(i=1;i<=n;i++)
	if(vis[i]!=1)
	break;
	if(i==n+1)
	return 1;
	for(i=1;i<=n;i++)
	if(map[x][i]==1&&vis[i]==0)
	{
		vis[i]=1;
		dfs(i);
		vis[i]=0;
	}
}
int main()
{
	int sum,i,j,x,y;
	while(scanf("%d%d",&n,&m)!=EOF)
	{
		memset(map,0,sizeof(map));
		memset(vis,0,sizeof(vis));
		for(i=1;i<=m;i++)
		{
			scanf("%d%d",&x,&y);
			map[x][y]=1;
			map[y][x]=1;
		}
		vis[1]=1;
		sum=0;
		for(i=2;i<=n;i++)
		{
			if(map[1][i]==1)
			{
			vis[i]=1;
			j=dfs(i);
			vis[i]=0;
			if(j!=0)
			sum=sum+1;
		}
		}
		printf("%d\n",sum);
	}
	return 0;
}

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

#include <iostream>
#define REP(i, a, n) for(int (i) = (a); (i) <= (n); (i)++)
using namespace std;

int N, M, E[10][10];

bool is_valid(int* order) {
  REP(i, 1, N) cout << order[i] << " ";
  cout << "]" << endl;

  REP(i, 1, N - 1) {
    if(!E[order[i]][order[i + 1]]) return false;
  }
  return true;
}

int main(void) {
  cin >> N >> M;
  REP(i, 1, N) REP(j, 1, N) E[i][j] = 0;
  REP(i, 1, M) {
    int a, b; cin >> a >> b;
    E[a][b] = 1;
    E[b][a] = 1;
  }

  int order[10];
  REP(i, 1, N) order[i] = i;

  long cnt = 0;
  do {
    if(is_valid(order)) cnt++;
  } while(next_permutation(order + 2, order + N + 1));

  cout << cnt << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:11: error: 'next_permutation' was not declared in this scope
   32 |   } while(next_permutation(order + 2, order + N + 1));
      |           ^~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

struct Vertice{
	int neighbors[8];
	int neighbor_count;
};

int N, M;
Vertice vertices[8];

int main(){
	
	int a, b;
	cin >> N >> M;
	
	while(true) {
		cin >> a;
		if(a == '\0') break;
		cin >> b;
		vertices[a].neighbors[b] = 1;
		vertices[a].neighbor_count += 1;
	}

	cout << BFS(1, 0);



	return 0;	
}


int BFS(int a, int lenght) {

	if (lenght == N) return 1;
	int answer = 0;
	for (int i = 0; i < vertices[a].neighbor_count; i++)
	{
		if (vertices[a].neighbors[i] == 1) {
			lenght += 1;
			answer += BFS(i, lenght);
		}
	}
	return answer;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: 'BFS' was not declared in this scope
   25 |         cout << BFS(1, 0);
      |                 ^~~
Language: C++

#include <iostream>
using namespace std;

struct Vertice{
	int neighbors[8];
	int neighbor_count;
};

int N, M;
Vertice vertices[8];

int main(){
	
	int a, b;
	cin >> N >> M;
	
	while(true) {
		cin >> a;
		if(a == NULL) break;
		cin >> b;
		vertices[a].neighbors[b] = 1;
		vertices[a].neighbor_count += 1;
	}

	cout << BFS(1, 0);



	return 0;	
}


int BFS(int a, int lenght) {

	if (lenght == N) return 1;
	int answer = 0;
	for (int i = 0; i < vertices[a].neighbor_count; i++)
	{
		if (vertices[a].neighbors[i] == 1) {
			lenght += 1;
			answer += BFS(i, lenght);
		}
	}
	return answer;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: warning: NULL used in arithmetic [-Wpointer-arith]
   19 |                 if(a == NULL) break;
      |                         ^~~~
a.cc:25:17: error: 'BFS' was not declared in this scope
   25 |         cout << BFS(1, 0);
      |                 ^~~
Language: C++

#include <iostream>
using namespace std;

struct Vertice{
	int neighbors[8];
	int neighbor_count;
}

int N, M;
Vertice vertices[N];

int main(){
	
	int a, b;
	cin >> N >> M;
	
	while(true) {
		cin >> a;
		if(a == null) break;
		cin >> b;
		vertices[a].neighbors[b] = 1;
		vertices[a].neighbor_count += 1;
	}

	cout << BFS(1, 0);



	return 0;	
}


int BFS(int a, int lenght) {

	if (lenght == N) return 1;
	int answer = 0;
	for (int i = 0; i < vertices[a].neighbor_count; i++)
	{
		if (vertices[a].neighbors[i] == 1) {
			lenght += 1;
			answer += BFS(i, lenght);
		}
	}
	return answer;
}


Compiler output:
a.cc:7:2: error: expected ';' after struct definition
    7 | }
      |  ^
      |  ;
a.cc:10:18: error: size of array 'vertices' is not an integral constant-expression
   10 | Vertice vertices[N];
      |                  ^
a.cc: In function 'int main()':
a.cc:19:25: error: 'null' was not declared in this scope
   19 |                 if(a == null) break;
      |                         ^~~~
a.cc:25:17: error: 'BFS' was not declared in this scope
   25 |         cout << BFS(1, 0);
      |                 ^~~
Language: Java

import java.util.*;

public class Main {
  int[] p = new int[10];
  static int count = 0;
  static int[][] edge;
  static int N;
  static int M;
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    N = sc.nextInt();
    M = sc.nextInt();
    edge = new int[N][N];
    for(int i = 0; i < M; i++) {
      int a = sc.nextInt();
      int b = sc.nextInt();
      edge[a - 1][b - 1] = 1;
      edge[b - 1][a - 1] = 1;
    }
  dfs(1, (1 << N) - 2);
  System.out.println(count);
  }
  public void dfs(int pos, int mask) {
    if(pos == N) {
      int c = 0;
      for(int i = 0; i < N - 1; i++) {
        if(edge[p[i]][p[i + 1]] == 0) {
          c++;
          break;
        }
      }
        if(c == 0) count++;
      }
    for(int i = 0; i < N; i++) {
      if(mask & (1 << i) != 0) {
        p[pos] = i;
        dfs(pos + 1, (mask ^ (1 << i)));
      }
    }
  }
}

Compiler output:
Main.java:20: error: non-static method dfs(int,int) cannot be referenced from a static context
  dfs(1, (1 << N) - 2);
  ^
Main.java:35: error: bad operand types for binary operator '&'
      if(mask & (1 << i) != 0) {
              ^
  first type:  int
  second type: boolean
2 errors
Language: Java

import java.util.*;

public class Main {
  int[] p = new int[10];
  int count = 0;
  static int[][] edge;
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    edge = new int[N][N];
    for(int i = 0; i < M; i++) {
      int a = sc.nextInt();
      int b = sc.nextInt();
      edge[a - 1][b - 1] = 1;
      edge[b - 1][a - 1] = 1;
    }
  dfs(1, (1 << N) - 2);
  System.out.println(count);
  }
  public static void dfs(int pos, int mask) {
    if(pos == N) {
      int c = 0;
      for(int i = 0; i < N - 1; i++) {
        if(edge[p[i]][p[i + 1]] == 0) {
          c++;
          break;
        }
      }
        if(c == 0) count++;
      }
    for(int i = 0; i < N; i++) {
      if(mask & (1 << i) != 0) {
        p[pos] = i;
        dfs(pos + 1, (mask ^ (1 << i)));
      }
    }
  }
}

Compiler output:
Main.java:19: error: non-static variable count cannot be referenced from a static context
  System.out.println(count);
                     ^
Main.java:22: error: cannot find symbol
    if(pos == N) {
              ^
  symbol:   variable N
  location: class Main
Main.java:24: error: cannot find symbol
      for(int i = 0; i < N - 1; i++) {
                         ^
  symbol:   variable N
  location: class Main
Main.java:25: error: non-static variable p cannot be referenced from a static context
        if(edge[p[i]][p[i + 1]] == 0) {
                ^
Main.java:25: error: non-static variable p cannot be referenced from a static context
        if(edge[p[i]][p[i + 1]] == 0) {
                      ^
Main.java:30: error: non-static variable count cannot be referenced from a static context
        if(c == 0) count++;
                   ^
Main.java:32: error: cannot find symbol
    for(int i = 0; i < N; i++) {
                       ^
  symbol:   variable N
  location: class Main
Main.java:33: error: bad operand types for binary operator '&'
      if(mask & (1 << i) != 0) {
              ^
  first type:  int
  second type: boolean
Main.java:34: error: non-static variable p cannot be referenced from a static context
        p[pos] = i;
        ^
9 errors
Language: Java

import java.util.*;

public class Main {
  int[] p = new int[10];
  int count = 0;
  int[][] edge;
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    edge = new int[N][N];
    for(int i = 0; i < M; i++) {
      int a = sc.nextInt();
      int b = sc.nextInt();
      edge[a - 1][b - 1] = 1;
      edge[b - 1][a - 1] = 1;
    }
  dfs(1, (1 << N) - 2);
  System.out.println(count);
  }
  public static void dfs(int pos, int mask) {
    if(pos == N) {
      int c = 0;
      for(int i = 0; i < N - 1; i++) {
        if(edge[p[i]][p[i + 1]] == 0) {
          c++;
          break;
        }
      }
        if(c == 0) count++;
      }
    for(int i = 0; i < N; i++) {
      if(mask & (1 << i) != 0) {
        p[pos] = i;
        dfs(pos + 1, (mask ^ (1 << i)));
      }
    }
  }
}

Compiler output:
Main.java:11: error: non-static variable edge cannot be referenced from a static context
    edge = new int[N][N];
    ^
Main.java:15: error: non-static variable edge cannot be referenced from a static context
      edge[a - 1][b - 1] = 1;
      ^
Main.java:16: error: non-static variable edge cannot be referenced from a static context
      edge[b - 1][a - 1] = 1;
      ^
Main.java:19: error: non-static variable count cannot be referenced from a static context
  System.out.println(count);
                     ^
Main.java:22: error: cannot find symbol
    if(pos == N) {
              ^
  symbol:   variable N
  location: class Main
Main.java:24: error: cannot find symbol
      for(int i = 0; i < N - 1; i++) {
                         ^
  symbol:   variable N
  location: class Main
Main.java:25: error: non-static variable edge cannot be referenced from a static context
        if(edge[p[i]][p[i + 1]] == 0) {
           ^
Main.java:25: error: non-static variable p cannot be referenced from a static context
        if(edge[p[i]][p[i + 1]] == 0) {
                ^
Main.java:25: error: non-static variable p cannot be referenced from a static context
        if(edge[p[i]][p[i + 1]] == 0) {
                      ^
Main.java:30: error: non-static variable count cannot be referenced from a static context
        if(c == 0) count++;
                   ^
Main.java:32: error: cannot find symbol
    for(int i = 0; i < N; i++) {
                       ^
  symbol:   variable N
  location: class Main
Main.java:33: error: bad operand types for binary operator '&'
      if(mask & (1 << i) != 0) {
              ^
  first type:  int
  second type: boolean
Main.java:34: error: non-static variable p cannot be referenced from a static context
        p[pos] = i;
        ^
13 errors
Language: Java

import java.util.*;

public class Main {
  int[] p = new int[10];
  int count = 0;
  int[][] edge;
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    edge = new int[N][N];
    for(int i = 0; i < M; i++) {
      int a = sc.nextInt();
      int b = sc.nextInt();
      edge[a - 1][b - 1] = 1;
      edge[b - 1][a - 1] = 1;
    }
  }
  dfs(1, (1 << N) - 2);
  System.out.println(count);
  }
  public static void dfs(int pos, int mask) {
    if(pos == N) {
      int c = 0;
      for(int i = 0; i < N - 1; i++) {
        if(edge[p[i]][p[i + 1]] == 0) {
          c++;
          break;
        }
      }
        if(c == 0) count++;
      }
    for(int i = 0; i < N; i++) {
      if(mask & (1 << i) != 0) {
        p[pos] = i;
        dfs(pos + 1, (mask ^ (1 << i)));
      }
    }
  }
}

Compiler output:
Main.java:19: error: invalid method declaration; return type required
  dfs(1, (1 << N) - 2);
  ^
Main.java:19: error: illegal start of type
  dfs(1, (1 << N) - 2);
      ^
Main.java:20: error: <identifier> expected
  System.out.println(count);
                    ^
Main.java:20: error: <identifier> expected
  System.out.println(count);
                          ^
Main.java:22: error: unnamed classes are a preview feature and are disabled by default.
  public static void dfs(int pos, int mask) {
                ^
  (use --enable-preview to enable unnamed classes)
Main.java:40: error: class, interface, enum, or record expected
}
^
6 errors
Language: Java

import java.util.*;

public class Main {
  int[] p = new int[10];
  int count = 0;
  int[][] edge;
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    edge = new int[N][N];
    for(int i = 0; i < M; i++) {
      int a = sc.nextInt();
      int b = sc.nextInt();
      edge[a - 1][b - 1] = 1;
      edge[b - 1][a - 1] = 1;
    }
  }
  dfs(1, (1 << N) - 2);
  System.out.println(count);
  }
  public void dfs(int pos, int mask) {
    if(pos == N) {
      int c = 0;
      for(int i = 0; i < N - 1; i++) {
        if(edge[p[i]][p[i + 1]] == 0) {
          c++;
          break;
        }
      }
        if(c == 0) count++;
      }
    for(int i = 0; i < N; i++) {
      if(mask & (1 << i) != 0) {
        p[pos] = i;
        dfs(pos + 1, (mask ^ (1 << i)));
      }
    }
  }
}

Compiler output:
Main.java:19: error: invalid method declaration; return type required
  dfs(1, (1 << N) - 2);
  ^
Main.java:19: error: illegal start of type
  dfs(1, (1 << N) - 2);
      ^
Main.java:20: error: <identifier> expected
  System.out.println(count);
                    ^
Main.java:20: error: <identifier> expected
  System.out.println(count);
                          ^
Main.java:22: error: unnamed classes are a preview feature and are disabled by default.
  public void dfs(int pos, int mask) {
         ^
  (use --enable-preview to enable unnamed classes)
Main.java:40: error: class, interface, enum, or record expected
}
^
6 errors
Language: Java

import java.util.*;

public class Main {
  int[] p;
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    p = new int[N];
    int[][] edge = new int[N][N];
    for(int i = 0; i < M; i++) {
      int a = sc.nextInt();
      int b = sc.nextInt();
      edge[a - 1][b - 1] = 1;
      edge[b - 1][a - 1] = 1;
    }
  }
    System.out.println(dfs(1, (1 << N) - 2));
  }
  int count = 0;
  public void dfs(int pos, int mask) {
      if(pos == N) {
        int c = 0;
        for(int i = 0; i < N - 1; i++) {
          if(edge[p[i]][p[i + 1]] == 0) {
            c++;
            break;
          }
        }
        if(c == 0) count++;
      }
      for(int i = 0; i < N; i++) {
        if(mask & (1 << i) != 0) {
          p[pos] = i;
          dfs(pos + 1, (mask ^ (1 << i)));
        }
      }
    }
}

Compiler output:
Main.java:18: error: <identifier> expected
    System.out.println(dfs(1, (1 << N) - 2));
                      ^
Main.java:18: error: <identifier> expected
    System.out.println(dfs(1, (1 << N) - 2));
                          ^
Main.java:20: error: unnamed classes are a preview feature and are disabled by default.
  int count = 0;
  ^
  (use --enable-preview to enable unnamed classes)
Main.java:39: error: class, interface, enum, or record expected
}
^
4 errors
Language: Java

import java.util.*;

public class Main {
  int[] p = new int[N];
  Scanner sc = new Scanner(System.in);
  int N = sc.nextInt();
  int M = sc.nextInt();
  int[][] edge = new int[N][N];
  for(int i = 0; i < M; i++) {
    int a = sc.nextInt();
    int b = sc.nextInt();
    edge[a - 1][b - 1] = 1;
    edge[b - 1][a - 1] = 1;
  }
    System.out.println(dfs(1, (1 << N) - 2));
  }
  int count = 0;
  public void dfs(int pos, int mask) {
      if(pos == N) {
        int c = 0;
        for(int i = 0; i < N - 1; i++) {
          if(edge[p[i]][p[i + 1]] == 0) {
            c++;
            break;
          }
        }
        if(c == 0) count++;
      }
      for(int i = 0; i < N; i++) {
        if(mask & (1 << i) != 0) {
          p[pos] = i;
          dfs(pos + 1, (mask ^ (1 << i)));
        }
      }
    }
}

Compiler output:
Main.java:9: error: illegal start of type
  for(int i = 0; i < M; i++) {
  ^
Main.java:9: error: > or ',' expected
  for(int i = 0; i < M; i++) {
                      ^
Main.java:9: error: <identifier> expected
  for(int i = 0; i < M; i++) {
                         ^
Main.java:15: error: <identifier> expected
    System.out.println(dfs(1, (1 << N) - 2));
                      ^
Main.java:15: error: <identifier> expected
    System.out.println(dfs(1, (1 << N) - 2));
                          ^
Main.java:17: error: unnamed classes are a preview feature and are disabled by default.
  int count = 0;
  ^
  (use --enable-preview to enable unnamed classes)
Main.java:36: error: class, interface, enum, or record expected
}
^
7 errors
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int[][] edge = new int[N][N];
    for(int i = 0; i < M; i++) {
      int a = sc.nextInt();
      int b = sc.nextInt();
      edge[a - 1][b - 1] = 1;
      edge[b - 1][a - 1] = 1;
    }
    int[] p = new int[N];
    int count = 0;
    public void dfs(int pos, int mask) {
      if(pos == N) {
        int c = 0;
        for(int i = 0; i < N - 1; i++) {
          if(edge[p[i]][p[i + 1]] == 0) {
            c++;
            break;
          }
        }
        if(c == 0) count++;
      }
      for(int i = 0; i < N; i++) {
        if(mask & (1 << i) != 0) {
          p[pos] = i;
          dfs(pos + 1, (mask ^ (1 << i)));
        }
      }
    }
    System.out.println(dfs(1, (1 << N) - 2));
  }
}

Compiler output:
Main.java:17: error: illegal start of expression
    public void dfs(int pos, int mask) {
    ^
Main.java:35: error: <identifier> expected
    System.out.println(dfs(1, (1 << N) - 2));
                      ^
Main.java:35: error: <identifier> expected
    System.out.println(dfs(1, (1 << N) - 2));
                          ^
Main.java:37: error: class, interface, enum, or record expected
}
^
4 errors
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

/**
 * Created by guoxiang.li on 2017/02/13.
 */
public class Main {

    private int count=0;
    private ArrayList[] graph;
    boolean[] visited;
    public int undirectedGraphTraversalWays(int[][] nums,int n){

       graph=new ArrayList[n];

        for(int i=0;i<n;i++){
            graph[i]=new ArrayList();
        }

        visited=new boolean[n];

        for(int i=0;i<nums.length;i++){
            graph[nums[i][0]-1].add(nums[i][1]-1);
            graph[nums[i][1]-1].add(nums[i][0]-1);
        }


        visited[0]=true;
        undirectedGraphTraversalWaysHelper(graph[0]);
        return count;

    }


    private boolean undirectedGraphTraversalWaysHelper(ArrayList nodes){


        boolean flag=true;
        for(boolean visitedFlag:visited){
            flag&=visitedFlag;
        }

        if(flag){
            return true;
        }


        for(Object node:nodes){

            int index=((Integer) node).intValue();

            if(visited[index]){
                continue;
            }
            visited[index]=true;

            if(undirectedGraphTraversalWaysHelper(graph[index])){
                count++;
            }

            visited[index]=false;
        }

        return false;



    }

    public static void main(String[] args) {



         sol=new ();
        Scanner sc = new Scanner(System.in);
        // get a integer
        int n = sc.nextInt();
        // get two integers separated with half-width break
        int m = sc.nextInt();

        int[][] edges=new int[m][2];
        for(int i=0;i<m;i++) {
            edges[i][0] = sc.nextInt();
            edges[i][1] = sc.nextInt();
        }

        System.out.println(sol.undirectedGraphTraversalWays(edges,n));


    }


}


Compiler output:
Main.java:74: error: <identifier> expected
         sol=new ();
                ^
1 error