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

#include<stdio.h>

#define MAX_N 100000

int n;
int w;
int a[MAX_N];

int main(void)
{
	int num;
	int i, flag;
	
	scanf( "%d", &n );
	
	num = 0;
	while( n-- ) {
		scanf( "%d", &w );
		
		flag = 0;
		for( i=0; i<=num; i++ ) {
			if ( flag == 1 ) {
				a[i-1] = a[i];
			else if ( a[i] == w ) {
				flag = 1;
			}
		}
		
		if ( flag == 0 ) [
			a[i + 1] = w;
			num++;
		}
		else {
			num--;
		}
	}
	
	printf( "%d\n", num );
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:25: error: expected '}' before 'else'
   24 |                         else if ( a[i] == w ) {
      |                         ^~~~
main.c:29:34: error: expected expression before '[' token
   29 |                 if ( flag == 0 ) [
      |                                  ^
main.c:30:37: error: expected ']' before ';' token
   30 |                         a[i + 1] = w;
      |                                     ^
      |                                     ]
main.c:31:31: error: expected ';' before '}' token
   31 |                         num++;
      |                               ^
      |                               ;
   32 |                 }
      |                 ~              
main.c:33:17: error: 'else' without a previous 'if'
   33 |                 else {
      |                 ^~~~
main.c: At top level:
main.c:38:17: error: expected declaration specifiers or '...' before string constant
   38 |         printf( "%d\n", num );
      |                 ^~~~~~
main.c:38:25: error: unknown type name 'num'; did you mean 'enum'?
   38 |         printf( "%d\n", num );
      |                         ^~~
      |                         enum
main.c:40:9: error: expected identifier or '(' before 'return'
   40 |         return 0;
      |         ^~~~~~
main.c:41:1: error: expected identifier or '(' before '}' token
   41 | }
      | ^
Language: C++

#include <iostream>
using namespace std;
 
int main(){
    int N;
    int A;
    vector<int> all(0);
    int if_ok;
    cin >> N;
    for(int i = 0; i < N; i += 1){
    	if_ok = 1;
    	cin >> A;
    	for(int i2 = 0; i2 < int(all.size()); i2 += 1){
    		if(all[i2] == A){
    			if_ok = 0;
    		}
    		if(if_ok == 1){
		    	N.push_back(A);
    		}
    	}
    }
    cout << int(all.size()) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int> all(0);
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> all(0);
      |            ^~~
a.cc:13:34: error: 'all' was not declared in this scope; did you mean 'atoll'?
   13 |         for(int i2 = 0; i2 < int(all.size()); i2 += 1){
      |                                  ^~~
      |                                  atoll
a.cc:18:27: error: request for member 'push_back' in 'N', which is of non-class type 'int'
   18 |                         N.push_back(A);
      |                           ^~~~~~~~~
a.cc:22:17: error: 'all' was not declared in this scope; did you mean 'atoll'?
   22 |     cout << int(all.size()) << endl;
      |                 ^~~
      |                 atoll
Language: C++

#include <iostream>
using namespace std;
 
int main(){
    int N;
    int A;
    vector<int> all(0);
    int if_ok;
    cin >> N;
    for(int i = 0; i < N; i += 1){
    	if_ok = 1;
    	cin >> A;
    	for(int i2 = 0; i2 < all.size(); i2 += 1){
    		if(all[i2] == A){
    			if_ok = 0;
    		}
    		if(if_ok == 1){
		    	N.push_back(A);
    		}
    	}
    }
    cout << all.size() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int> all(0);
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> all(0);
      |            ^~~
a.cc:13:30: error: 'all' was not declared in this scope; did you mean 'atoll'?
   13 |         for(int i2 = 0; i2 < all.size(); i2 += 1){
      |                              ^~~
      |                              atoll
a.cc:18:27: error: request for member 'push_back' in 'N', which is of non-class type 'int'
   18 |                         N.push_back(A);
      |                           ^~~~~~~~~
a.cc:22:13: error: 'all' was not declared in this scope; did you mean 'atoll'?
   22 |     cout << all.size() << endl;
      |             ^~~
      |             atoll
Language: C++

#include<iostream>
void swap(long &a,long &b){
  long c=a;
  a=b;
  b=c;
}
int main(){
  long n,a[123456];
  cin>>n;
  for(int i=0;i<n;i++)
    cin>a[i];
  for(int i=0;i<n-1;i++)
    for(int j=i+1;j<n;j++)
      if(a[i]>a[j])
        swap(a[i],a[j]);
  int dem=0;
  for(int i=0;i<n;i++){
    int dem2=1;
    while(a[dem2+i]==a[i])
      dem2++;
    i=i+dem2-1;
    dem+=(dem2%2);
  }
  cout<<dem;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:24:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   24 |   cout<<dem;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

int main (void){
    int i,j;
    int wa = 0; 
    int n;
    long long a[105000] = {0};
    int count;

    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%lld",&a[i]);
    }
    sort(a,a+n);
    i=0;
    while(i<n){
        if(a[i] != a[i+1]){
            wa++;
            i++;
            count = 0;
        }else{
            count++;
            if(count % 2 == 1){
                wa--;
            }else{
                wa++;
            }
            i++;
        }
    }
   

    printf("%d\n",wa);

    return 0;
}

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

#include <stdio.h>

int comp(const void *a,const void *b){
    return *(int *)a-*(int *)b;
}

main(){
    int N;
    scanf("%d",&N);
    int p[N];
    int i=0;
    while(i<N)scanf("%d",&p[i++]);

    qsort(p,N,sizeof(int),comp);
    int n=-1;
    int sum=0;
    for(i=0;i<N;i++){
        if(n!=p[i]){
            n=p[i];
            sum++;
        }else{
            n=-1;
            sum--;
        }
    }
    printf("%d\n",sum);
    return 0;
}

Compiler output:
a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:14:5: error: 'qsort' was not declared in this scope
   14 |     qsort(p,N,sizeof(int),comp);
      |     ^~~~~
Language: C++

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

int main(void) {
    int n,a;
    vector<int> v;
    cin >> n;
    for (int i=0; i<n; i++) {
        cin >> a;
        auto itr = find(v.begin(), v.end(), a);
        if (itr == v.end()) {
            v.push_back(a);
        } else {
            v.erase(itr);
        }
    }
    cout << v.size() << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   11 |         auto itr = find(v.begin(), v.end(), a);
      |                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~
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:11:24: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   11 |         auto itr = find(v.begin(), v.end(), a);
      |                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
 
using namespace std;
#define SIZE 1000000000
 
int main(){
    int n;
    unsigned int a;
    vector<unsigned long int> num;
    vector<unsigned long int>::iterator itr;
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> a;
        itr = find(num.begin(), num.end(), a);
        if(itr != num.end()){
            num.erase(itr);
        }else{
            num.push_back(a);
        }
    }

    cout << num.size() << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: no matching function for call to 'find(std::vector<long unsigned int>::iterator, std::vector<long unsigned int>::iterator, unsigned int&)'
   15 |         itr = find(num.begin(), num.end(), a);
      |               ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
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:15:19: note:   '__gnu_cxx::__normal_iterator<long unsigned int*, std::vector<long unsigned int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   15 |         itr = find(num.begin(), num.end(), a);
      |               ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
bool num[1000000000 + 3];

int main() {
	int N = 0;
	cin >> N;

	for (int i = 0; i < 100000000 + 3; i++)
		num[i] = false;

	int A = 0;
  int max = 0;
	for (int i = 0; i < N; i++) {
		cin >> A;
		num[A] = !num[A];
    if(max < A)
      max = A+
	}

	int total = 0;
	for (int i = 0; i <= max; i++)
		if (num[i])
			total++;

	cout << total << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: expected primary-expression before '}' token
   19 |         }
      |         ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int N;
vector<int> A;

int main()
{
	cin >> N;
	for (int i = 0; i < N; i++){
		int buf;
		cin >> buf;
		
		auto itr = find(A.begin(), A.end(), buf);
		if (itr == A.end()){
			A.push_back(buf);
		} else {
			A.erase(itr);
		}
	}
	
	cout << A.size() << endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:32: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   16 |                 auto itr = find(A.begin(), A.end(), buf);
      |                            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
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:16:32: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   16 |                 auto itr = find(A.begin(), A.end(), buf);
      |                            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int N;
vector<int> A;

int main()
{
	cin >> N;
	for (int i = 0; i < N; i++){
		int buf;
		cin >> buf;
		
		vector<int>::iterator itr = find(A.begin(), A.end(), buf);
		if (itr == A.end()){
			A.push_back(buf);
		} else {
			A.erase(itr);
		}
	}
	
	cout << A.size() << endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:49: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   16 |                 vector<int>::iterator itr = find(A.begin(), A.end(), buf);
      |                                             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
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:16:49: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   16 |                 vector<int>::iterator itr = find(A.begin(), A.end(), buf);
      |                                             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Language: C

#include <stdio.h>

int main(void)
{
    int n;
    scanf("%d", &n);
    int a;
    int i;
    int b[n];
    for (i = 0; i < n; i++)
        b[i] = 0;

    for (i = 0; i < n; i++) {
        scanf("%d", &a);
        b[a] = !b[a]
    }
    int sum = 0;
    for (i = 0; i < n; i++)
        if (b[i])
            sum++;
    printf("%d\n", sum);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:21: error: expected ';' before '}' token
   15 |         b[a] = !b[a]
      |                     ^
      |                     ;
   16 |     }
      |     ~
Language: C++

#include <iostream>
using namespace std;
 
int main(void){
    int N;
    int A;
    int all[0] = [];
    bool if_ok;
    cin >> N;
    for(int i = 0; i < N; i += 1){
    	if_ok = true;
    	cin >> A;
    	for(int i2 = 0; i2 < all.size(); i2 += 1){
    		if(all[i2] == A){
    			if_ok = false;
    		}
    		if(if_ok){
		    	N.push_back(A);
    		}
    	}
    }
    cout << all.size() << endl;
	return 0;
}

Compiler output:
a.cc: In lambda function:
a.cc:7:20: error: expected '{' before ';' token
    7 |     int all[0] = [];
      |                    ^
a.cc: In function 'int main()':
a.cc:7:18: error: array must be initialized with a brace-enclosed initializer
    7 |     int all[0] = [];
      |                  ^~
a.cc:13:34: error: request for member 'size' in 'all', which is of non-class type 'int [0]'
   13 |         for(int i2 = 0; i2 < all.size(); i2 += 1){
      |                                  ^~~~
a.cc:18:27: error: request for member 'push_back' in 'N', which is of non-class type 'int'
   18 |                         N.push_back(A);
      |                           ^~~~~~~~~
a.cc:22:17: error: request for member 'size' in 'all', which is of non-class type 'int [0]'
   22 |     cout << all.size() << endl;
      |                 ^~~~
Language: C++

#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	int n;
	long long a[100010];
	cin>>n;
	for (int i=1;i<=n;i++)
	 scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	int j=0,ans=n;
	while (j<=n){
		j++;
		if (a[j]==a[j+1]) {
			ans-=2;
			j++;
		}
	}
	cout<<ans;
	return 0;
	
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin>>n;
      |         ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<algorithm>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:19:9: error: 'cout' was not declared in this scope
   19 |         cout<<ans;
      |         ^~~~
a.cc:19:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>
using namespace std;
 
int main(void){
    int N;
    int A;
    int all[] = [];
    bool if_ok;
    cin >> N;
    for(int i = 0; i < N; i += 1){
    	ok = true;
    	cin >> A;
    	for(int i2 = 0; i2 < all.size(); i2 += 1){
    		if(all[i2] == A){
    			if_ok = false;
    		}
    		if(if_ok){
		    	N.push_back(A);
    		}
    	}
    }
    cout << all.size() << endl;
	return 0;
}

Compiler output:
a.cc: In lambda function:
a.cc:7:19: error: expected '{' before ';' token
    7 |     int all[] = [];
      |                   ^
a.cc: In function 'int main()':
a.cc:7:17: error: initializer fails to determine size of 'all'
    7 |     int all[] = [];
      |                 ^~
a.cc:7:17: error: array must be initialized with a brace-enclosed initializer
a.cc:11:9: error: 'ok' was not declared in this scope
   11 |         ok = true;
      |         ^~
a.cc:13:34: error: request for member 'size' in 'all', which is of non-class type 'int [1]'
   13 |         for(int i2 = 0; i2 < all.size(); i2 += 1){
      |                                  ^~~~
a.cc:18:27: error: request for member 'push_back' in 'N', which is of non-class type 'int'
   18 |                         N.push_back(A);
      |                           ^~~~~~~~~
a.cc:22:17: error: request for member 'size' in 'all', which is of non-class type 'int [1]'
   22 |     cout << all.size() << endl;
      |                 ^~~~
Language: C++

#include <iostream>
using namespace std;
 
int main(void){
    int N;
    int A;
    int all[] = [];
    bool if_ok;
    cin >> N;
    for(int i = 0; i < N; i += 1){
    	ok = true;
    	cin >> A;
    	for(int i2 = 0; i2 < all.size(); i2 += 1){
    		if(all[i2] == A){
    			if_ok = false;
    		}
    		if(if_ok){
		    	N.pushback(A);
    		}
    	}
    }
    cout << all.size() << endl;
	return 0;
}

Compiler output:
a.cc: In lambda function:
a.cc:7:19: error: expected '{' before ';' token
    7 |     int all[] = [];
      |                   ^
a.cc: In function 'int main()':
a.cc:7:17: error: initializer fails to determine size of 'all'
    7 |     int all[] = [];
      |                 ^~
a.cc:7:17: error: array must be initialized with a brace-enclosed initializer
a.cc:11:9: error: 'ok' was not declared in this scope
   11 |         ok = true;
      |         ^~
a.cc:13:34: error: request for member 'size' in 'all', which is of non-class type 'int [1]'
   13 |         for(int i2 = 0; i2 < all.size(); i2 += 1){
      |                                  ^~~~
a.cc:18:27: error: request for member 'pushback' in 'N', which is of non-class type 'int'
   18 |                         N.pushback(A);
      |                           ^~~~~~~~
a.cc:22:17: error: request for member 'size' in 'all', which is of non-class type 'int [1]'
   22 |     cout << all.size() << endl;
      |                 ^~~~
Language: C++

// #!/usr/bin/env c

#include <bits/stdc++.h>

using namespace std;
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define pb push_back
define int long long


signed main(){


	int n;
	cin>>n;
	int count=0;
	int ans=0;
	int a[n];

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

	sort(a,a+n);
	// for(int i=0;i<n;i++){
	// 	cout<<a[i]<<" ";
	// }cout<<endl;

	for(int i=0;i<n-1;i++){
		if(a[i]!=a[i+1]){
			if(count%2==0)ans++;
			count=0;
		}else{
			count++;
		}
	}

	cout<<ans<<endl;

	
}

Compiler output:
a.cc:9:1: error: 'define' does not name a type
    9 | define int long long
      | ^~~~~~
Language: C

#include<stdio.h>
int K[10000000];
int N, a;
int i, sum;

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

  for(i = 0; i < N; i++){
    scanf("%d", &a);
    K[a] ^= 1;
  }
  sum = 0;
  for(i = 0l i < N; i++){
   sum += K[i];
  }
  puts(sum);
    
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:13: error: expected ';' before 'i'
   14 |   for(i = 0l i < N; i++){
      |             ^~
      |             ;
main.c:14:24: error: expected ';' before ')' token
   14 |   for(i = 0l i < N; i++){
      |                        ^
      |                        ;
main.c:17:8: error: passing argument 1 of 'puts' makes pointer from integer without a cast [-Wint-conversion]
   17 |   puts(sum);
      |        ^~~
      |        |
      |        int
In file included from main.c:1:
/usr/include/stdio.h:714:30: note: expected 'const char *' but argument is of type 'int'
  714 | extern int puts (const char *__s);
      |                  ~~~~~~~~~~~~^~~
Language: C++

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,sse4,popcnt,abm,mmx")
 
#include <bits/stdc++.h>
#define pb push_back
#define pp pop_back()
#define mp make_pair
#define f first
#define s second
#define y1 asafsaf
#define kz ios_base::sync_with_stdio(NULL); cin.tie(NULL); cout.tie(NULL);
using namespace std;
typedef pair <int, int> pii;
typedef vector <int> vi;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
 
const int N = 3e5 + 111, inf = 1e9, mod = 1e9 + 7;
const ll linf = 1e18;
const double pi = acos(-1.0);

int n;
set <int> s;
 
int main(){
    cin >> n;
    for(int i = 1; i <= n; ++i){
        int x;
        scanf("%d", &x);
        if(s.find(x))
            s.erase(x);
        else s.insert(x);
    }
    cout << s.size();
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:18: error: could not convert 'second.std::set<int>::find(x)' from 'std::set<int>::iterator' {aka 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator'} to 'bool'
   31 |         if(s.find(x))
      |                  ^
      |                  |
      |                  std::set<int>::iterator {aka std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator}
Language: C++

#include <iostream>
#include <algorithm>

#define MAX 1e9

using namespace std;

int main() {
  int n;
  cin >> n;
  int a[MAX];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  int ans = 0;
  int currCount = 1;
  for (int i = 1; i < n; ++i)
    if (a[i] == a[i - 1])
      ++currCount;
    else {
      if (currCount % 2 == 1)
        ++ans;
      currCount = 1;
    }
  if (currCount % 2 == 1)
    ++ans;
  cout << ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:13: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    4 | #define MAX 1e9
      |             ^~~
a.cc:11:9: note: in expansion of macro 'MAX'
   11 |   int a[MAX];
      |         ^~~
a.cc:4:13: error: could not convert '1.0e+9' from 'double' to 'long unsigned int'
    4 | #define MAX 1e9
      |             ^~~
      |             |
      |             double
a.cc:11:9: note: in expansion of macro 'MAX'
   11 |   int a[MAX];
      |         ^~~
a.cc:4:13: error: size of array 'a' has non-integral type 'double'
    4 | #define MAX 1e9
      |             ^~~
a.cc:11:9: note: in expansion of macro 'MAX'
   11 |   int a[MAX];
      |         ^~~
Language: Java

import java.util.Scanner;

public class Main {

    Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().compute();
    }

    void compute() {
        int N = scanner.nextInt();
        ArrayList<Integer> used = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            int current = scanner.nextInt();
            if(used.contains(current)){
                used.remove(new Integer(current));
            }else{
                used.add(current);
            }
        }
        System.out.println(used.size());
    }
}


Compiler output:
Main.java:13: error: cannot find symbol
        ArrayList<Integer> used = new ArrayList<>();
        ^
  symbol:   class ArrayList
  location: class Main
Main.java:13: error: cannot find symbol
        ArrayList<Integer> used = new ArrayList<>();
                                      ^
  symbol:   class ArrayList
  location: class Main
Main.java:17: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
                used.remove(new Integer(current));
                            ^
2 errors
1 warning
Language: C++

package main

import (
    "fmt"
)

func main() {
    M := make(map[int]bool)
    var n int
    fmt.Scanf("%d", &n)

    res := 0
    for i := 0; i < n; i++ {
        var a int
        fmt.Scanf("%d", &a)
        if M[a] {
            M[a] = false
            res--
        } else {
            M[a] = true
            res++
        }
    }

    fmt.Printf("%d\n", res)

}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
Language: C++

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

#define PrintLn(X) cout << X << endl
#define Rep(i, n) for(int i = 0; i < (int)(n); ++i)

int main(void)
{
	int N;
	cin >> N;
	int ans = 0;
	set<int> st;
	Rep(i, N){
		int a;
		cin >> a;
		if(st.count(a)){
			st.erase(a);
		}else{
			st.add(a);
		}
	}
	PrintLn(st.size());
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:28: error: 'class std::set<int>' has no member named 'add'
   20 |                         st.add(a);
      |                            ^~~
Language: C++

#include<iostream>
#include<vector>
#include<string>
using namespace std;
typedef long long ll;
int main() {
	int n; cin >> n;
	vector<int>v;
	for (int i = 0; i < n; i++) {
		int key; cin >> key;
		auto itr = find(v.begin(), v.end(), key);
		if (itr == v.end)v.push_back(key);
		else v.erase(itr);
	}
	cout << v.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:32: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   11 |                 auto itr = find(v.begin(), v.end(), key);
      |                            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
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:11:32: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   11 |                 auto itr = find(v.begin(), v.end(), key);
      |                            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main() {
  int n;
  cin >> n;
  
  map<int, int> m;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    m[a]++;
  }
  
  int ans = 0;
  for (auto i : m) {
    ans += m.second % 2;
  }
  
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: 'class std::map<int, int>' has no member named 'second'
   17 |     ans += m.second % 2;
      |              ^~~~~~
Language: C++

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
#ifdef LOCAL
	std::ifstream in("in");
	std::cin.rdbuf(in.rdbuf());
#endif

	int N;
	cin >> N;

	set<in> s;
	for(int i = 0; i < N; i++){
		int a;
		cin >> a;
		if(s.count(a)) s.erase(a);
		else s.insert(a);
	}

	cout << s.size() << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: 'in' was not declared in this scope; did you mean 'yn'?
   16 |         set<in> s;
      |             ^~
      |             yn
a.cc:16:15: error: template argument 1 is invalid
   16 |         set<in> s;
      |               ^
a.cc:16:15: error: template argument 2 is invalid
a.cc:16:15: error: template argument 3 is invalid
a.cc:20:22: error: request for member 'count' in 's', which is of non-class type 'int'
   20 |                 if(s.count(a)) s.erase(a);
      |                      ^~~~~
a.cc:20:34: error: request for member 'erase' in 's', which is of non-class type 'int'
   20 |                 if(s.count(a)) s.erase(a);
      |                                  ^~~~~
a.cc:21:24: error: request for member 'insert' in 's', which is of non-class type 'int'
   21 |                 else s.insert(a);
      |                        ^~~~~~
a.cc:24:19: error: request for member 'size' in 's', which is of non-class type 'int'
   24 |         cout << s.size() << endl;
      |                   ^~~~
Language: C++

// #include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <vector>
#include <utility>

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()

using namespace std;
using ll = long long;
using P = pair<int, int>;

const double PI = 3.14159265358979;

int dist[8][8];

struct Edge{ ll cost, to; };
void solve()
{
  int n, m, r;
  cin >> n >> m >> r;
  vector<int> ri(r);
  for(int i = 0; i < r; ++i)
  {
    cin >> ri[i];
    ri[i]--;
  }

  int a, b, c;
  vector< vector<Edge> > G(n, vector<Edge>());
  for(int i = 0; i < m; ++i)
  {
    cin >> a >> b >> c;
    a--; b--;
    G[a].emplace_back(Edge{c, b});
    G[b].emplace_back(Edge{c, a});
  }

  const ll INF = 1LL << 60;
  priority_queue<P, vector<P>, greater<P>> que;
  for(int i = 0; i < r; ++i)
  {
    vector<ll> d(n, INF);
    d[ri[i]] = 0;
    que.push(P(0, ri[i])); // P(cost, start)
    while (!que.empty())
    {
      P p = que.top();
      que.pop();
      ll node = p.second;
      if (d[node] < p.first) continue;
      for (const auto& edge : G[node])
      {
          if (d[edge.to] > d[node] + edge.cost)
          {
              d[edge.to] = d[node] + edge.cost;
              que.push(P(d[edge.to], edge.to));
          }
      }
    }
    for(int j = 0; j < r; ++j)
    {
      dist[i][j] = d[ri[j]];
    }
  }

  vector<int> indices(r);
  for(int i = 0; i < r; ++i) indices[i] = i;

  ll ans = INF;
  do {
    ll distance = 0;
    for(int i = 0; i < r - 1; ++i) distance += dist[indices[i]][indices[i + 1]];
    ans = min(ans, distance);
  } while(next_permutation(ALL(indices)));
  cout << ans;
}

int main()
{
  fastio;
  solve();

  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:78:11: error: 'next_permutation' was not declared in this scope
   78 |   } while(next_permutation(ALL(indices)));
      |           ^~~~~~~~~~~~~~~~
Language: C++

/*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <list>
#include <stack>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#include <functional>
#define   mod  998244353
#define   int  long long 
#define   ld   long double
#define   pb   push_back
#define   vi   vector<int> 
#define   co(x)  cout << x << '\n' 
#define   dbg(x)  cerr << #x << " = " << x << '\n' 
#define   bitcount(x)  (int)__builtin_popcount(x) 
#define   sz(x)  (int)x.size()
#define   all(a) a.begin(),a.end() 
#define   ff   first
#define   ss   second
#define   pii  pair<int,int> 
#define   lcm(a,b) (a*b)/__gcd(a,b) 
using namespace std;

int n,m,r;
vector <vi> dis(201,vi (201,1e9));

signed main()
{
    cin >> n >> m >> r ; 
    vi a(r);
    for (int &it: a) cin >> it ; 
    for (int i=1;i<=m;i++){
        int  x, y, c ; 
        cin >> x >> y >> c ; 
        dis[x][y] = dis[y][x] = c) ; 
    }
    for (int k=1;k<=n;k++) {
        for (int i=1;i<=n;i++) {
            for (int j=1;j<=n;j++) {
                dis[i][j] = min( dis[i][j], dis[i][k]+dis[k][j] ) ; 
            }
        }
    }
    int ans = 1e9 ; 
    sort(all(a));
    do {
        int sum = 0;
        for (int i=1;i<r;i++){
            sum += dis[a[i]][a[i-1]];
        }
        ans = min(ans, sum) ; 
    }
    while (next_permutation(a.begin(),a.end()));
    co ( ans ) ; 
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:34: error: expected ';' before ')' token
   45 |         dis[x][y] = dis[y][x] = c) ;
      |                                  ^
      |                                  ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(v) v.begin(), v.end()
using ll = long long;
const int inf = int(1e10);
const int mod = int(1e9) + 7;
#define int ll
const int n_max = 200;
int d[n_max][n_max];

void floyd_warshall(int n){
    rep(i, n)
        rep(j, n)
            rep(k, n) d[i][k] = min(d[i][j] + d[j][k], d[i][k]);
}

int main(){
    int n, m, r; cin >> n >> m >> r;
    vector<int> R(r);
    rep(i, r) cin >> R[i];
    rep(i, n_max){
        rep(j, n_max){
            if(i == j) d[i][j] = 0;
            else d[i][j] = inf;
        }
    }

    rep(i, m){
        int a, b, c; cin >> a >> b >> c;
        d[a - 1][b - 1] = c;
        d[b - 1][a - 1] = c;
    }

    floyd_warshall(n);
    sort(all(R));
    int res = inf;
    do{
        int temp = 0;
        rep(i, r - 1){
            temp += d[R[i] - 1][R[i + 1] - 1];
        }
        res = min(res, temp);
    }
    while(next_permutation(all(R)));
    cout << res << endl;

}

Compiler output:
a.cc:8:13: error: '::main' must return 'int'
    8 | #define int ll
      |             ^~
a.cc:18:1: note: in expansion of macro 'int'
   18 | int main(){
      | ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
using Graph = vector<vector<int>>;
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
struct edge{ll to, cost;};
typedef pair<ll,ll> P;
struct graph{
  ll V;
  vector<vector<edge> > G;
  vector<ll> d;

  graph(ll n){
    init(n);
  }

  void init(ll n){
    V = n;
    G.resize(V);
    d.resize(V);
    rep(i,V){
      d[i] = INF;
    }
  }

  void add_edge(ll s, ll t, ll cost){
    edge e;
    e.to = t, e.cost = cost;
    G[s].push_back(e);
  }

  void dijkstra(ll s){
    rep(i,V){
      d[i] = INF;
    }
    d[s] = 0;
    priority_queue<P,vector<P>, greater<P> > que;
    que.push(P(0,s));
    while(!que.empty()){
      P p = que.top(); que.pop();
      ll v = p.second;
      if(d[v]<p.first) continue;
      for(auto e : G[v]){
        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(){
ll n,m,r;
cin>>n>>m>>r;
ll c[r]={};
rep(i,n){
  cin>>c[r];
  c[i]--;}
  sort(c,c+r);
  vvl dist(n, vl(n,INF));
  for(ll i=0; i<m; i++){
    ll a,b,c; cin>>a>>b>>c;
    dist[a-1][b-1]=c;
    dist[b-1][a-1]=c;}
  
  for (ll k = 0; k < n; k++){       // 経由する頂点
    for (ll i = 0; i < n; i++) {    // 始点
      for (ll j = 0; j < n; j++) {  // 終点
        dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
      }
    }
  }
  ll ca = 1;
  for(ll i=1; i<=r; i++){
    ca*=i;}
  ll ans = INF;
  ll cb = 0;
  for(ll i=0; i<ca; i++){
    next_permutation( all(c) );
    cb = 0;
    for(ll j=0; j<r-1; j++){
      cb += dist[j][j+1];}
    ans = min(ans,cb);
  }
  cout << ans << endl;}
  
    
  
  
    


Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: request for member 'begin' in 'c', which is of non-class type 'll [r]' {aka 'long long int [r]'}
   11 | #define all(x) (x).begin(),(x).end()
      |                    ^~~~~
a.cc:104:23: note: in expansion of macro 'all'
  104 |     next_permutation( all(c) );
      |                       ^~~
a.cc:11:32: error: request for member 'end' in 'c', which is of non-class type 'll [r]' {aka 'long long int [r]'}
   11 | #define all(x) (x).begin(),(x).end()
      |                                ^~~
a.cc:104:23: note: in expansion of macro 'all'
  104 |     next_permutation( all(c) );
      |                       ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100//000000000
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
#define map unorderd_map
typedef long long ll;
#define P pair<int, int>
#define PP pair<P,P>
#define T tuple<int,int,int>
#define pr(x) cout << x << endl;
using namespace std;
 
int n,m,r,ans;
map<P,int> d;
vector<int> ress;
 
void solve(vector<int> list, vector<int> vis){
  if(list.size()==r){
    int tmp=0;
    rep(i,r-1){
      //cout << i << endl;
      tmp+=d[P(list[i],list[i+1])];
    }
    //cout << tmp << endl;
    ans=min(ans,tmp);
    return;
  }
  rep(i,vis.size()){
    vector<int> nvis=vis;
    vector<int> nlist=list;
    nlist.push_back(ress[nvis[i]]);
    nvis.erase(nvis.begin()+i);
    solve(nlist,nvis);
  }
}
 
int main(){
  cin >> n >> m >> r;
  rep(i,r){
    int tr; cin >> tr;
    ress.push_back(--tr);
  }
  vector<vector<int> > ki(n);
  map<P,int> cost;
 
  rep(i,m){
    int a,b,c; cin >> a >> b >> c;
    a--; b--;
    ki[a].push_back(b);
    ki[b].push_back(a);
    cost[P(a,b)]=cost[P(b,a)]=c;
  }
 
  rep(i,r-1){
    for(int j=i+1; j<r; j++){
      priority_queue<P> q;
      q.emplace(0,ress[i]);
      vector<int> mc(n,INF);
      mc[ress[i]]=0;
      while(!q.empty()){
        int now=q.top().second;
        int nowc=q.top().first;
        q.pop();
        for(int x : ki[now]){
          int newcost=nowc+cost[P(now,x)];
          if(newcost<mc[x]){
            q.emplace(newcost,x);
            mc[x]=newcost;
          }
        }
      }
      d[P(ress[i],ress[j])]=d[P(ress[j],ress[i])]=mc[ress[j]];
    }
  }
  ans=INF;
  vector<int> vist(r);
  rep(i,r) vist[i]=i;
  vector<int> emp;
  solve(emp,vist);
  cout << ans << endl;
return 0;
}

Compiler output:
a.cc:7:13: error: 'unorderd_map' does not name a type
    7 | #define map unorderd_map
      |             ^~~~~~~~~~~~
a.cc:16:1: note: in expansion of macro 'map'
   16 | map<P,int> d;
      | ^~~
a.cc: In function 'void solve(std::vector<int>, std::vector<int>)':
a.cc:24:12: error: 'd' was not declared in this scope
   24 |       tmp+=d[P(list[i],list[i+1])];
      |            ^
a.cc: In function 'int main()':
a.cc:7:13: error: 'unorderd_map' was not declared in this scope
    7 | #define map unorderd_map
      |             ^~~~~~~~~~~~
a.cc:46:3: note: in expansion of macro 'map'
   46 |   map<P,int> cost;
      |   ^~~
a.cc:46:8: error: expected primary-expression before ',' token
   46 |   map<P,int> cost;
      |        ^
a.cc:46:9: error: expected primary-expression before 'int'
   46 |   map<P,int> cost;
      |         ^~~
a.cc:53:5: error: 'cost' was not declared in this scope; did you mean 'cosl'?
   53 |     cost[P(a,b)]=cost[P(b,a)]=c;
      |     ^~~~
      |     cosl
a.cc:67:28: error: 'cost' was not declared in this scope; did you mean 'cosl'?
   67 |           int newcost=nowc+cost[P(now,x)];
      |                            ^~~~
      |                            cosl
a.cc:74:7: error: 'd' was not declared in this scope
   74 |       d[P(ress[i],ress[j])]=d[P(ress[j],ress[i])]=mc[ress[j]];
      |       ^
Language: C++

#include <iostream>
using namespace std;
int r[10] = {};
int R;
int m;
bool visited[10];
long long ans = 1LL << 60;
int n;
int path[205][205] = {};
void dfs(int cnt, int start, bool visited[], long long cost){
  if(cnt == R) {
	ans = min(cost, ans);
  }
  visited[start] = true;
  for(int i = 0; i < R; ++i){
    if(visited[i] = false){
      if(start = -1) dfs(1, r[i], visited, 0);
      else dfs(cnt + 1, r[i], visited, cost + path[start][r[i]]);
    }
  }
  visited[start]= false;
}
int main(){
  cin >> n;
  cin >> m >> R;
  
  for(int i = 0; i < R; ++i){
    cin >> r[i]; 
  }
  for(int i = 1; i <= m; ++i){
    int a, b, c; cin >> a >> b >> c;
    a--; b--;
    path[a][b] = c;
    path[b][a] = c;
  }
  for(int i = 0; i < R; i++){
    visited[i] = false;
  }
  for(int k = 0; k < n; ++k){
    for(int i = 0; i < n; ++i){
      for(int j = 0; j < n; ++j){
		if(i == j) continue;
        else {
 		  path[i][j] = min(path[i][j], path[i][k] + path[k][j]);
        }
      }
    }
  }
  dfs(1, -1, visited[], 0);
  
  return 0; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:22: error: expected primary-expression before ']' token
   49 |   dfs(1, -1, visited[], 0);
      |                      ^
Language: C++

#include <iostream>
using namespace std;
int r[10] = {};
int R;
bool visited[10];
long long ans = 1LL << 60;
int n;
path[205][205] = {};
void dfs(int cnt, int start, bool visited[], long long cost){
  if(c == R) {
	ans = min(cost, ans);
  }
  visited[start] = true;
  for(int i = 0; i < R; ++i){
    if(visited[i] = false){
      if(start = -1) dfs(1, r[i], visited, 0);
      else dfs(cnt + 1, r[i], visited, cost + path[start][r[i]]);
    }
  }
  visited[start]= false;
}
int main(){
  cin >> n;
  int m; cin >> m >> R;
  
  for(int i = 0; i < R; ++i){
    cin >> r[i]; 
  }
  for(int i = 1; i <= M; ++i){
    int a, b, c; cin >> a >> b >> c;
    a--; b--;
    path[a][b] = c;
    path[b][a] = c;
  }
  for(int i = 0; i < R; i++){
    visited[i] = false;
  }
  for(int k = 0; k < n; ++k){
    for(int i = 0; i < n; ++i){
      for(int j = 0; j < n; ++j){
		if(i == j) continue;
        else {
 		  path[i][j] = min(path[i][j], path[i][k] + path[k][j]);
        }
      }
    }
  }
  dfs(1, -1, visited[], 0);
  
  return 0; 
}


Compiler output:
a.cc:8:1: error: 'path' does not name a type
    8 | path[205][205] = {};
      | ^~~~
a.cc: In function 'void dfs(int, int, bool*, long long int)':
a.cc:10:6: error: 'c' was not declared in this scope
   10 |   if(c == R) {
      |      ^
a.cc:17:47: error: 'path' was not declared in this scope
   17 |       else dfs(cnt + 1, r[i], visited, cost + path[start][r[i]]);
      |                                               ^~~~
a.cc: In function 'int main()':
a.cc:29:23: error: 'M' was not declared in this scope
   29 |   for(int i = 1; i <= M; ++i){
      |                       ^
a.cc:32:5: error: 'path' was not declared in this scope
   32 |     path[a][b] = c;
      |     ^~~~
a.cc:43:19: error: 'path' was not declared in this scope
   43 |                   path[i][j] = min(path[i][j], path[i][k] + path[k][j]);
      |                   ^~~~
a.cc:48:22: error: expected primary-expression before ']' token
   48 |   dfs(1, -1, visited[], 0);
      |                      ^
Language: C++

#include <iostream>
using namespace std;
int r[10] = {};
int R;
bool visited[10];
long long ans = 1LL << 60;
int n;

void dfs(int cnt, int start, bool visited[], long long cost){
  if(c == R) {
	ans = min(cost, ans);
  }
  visited[start] = true;
  for(int i = 0; i < R; ++i){
    if(visited[i] = false){
      if(start = -1) dfs(1, r[i], visited, 0);
      else dfs(cnt + 1, r[i], visited, cost + path[start][r[i]]);
    }
  }
  visited[start]= false;
}
int main(){
  cin >> n;
  int m; cin >> m >> R;
  int path[n][n] = {};
  for(int i = 0; i < R; ++i){
    cin >> r[i]; 
  }
  for(int i = 1; i <= M; ++i){
    int a, b, c; cin >> a >> b >> c;
    a--; b--;
    path[a][b] = c;
    path[b][a] = c;
  }
  for(int i = 0; i < R; i++){
    visited[i] = false;
  }
  for(int k = 0; k < n; ++k){
    for(int i = 0; i < n; ++i){
      for(int j = 0; j < n; ++j){
		if(i == j) continue;
        else {
 		  path[i][j] = min(path[i][j], path[i][k] + path[k][j]);
        }
      }
    }
  }
  dfs(1, -1, visited[], 0);
  
  return 0; 
}


Compiler output:
a.cc: In function 'void dfs(int, int, bool*, long long int)':
a.cc:10:6: error: 'c' was not declared in this scope
   10 |   if(c == R) {
      |      ^
a.cc:17:47: error: 'path' was not declared in this scope
   17 |       else dfs(cnt + 1, r[i], visited, cost + path[start][r[i]]);
      |                                               ^~~~
a.cc: In function 'int main()':
a.cc:29:23: error: 'M' was not declared in this scope
   29 |   for(int i = 1; i <= M; ++i){
      |                       ^
a.cc:48:22: error: expected primary-expression before ']' token
   48 |   dfs(1, -1, visited[], 0);
      |                      ^
Language: C++

#include <iostream>
using namespace std;
int r[10] = {};
int R;
bool visited[10];
long long ans = 1LL << 60;
int n;

void dfs(int cnt, int start, bool visited[], long long cost){
  if(c == R) {
	ans = min(cost, ans);
  }
  visited[start] = true;
  for(int i = 0; i < R; ++i){
    if(visited[i] = false){
      if(start = -1) dfs(1, r[i], visited, 0);
      else dfs(cnt + 1, r[i], visited, cost + path[start][r[i]]);
    }
  }
  visited[start]= false;
}
int main(){
  cin >> n;
  int m; cin >> m >> R;
  int path[n][n] = {}
  for(int i = 0; i < R; ++i){
    cin >> r[i]; 
  }
  for(int i = 1; i <= M; ++i){
    int a, b, c; cin >> a >> b >> c;
    a--; b--;
    path[a][b] = c;
    path[b][a] = c;
  }
  for(int i = 0; i < R; i++){
    visited[i] = false;
  }
  for(int k = 0; k < n; ++k){
    for(int i = 0; i < n; ++i){
      for(int j = 0; j < n; ++j){
		if(i == j) continue;
        else {
 		  path[i][j] = min(path[i][j], path[i][k] + path[k][j]);
        }
      }
    }
  }
  dfs(1, -1, visited[], 0);
  
  return 0; 
}

Compiler output:
a.cc: In function 'void dfs(int, int, bool*, long long int)':
a.cc:10:6: error: 'c' was not declared in this scope
   10 |   if(c == R) {
      |      ^
a.cc:17:47: error: 'path' was not declared in this scope
   17 |       else dfs(cnt + 1, r[i], visited, cost + path[start][r[i]]);
      |                                               ^~~~
a.cc: In function 'int main()':
a.cc:26:3: error: expected ',' or ';' before 'for'
   26 |   for(int i = 0; i < R; ++i){
      |   ^~~
a.cc:26:18: error: 'i' was not declared in this scope
   26 |   for(int i = 0; i < R; ++i){
      |                  ^
a.cc:29:23: error: 'M' was not declared in this scope
   29 |   for(int i = 1; i <= M; ++i){
      |                       ^
a.cc:48:22: error: expected primary-expression before ']' token
   48 |   dfs(1, -1, visited[], 0);
      |                      ^