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

#include<bits/stdc++.h>
using namespace std;
long long n,a[1000111],s=0;
main()
{
  cin>>n;
  for(long long i=1; i<=n; i++)
    cin>>a[i];
  s=a[1];
  for(long long i=2; i<=n; i++)
    s=__gcd(s,a[i]);
  cout<<s;

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:12:11: error: expected '}' at end of input
   12 |   cout<<s;
      |           ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include<bits/stdc++.h.
using namespace std;
 
#define ll long long
 
int main() {
	int n;
  	cin >> n;
  	ll arr[n];
  	ll g;
  	for(int i = 0 ; i < n ;i ++) {
    	ll x;
      	cin >> x;
      	if(i == 0) {
        	g = x;
        }
      else g = __gcd(g , x);
    }
  	cout << g;
}

Compiler output:
a.cc:1:24: error: missing terminating > character
    1 | #include<bits/stdc++.h.
      |                        ^
a.cc:1:9: fatal error: bits/stdc++.h.: No such file or directory
    1 | #include<bits/stdc++.h.
      |         ^
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
#define ll long long
 
int main() {
	int n;
  	cin >> n;
  	ll arr[n];
  	ll g;
  	for(int i = 0 ; i < n ;i ++) {
    	int x;
      	cin >> x;
      	if(i == 0) {
        	g = x;
        }
      else g = __gcd(g , x);
    }
  	cout << g;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:21: error: no matching function for call to '__gcd(long long int&, int&)'
   17 |       else g = __gcd(g , x);
      |                ~~~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: candidate: 'template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:1137:5: note:   template argument deduction/substitution failed:
a.cc:17:21: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('long long int' and 'int')
   17 |       else g = __gcd(g , x);
      |                ~~~~~^~~~~~~
Language: C++

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

#define ll long long

int main() {
	int n;
  	cin >> n;
  	ll arr[n];
  	ll g;
  	for(int i = 0 ; i < n ;i ++) {
    	int x;
      	cin >> x;
      	if(i == 0) {
        	g = x;
        }
      else g = __gcd(g , x);
    }
  	cout << g;
}

Compiler output:
a.cc:1:24: error: missing terminating > character
    1 | #include<bits/stdc++.h.
      |                        ^
a.cc:1:9: fatal error: bits/stdc++.h.: No such file or directory
    1 | #include<bits/stdc++.h.
      |         ^
compilation terminated.
Language: C++


#include <iostream>
#include <vector>
#include <utility>
#include <set>
using namespace std;
int ab(int A, int B){


    if (B % A == 0){
        return A + B;
    }else{
        return B - A;
    }
}

void b(){
    int N,M;
    vector< vector<int> > Aij;
    vector< int > K_list;

    cin >> N >> M;
    for(int i = 0; i < N; i++){
        int K_i;
        cin >> K_i;
        K_list.push_back(K_i);
        Aij.push_back({});
        for(int j = 0; j < K_i; j++){
            int aij;
            cin >>aij;
            Aij[i].push_back(aij);

        }

    }

    set<int> loved(Aij[0].begin(), Aij[0].end());
    for(int i=1; i < N; i++){
        set<int> new_love;
        for(auto x: Aij[i]){
            if (loved.find(x) != loved.end())
                new_love.insert(x);
            }
        loved = move(new_love);
        }

        cout << loved.size();

}

int gcd(int n, int m){
    if (n < m) {
        swap(n, m);
    }
    assert(n>=m);
    int r = n % m;
    while(r != 0){
        n = m;
        m = r;
        r = n % m;
    }

    return m;

}

int monster(int N, vector<int> Alist){
    int gcd_all = Alist[0];
    for(int i = 1; i < N ; i++){
        gcd_all = gcd(gcd_all, Alist[i]);
    }

    return gcd_all;


}
void c(){
    int N;
    cin >> N;
    vector<int> Alist;
    for(int i = 0; i < N; i++){
        int tmp;
        cin >> tmp;
        Alist.push_back(tmp);
    }

    cout << monster(N, Alist);

}

int main(){

    c();

    return 0;

}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:55:5: error: 'assert' was not declared in this scope
   55 |     assert(n>=m);
      |     ^~~~~~
a.cc:6:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    5 | #include <set>
  +++ |+#include <cassert>
    6 | using namespace std;
Language: C++

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

vector<long> yakusu(long n){
  vector<long> p;
  long i=1;
  while(i*i<=n){
    if(n%i==0){
      p.push_back(i);
      p.push_back(n/i);
    }
    i++;
  }
  if(p.back()*p.back()==n) p.pop_back();
  return p;
}

int main ()
{
  int N;
  cin >> N;
  long A;
  cin >> A;
  vector<long> p;
  p=yakusu(A);
  sort(p.begin(),p.end());
  //for(auto itr = p.begin(); itr != p.end(); ++itr) {
  //cout << *itr << endl; 
  }
  for(int i=1;i<N;i++){
    cin >> A;
    int j=0;
    while(j<p.size()){
      if(A%p.at(j)!=0) p.erase(p.begin()+j);
      j++;
    }
  }
  cout << p.back() << endl;
  return 0;
}

Compiler output:
a.cc:30:3: error: expected unqualified-id before 'for'
   30 |   for(int i=1;i<N;i++){
      |   ^~~
a.cc:30:15: error: 'i' does not name a type
   30 |   for(int i=1;i<N;i++){
      |               ^
a.cc:30:19: error: 'i' does not name a type
   30 |   for(int i=1;i<N;i++){
      |                   ^
a.cc:38:3: error: 'cout' does not name a type
   38 |   cout << p.back() << endl;
      |   ^~~~
a.cc:39:3: error: expected unqualified-id before 'return'
   39 |   return 0;
      |   ^~~~~~
a.cc:40:1: error: expected declaration before '}' token
   40 | }
      | ^
Language: Java


import java.util.PriorityQueue;
import java.util.Scanner;

public class C {
    public static void main(String [] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        long [] health = new long[n];
        PriorityQueue<Long> healths = new PriorityQueue<>();

        for (int i = 0; i < n; ++i) {
            health[i] = scanner.nextLong();
            healths.add(health[i]);

        }
        long min1 = healths.poll();
        long min2 = healths.poll();
        for (int i = 0; i < n; ++i) {
            health[i] %= min1;
        }
        for (int i = 0; i < n; ++i) {
            if (health[i] != 0 && (min2 > health[i] || min2 % min1 == 0)) {
                min2 = health[i];
            }
        }

  //      System.out.println("min1: " + min1 + " min2: " + min2);
        while (min1 >= 1 && min2 >= 1) {
            if (min1 > min2) {
                long tmp = min1;
                min1 = min2;
                min2 = tmp;
            }
            if (min2 % min1 == 0) {
                System.out.println(min1);
                return;
            }
            min2 = min2 % min1;
        }
        System.out.println(Math.min(min1, min2));


    }

}


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

#include <iostream>
#include <vector>
#include <algorithm>
typedef long long int ll;
using namespace std;

// 最大公約数
ll d(int f, int s)
{
  　if(s<f)
    　swap(s,f);
    if (s % f == 0)
        return f;
    else
        return d(s % f, f);
}
int main()
{
    int N;
    cin >> N;
    vector<ll> A;
ll common;
  cin>>common;
    for (int i = 1; i < N; i++)
    {
        ll ai;
        cin >> ai;
        common=gcd(common,ai);
    }
    cout << common << endl;
}


Compiler output:
a.cc:10:3: error: extended character 　 is not valid in an identifier
   10 |   　if(s<f)
      |   ^
a.cc:11:5: error: extended character 　 is not valid in an identifier
   11 |     　swap(s,f);
      |     ^
a.cc: In function 'll d(int, int)':
a.cc:10:3: error: '\U00003000if' was not declared in this scope
   10 |   　if(s<f)
      |   ^~~~
a.cc: In function 'int main()':
a.cc:28:16: error: 'gcd' was not declared in this scope
   28 |         common=gcd(common,ai);
      |                ^~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <ios>
#include <iomanip>
#include <stack>
#include <queue>
#include <algorithm>

#define REP(i, n) for(int i = 0;i < n;i++)

using namespace std;

const int INF = 100000000;

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

  int life;
  int count = 0;
  vector<int> monster(n,0);
  while(cin >> life){
    monster[count] = life;
    count++;
    if (count == n) {
      break;
    }
  }

  sort(monster.begin(),monster.end(),greater<int>());
  while(true){
    if(monster[1] == 0){
      break;
    }
    if((monster[0] = monster[0] % monster[1]) == 0){
      monster.erase(0);
    }
    sort(monster.begin(),monster.end(),greater<int>());
  }

  cout << monster[0] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:20: error: no matching function for call to 'std::vector<int>::erase(int)'
   37 |       monster.erase(0);
      |       ~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator; const_iterator = std::vector<int>::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:28: note:   no known conversion for argument 1 from 'int' to 'std::vector<int>::const_iterator'
 1536 |       erase(const_iterator __position)
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator; const_iterator = std::vector<int>::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note:   candidate expects 2 arguments, 1 provided
Language: C++

algorithm>

#define REP(i, n) for(int i = 0;i < n;i++)

using namespace std;

const int INF = 100000000;

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

  int life;
  int count = 0;
  vector<int> monster(n,0);
  while(cin >> life){
    monster[count] = life;
    count++;
    if (count == n) {
      break;
    }
  }

  sort(monster.begin(),monster.end(),greater<int>());
  while(true){
    if(monster[1] == 0){
      break;
    }
    monster[0] = monster[0] % monster[1];
    sort(monster.begin(),monster.end(),greater<int>());
  }

  cout << monster[0] << endl;
  return 0;
}

Compiler output:
a.cc:1:1: error: 'algorithm' does not name a type
    1 | algorithm>
      | ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:11:3: error: 'cin' was not declared in this scope
   11 |   cin >> n;
      |   ^~~
a.cc:15:3: error: 'vector' was not declared in this scope
   15 |   vector<int> monster(n,0);
      |   ^~~~~~
a.cc:15:10: error: expected primary-expression before 'int'
   15 |   vector<int> monster(n,0);
      |          ^~~
a.cc:17:5: error: 'monster' was not declared in this scope; did you mean 'const'?
   17 |     monster[count] = life;
      |     ^~~~~~~
      |     const
a.cc:24:8: error: 'monster' was not declared in this scope; did you mean 'const'?
   24 |   sort(monster.begin(),monster.end(),greater<int>());
      |        ^~~~~~~
      |        const
a.cc:24:38: error: 'greater' was not declared in this scope
   24 |   sort(monster.begin(),monster.end(),greater<int>());
      |                                      ^~~~~~~
a.cc:24:46: error: expected primary-expression before 'int'
   24 |   sort(monster.begin(),monster.end(),greater<int>());
      |                                              ^~~
a.cc:24:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   24 |   sort(monster.begin(),monster.end(),greater<int>());
      |   ^~~~
      |   short
a.cc:30:48: error: expected primary-expression before 'int'
   30 |     sort(monster.begin(),monster.end(),greater<int>());
      |                                                ^~~
a.cc:33:3: error: 'cout' was not declared in this scope; did you mean 'count'?
   33 |   cout << monster[0] << endl;
      |   ^~~~
      |   count
a.cc:33:25: error: 'endl' was not declared in this scope
   33 |   cout << monster[0] << endl;
      |                         ^~~~
Language: C++

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

#define ff first
#define ss second
#define ll long long
#define W(x) cerr << "\033[31m"<< #x << " = " << x << "\033[0m" << endl;

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef set<int> si;
typedef vector<vi> vii;
typedef vector<ii> vpi;
typedef vector<ll> vll;
int oo = (1e9) + 7;
ll oo2 = 1ll*oo*oo;  

int main() {
    int n;
    cin >> n;
    vi v(n);
    si st;
    for(int i = 0; i < n; i++)
    {
        scanf("%d", &v[i]);
        st.insert(v[i]);
    }
    if(st.size() == 1) return printf("%d\n", *k), 0;
    auto k = st.begin();
    int tmp = *k;
    k++;
    int mod = abs(*k-tmp);
    int ans = oo;
    for(int i : v) ans = min(ans, i%mod);
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:47: error: 'k' was not declared in this scope
   28 |     if(st.size() == 1) return printf("%d\n", *k), 0;
      |                                               ^
Language: C++

#include <iostream>
#include <vector>

int main(){
  int N;
  std::cin>>N;
  std::vector<int> A(N);
  for (int i = 0; i < N; i++){
    std::cin>>A[i];
  }
  std::sort(A.begin(),A.end());
  for (int i = 0; i < N-1; i++){
    int temp1 = A[i];
    int temp2 = A[i+1];
    while(temp1 != 0){
      int temp = temp1;
      temp1 = temp2 % temp1;
      temp2 = temp;
    }
    A[i+1] = temp2;
  }
  std::cout<<A[N-1]<<std::endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   11 |   std::sort(A.begin(),A.end());
      |        ^~~~
      |        qsort
Language: C++

#include"bits/stdc++.h"

using namespace std;

int main() {
	int N;
	cin >> N;
	vector<int>A(N);
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}

	int ans = A[0];

	for (int i = 1; i < N; i++) {
		ans = ___gcd(ans,A[i]);
	}

	cout << ans << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: '___gcd' was not declared in this scope
   16 |                 ans = ___gcd(ans,A[i]);
      |                       ^~~~~~
Language: Java

import java.util.Scanner;

/**
 * @author shengboxu
 */

public class Main {
    public static void main(String [] args)
    {
        Scanner sc = new Scanner(System.in);
        final int N = sc.nextInt();
        final int[] A = new int[N];
        
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
        }
        
        int ans = A[0];
        
        for (int i = 0; i < N; i++) {
            final Numeric numeric = new Numeric(ans, A[i]);
            ans = numeric.getGcd();
        }
        
        System.out.println(ans);
    }
    
    public static class Numeric {
        private int a;
        private int b;
        
        public Numeric(final int a, final int b) {
            this.a = a < b ? a : b;
            this.b = (a + b) - this.a;
        }
        
        public int getGcd() {
            int tmp;
            while ((tmp = a % b) != 0) {
                a = b;
                b = tmp;
            }
            return b;
        }
    }


Compiler output:
Main.java:45: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int gcd(int a, int b)
{
 	return (min(a, b) == 0 ? max(a, b) : gcd(max(a, b)%min(a,b), min(a, b));
}
            
int main()
{
    int no_of_elements;
    cin >> no_of_elements;

    int array_gcd;
    for(int i = 1; i <= no_of_elements; i++)
    {
        int health;
        cin >> health;
        array_gcd = (i == 1 ? health : gcd(array_gcd, health));
    }

    cout << array_gcd;
    return 0;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:8:80: error: expected ')' before ';' token
    8 |         return (min(a, b) == 0 ? max(a, b) : gcd(max(a, b)%min(a,b), min(a, b));
      |                ~                                                               ^
      |                                                                                )
Language: C++

#include<iostream>
#include <string>
#include<algorithm>
#include <set>
#include <cmath>
using namespace std;
#define rep(i,a,b) for(int i=a,i<b;i++)
#define rep0(i,n) rep(i,0,n)

int gcd(int a, int b) {
	if (a == 0) return b;
	if (b == 0) return a;
	int m = max(a, b);
	int n = min(a, b);
	if (m%n == 0) return n;
	else return gcd(n, m%n);

}

int main(void) {
	ios::sync_with_stdio(false);
	int N, i, j, k, re;
	cin >> N;
	int A[N];
	cin >> A[0];
	re = A[0];
	rep(i, 1, N) {
		cin >> A[i];
		re = gcd(re, A[i]);
	}
	cout << re;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:33: error: expected ';' before '<' token
    7 | #define rep(i,a,b) for(int i=a,i<b;i++)
      |                                 ^
a.cc:27:9: note: in expansion of macro 'rep'
   27 |         rep(i, 1, N) {
      |         ^~~
a.cc:7:33: error: expected primary-expression before '<' token
    7 | #define rep(i,a,b) for(int i=a,i<b;i++)
      |                                 ^
a.cc:27:9: note: in expansion of macro 'rep'
   27 |         rep(i, 1, N) {
      |         ^~~
Language: C++

#include<bits/stdc++.h>
int main(){
int gcd(int a, int b) {
  return b != 0 ? gcd(b, a % b) : a;
}
  int n,d;cin>>n;
  for(int i=0;i<n;i++){
    int c;cin>>c;
    d=gcd(d,c);}
  cout<<d;}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:23: error: a function-definition is not allowed here before '{' token
    3 | int gcd(int a, int b) {
      |                       ^
a.cc:6:11: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   int n,d;cin>>n;
      |           ^~~
      |           std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 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:9:7: error: 'gcd' was not declared in this scope; did you mean 'std::gcd'?
    9 |     d=gcd(d,c);}
      |       ^~~
      |       std::gcd
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58:
/usr/include/c++/14/numeric:173:5: note: 'std::gcd' declared here
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:10:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |   cout<<d;}
      |   ^~~~
      |   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<bits/stdc++.h>
#include<stdio.h>
int main(){
int gcd(int a, int b) {
  return b != 0 ? gcd(b, a % b) : a;
}
  int n,d;cin>>n;
  for(int i=0;i<n;i++){
    int c;cin>>c;
    d=gcd(d,c);}
  cout<<d;}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:23: error: a function-definition is not allowed here before '{' token
    4 | int gcd(int a, int b) {
      |                       ^
a.cc:7:11: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   int n,d;cin>>n;
      |           ^~~
      |           std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 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:10:7: error: 'gcd' was not declared in this scope; did you mean 'std::gcd'?
   10 |     d=gcd(d,c);}
      |       ^~~
      |       std::gcd
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58:
/usr/include/c++/14/numeric:173:5: note: 'std::gcd' declared here
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |   cout<<d;}
      |   ^~~~
      |   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<bits/stdc++.h>
#include<stdio.h>
int gcd(int a, int b) {
  return b != 0 ? gcd(b, a % b) : a;
}
int lcm(int a, int b) {
  return a * b / gcd(a, b);
}
int main(){
  int n,d;cin>>n;
  for(int i=0;i<n;i++){
    int c;cin>>c;
    d=gcd(d,c);}
  cout<<d;}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |   int n,d;cin>>n;
      |           ^~~
      |           std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 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:14:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   cout<<d;}
      |   ^~~~
      |   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<bits/stdc++.h>
#include<stdio.h>
int gcd(int a, int b) {
  return b != 0 ? gcd(b, a % b) : a;
}
Int lcm(int a, int b) {
  return a * b / gcd(a, b);
}
int main(){
  int n,d;cin>>n;
  for(int i=0;i<n;i++){
    int c;cin>>c;
    d=gcd(d,c);}
  cout<<d;}

Compiler output:
a.cc:6:1: error: 'Int' does not name a type; did you mean 'int'?
    6 | Int lcm(int a, int b) {
      | ^~~
      | int
a.cc: In function 'int main()':
a.cc:10:11: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |   int n,d;cin>>n;
      |           ^~~
      |           std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 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:14:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   cout<<d;}
      |   ^~~~
      |   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<bits/stdc++.h>
#include<stdio.h>
int gcd(Int a, Int b) {
  return b != 0 ? gcd(b, a % b) : a;
}
Int lcm(Int a, Int b) {
  return a * b / gcd(a, b);
}
int main(){
  int n,d;cin>>n;
  for(int i=0;i<n;i++){
    int c;cin>>c;
    d=gcd(d,c);}
  cout<<d;}

Compiler output:
a.cc:3:9: error: 'Int' was not declared in this scope; did you mean 'int'?
    3 | int gcd(Int a, Int b) {
      |         ^~~
      |         int
a.cc:3:16: error: 'Int' was not declared in this scope; did you mean 'int'?
    3 | int gcd(Int a, Int b) {
      |                ^~~
      |                int
a.cc:3:21: error: expression list treated as compound expression in initializer [-fpermissive]
    3 | int gcd(Int a, Int b) {
      |                     ^
a.cc:6:1: error: 'Int' does not name a type; did you mean 'int'?
    6 | Int lcm(Int a, Int b) {
      | ^~~
      | int
a.cc: In function 'int main()':
a.cc:10:11: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |   int n,d;cin>>n;
      |           ^~~
      |           std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 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:13:10: error: 'gcd' cannot be used as a function
   13 |     d=gcd(d,c);}
      |       ~~~^~~~~
a.cc:14:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   cout<<d;}
      |   ^~~~
      |   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<bits/stdc++.h>
#include<stdio.h>
#include <stdio.h>
 
int main(void)
{
  int a, b;
  scanf("%d", &a);
  scanf("%d", &b);
  printf("gcd(%d, %d) = %d\n", a, b, gcd(a, b));
  return 0;
}
 
int gcd(int a, int b)
{
    int buff = a;
 
    if (a < b) {
        a = b;
        b = buff;
    }
 
    return b ? gcd(b, a % b) : a;
}using namespace std;

int main(){
  int n,d;cin>>n;
  for(int i=0;i<n;i++){
    int c;cin>>c;
    d=gcd(d,c);}
  cout<<d;}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:38: error: 'gcd' was not declared in this scope; did you mean 'std::gcd'?
   10 |   printf("gcd(%d, %d) = %d\n", a, b, gcd(a, b));
      |                                      ^~~
      |                                      std::gcd
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/numeric:173:5: note: 'std::gcd' declared here
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc: At global scope:
a.cc:26:5: error: redefinition of 'int main()'
   26 | int main(){
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main(void)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
#include<stdio.h>
#include <stdio.h>
 
int main(void)
{
  int a, b;
  scanf("%d", &a);
  scanf("%d", &b);
  printf("gcd(%d, %d) = %d\n", a, b, gcd(a, b));
  printf("lcm(%d, %d) = %d\n", a, b, lcm(a, b));
  return 0;
}
 
int gcd(int a, int b)
{
    int buff = a;
 
    if (a < b) {
        a = b;
        b = buff;
    }
 
    return b ? gcd(b, a % b) : a;
}using namespace std;

int main(){
  int n,d;cin>>n;
  for(int i=0;i<n;i++){
    int c;cin>>c;
    d=gcd(d,c);}
  cout<<d;}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:38: error: 'gcd' was not declared in this scope; did you mean 'std::gcd'?
   10 |   printf("gcd(%d, %d) = %d\n", a, b, gcd(a, b));
      |                                      ^~~
      |                                      std::gcd
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/numeric:173:5: note: 'std::gcd' declared here
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:11:38: error: 'lcm' was not declared in this scope; did you mean 'std::lcm'?
   11 |   printf("lcm(%d, %d) = %d\n", a, b, lcm(a, b));
      |                                      ^~~
      |                                      std::lcm
/usr/include/c++/14/numeric:188:5: note: 'std::lcm' declared here
  188 |     lcm(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc: At global scope:
a.cc:27:5: error: redefinition of 'int main()'
   27 | int main(){
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main(void)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,b;cin>>n;
  for(int i=0;i<n;i++){
    int a,gcd;cin>>a;
    b=gcd(b,a);}
  cout<<b;}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'gcd' cannot be used as a function
    7 |     b=gcd(b,a);}
      |       ~~~^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;cin>>n;
  for(int i=0;i<n;i++){
    int a,b;cin>>a;
    b=gcd(b,a);}
  cout<<b;}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'b' was not declared in this scope
    8 |   cout<<b;}
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a[100005]
int main(){
	int n;
  	cin>>n;
  	for(int i=0;i<n;i++)
    {
      	cin>>a[i];
    }
    int x=a[0];
    for(int i=1;i<n;i++)
    {
    	x=__gcd(x,a[i]);
	}
    cout<<x;
}

Compiler output:
a.cc:4:1: error: expected initializer before 'int'
    4 | int main(){
      | ^~~
Language: C++

#include<iostream>
using namespace std;int a,b;main(){cin>>b;while(cin>>b)a=__gcd(a,b);cout<<a<<endl;}

Compiler output:
a.cc:2:29: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | using namespace std;int a,b;main(){cin>>b;while(cin>>b)a=__gcd(a,b);cout<<a<<endl;}
      |                             ^~~~
a.cc: In function 'int main()':
a.cc:2:58: error: '__gcd' was not declared in this scope
    2 | using namespace std;int a,b;main(){cin>>b;while(cin>>b)a=__gcd(a,b);cout<<a<<endl;}
      |                                                          ^~~~~
Language: C++

using namespace std;int a,b;main(){cin>>b;while(cin>>b)a=__gcd(a,b);cout<<a<<endl;}

Compiler output:
a.cc:1:29: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | using namespace std;int a,b;main(){cin>>b;while(cin>>b)a=__gcd(a,b);cout<<a<<endl;}
      |                             ^~~~
a.cc: In function 'int main()':
a.cc:1:36: error: 'cin' was not declared in this scope
    1 | using namespace std;int a,b;main(){cin>>b;while(cin>>b)a=__gcd(a,b);cout<<a<<endl;}
      |                                    ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;int a,b;main(){cin>>b;while(cin>>b)a=__gcd(a,b);cout<<a<<endl;}
a.cc:1:58: error: '__gcd' was not declared in this scope
    1 | using namespace std;int a,b;main(){cin>>b;while(cin>>b)a=__gcd(a,b);cout<<a<<endl;}
      |                                                          ^~~~~
a.cc:1:69: error: 'cout' was not declared in this scope
    1 | using namespace std;int a,b;main(){cin>>b;while(cin>>b)a=__gcd(a,b);cout<<a<<endl;}
      |                                                                     ^~~~
a.cc:1:69: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:1:78: error: 'endl' was not declared in this scope
    1 | using namespace std;int a,b;main(){cin>>b;while(cin>>b)a=__gcd(a,b);cout<<a<<endl;}
      |                                                                              ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;int a,b;main(){cin>>b;while(cin>>b)a=__gcd(a,b);cout<<a<<endl;}
Language: C++


#include <cstdio>

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

    int ans = a[0];
    for(int i = 1; i < n; i++){
        ans = gcd(ans, a[i]);
    }

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

    return 0;
}

int gcd(int a, int b){
    if(a < b){
        return gcd(b, a);
    }else{
        int r = a % b;
        while(r != 0){
            a = b;
            b = r;
            r = a % b;
        }
    
    return b;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:15: error: 'gcd' was not declared in this scope
   14 |         ans = gcd(ans, a[i]);
      |               ^~~
a.cc: In function 'int gcd(int, int)':
a.cc:34:2: error: expected '}' at end of input
   34 | }
      |  ^
a.cc:22:22: note: to match this '{'
   22 | int gcd(int a, int b){
      |                      ^
Language: C++

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

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

  vector<int> a(n);

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

  }

  sort(a.begin(), a.end());

  int ans = 1000000000;

  for(int i = 0; i < n; i++){
    ans = min(ans, __algo_gcd(a[0], a[i]));
  }

  cout << ans << endl;

  return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:20: error: '__algo_gcd' was not declared in this scope
   23 |     ans = min(ans, __algo_gcd(a[0], a[i]));
      |                    ^~~~~~~~~~
Language: C++

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

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

  vector<int> a(n);

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

  }

  sort(a.begin(), a.end());

  int ans = 1000000000;

  for(int i = 0; i < n; i++){
    ans = min(ans, gcd(a[0], a[i]));
  }

  cout << ans << endl;

  return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:20: error: 'gcd' was not declared in this scope
   23 |     ans = min(ans, gcd(a[0], a[i]));
      |                    ^~~
Language: C++

#include <iostream>

int main()
{
  	int N;
	cin >> N;
	
	int g;

	int input;

	for (int i = 0; i < N; ++i)
	{
		cin >> input;
		if (g == 0)
			g = input;
		else
		{
			int a, b,r;
			a = (input > g) ? input : g;
			b = (input > g) ? g : input;
			
			r = a % b;
			while (r != 0)
			{
				a = b;
				b = r;
				r = a % b;
			}
			g = b;
		}
	}

	cout << g << endl;

 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         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:34:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   34 |         cout << g << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:34:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   34 |         cout << g << endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>

using namespace std;

int minof(unsigned long a[], unsigned long n){
    unsigned long min;
    min = a[0];
    for (int i = 0; i < n-1; i++)
    if (a[i] < a[i+1]) min = a[i+1];
    return min;
}

int main(){
    unsigned long N;
    cin >> N;
    unsigned long a[N];
    for (int i=0; i<N; i++)
    cin >> a[i];

    while(true){
        for(int i=0; i<N; i++){
            if (a[i] - minof(a,N) >= 0)
                a[i] -= minof(a,N);         
        }
        int a = 1;
        for (int j=0; j<N; j++){
            if (a[j] != 0)
            a = 0
        }
        if (a)
        break;
    }

cout << minof(a,N);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:18: error: invalid types 'int[int]' for array subscript
   27 |             if (a[j] != 0)
      |                  ^
a.cc:28:18: error: expected ';' before '}' token
   28 |             a = 0
      |                  ^
      |                  ;
   29 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>
#include <numeric>
#define REP(i, n) for(int i=0;i<(n);i++)
int GCD(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
using namespace std;

int main() {
  int n;
  int a[n+1];
  for(int i=0;i!=n;i++){
    cin >> a[i];
  }
  int x;
  x=a[0]
  for(int i=1;i!=n;i++){
    x=GCD(x,a[i]);
  }
  cout << x << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: expected ';' before 'for'
   14 |   x=a[0]
      |         ^
      |         ;
   15 |   for(int i=1;i!=n;i++){
      |   ~~~    
a.cc:15:15: error: 'i' was not declared in this scope
   15 |   for(int i=1;i!=n;i++){
      |               ^
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n;
  cin >> n;

  int vc[n];
  int i,x,k;

  //vector<int> vc;
  for(i=0;i<n;i++){
    cin >> x;
    vc[i]=x;
    //vc.push_back(x);
  }

  int m=1000000000;
  for(i=0;i<n;i++){
    if(vc[i]<m)
      m=vc[i]
  }

  int c=1;
  int s=1;

  while(s){
    if(m==1){
      cout << c<<"\n";
      return 0;
    }else{
      for(i=m;i>1;i--){
        for(j=0;j<n;j++){
          if a[j]%i !=0;
            break;
        }else{
          c *= i;
          for(k=0;k<n;k++){
            a[k]/=i;
          }
          break;
        }
      }else{
        cout<<c<<"\n";
        return 0;
      }
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:14: error: expected ';' before '}' token
   29 |       m=vc[i]
      |              ^
      |              ;
   30 |   }
      |   ~           
a.cc:41:13: error: 'j' was not declared in this scope
   41 |         for(j=0;j<n;j++){
      |             ^
a.cc:42:14: error: expected '(' before 'a'
   42 |           if a[j]%i !=0;
      |              ^
      |              (
a.cc:44:10: error: 'else' without a previous 'if'
   44 |         }else{
      |          ^~~~
a.cc:47:13: error: 'a' was not declared in this scope
   47 |             a[k]/=i;
      |             ^
a.cc:51:8: error: 'else' without a previous 'if'
   51 |       }else{
      |        ^~~~
Language: C++

/*
ID: seekho
PROG: friday
LANG: C++14                 
*/
/* LANG can be C++11 or C++14 for those more recent releases */

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
using namespace __gnu_pbds;

//find_by_order gives kth-largest element
//order_of_key gives the number of items in the set that are strictly smaller!!

// OT.find_by_order(k-1)
// 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define db4(x, y, z, w) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << "," << #w << "=" << w << endl
#define ll long long
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define X first
#define Y second
#define sz(x) (int)((x).size())
#define pii pair<int,int>
#define MOD (ll)(998244353)
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
typedef vector<int> vi;
#define inf (ll)(1e18)
#define double long double
#define int long long

//////////////////////
// const int N = 100005;

int32_t main() {

    ios::sync_with_stdio(false);
    cin.tie(0); 
    cout.tie(0);
	
	int n;
	cin >> n;
	cin >> te;
	int a;
	rep(i,n-1) {
		cin >> a;
		te = __gcd(a,te);
	}
	cout << te << '\n';
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:56:16: error: 'te' was not declared in this scope; did you mean 'tm'?
   56 |         cin >> te;
      |                ^~
      |                tm
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef pair<ll , ll> PLL;
typedef long double ld;

#define pb push_back
#define all(c) c.begin(),c.end()
#define allr(c) c.rbegin(),c.rend()
#define mod 1000000007
#define PI 3.14159265
#define endl '\n'
#define debug(x) cout << #x << " = " << x << endl;
#define MAX 20

inline int add(int a, int b) {a += b; if (a < 0) a += mod; return a;}
inline int sub(int a, int b) {a -= b; if (a < 0) a += mod; return a;}
inline int mul(int a, int b) {return (a * 1ll * b) % mod;}
inline int pwr(int x, ll y) {
    int ans = 1 % mod;
    while (y) {
        if (y & 1) ans = mul(ans, x);
        x = mul(x, x);
        y >>= 1;
    }
    return ans;
}
inline int inv(int a) {return pwr(a, mod - 2);}

string str, ans;
vector <int> vec, cost = {0, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int dgt;
map <string, string> mp;
int req;

void wtf(ll cur) {
    if (cur == 0) {
        if (ans.size() < str.size()) {
            sort(allr(str));
            ans = str;
        }
        else if (ans.size() == str.size()) {
            sort(allr(str));
            ans = max(ans, str);
        }
        return;
    }
    for (int i = 0; i < dgt; i++) {
        if (cur - cost[vec[i]] >= 0) {
            cur -= cost[vec[i]];
            str.insert((int)str.size(), 1, vec[i] + 48);
            wtf(cur);
            cur += cost[vec[i]];
            str.pop_back();
        }
    }
}

string cmpr(string str1, string str2) {
    if (str1.size() > str2.size()) {
        return str1;
    }
    else if (str1.size() < str2.size()) {
        return str2;
    }
    else {
        return max(str1, str2);
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin >> n;
    vector <int> vec;
    int v;
    for (int i = 0; i < n; i++) {
        cin >> v;
        vec.pb(v);
    }
    sort(all(vec));
    int ans = vec[0];
    for (int i = 0; i < n; i++) {
        for (int i = i + 1; j < n; j++) {
            if (vec[j] % vec[i]) {
                ans = 1;
                break;
            }
        }
    }
    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:91:29: error: 'j' was not declared in this scope
   91 |         for (int i = i + 1; j < n; j++) {
      |                             ^
Language: C++

#include <iostream>

using namespace std;

int minof(unsigned long a[], unsigned long n){
    unsigned long min;
    min = a[0];
    for (int i = 0; i < n-1; i++)
    if (a[i] < a[i+1]) min = a[i+1];
    return min;
}

int main(){
    unsigned long N;
    cin >> N;
    unsigned long a[N];
    for (int i=0; i<N; i++)
    cin >> a[i];

    while(true){
        for(int i=0; i<N; i++){
            if (a[i] - minof(a,N) >= 0)
                a[i] -= minof(a,N);         
        }
        if (all_of(a))break;
    }

cout << minof(a,N);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:13: error: 'all_of' was not declared in this scope
   25 |         if (all_of(a))break;
      |             ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    long long int n,ans,c=0,d=0,e=0;
    cin>>n;
    
    long a[n+5];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    
        
        sort(a,a+n);
        for(int j=0;j<n;j++){
            c+=a[j]%a[0];
            d+=a[j]%2;
            e+=a[j]%3;
        }
        if(c==0){
            ans=a[0];
        }
        if(c!=0){
            
            if(d==0){
                ans=2;
            }
            if(d!=0){
                if(e==0{
                    ans=3;
                }
                else{
                ans=1;
                }
            }
        }
    
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:24: error: expected ')' before '{' token
   29 |                 if(e==0{
      |                   ~    ^
      |                        )
a.cc:35:13: error: expected primary-expression before '}' token
   35 |             }
      |             ^
Language: Java

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

public class MainC {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();

		int min = Integer.MAX_VALUE;
		Set<Integer> monsters = new HashSet<Integer>();
		for (int i = 0; i < n; i++) {
			int a = scanner.nextInt();
			if (a < min) {
				min = a;
			}
			monsters.add(a);
		}

		while (min != 1 && 1 < monsters.size()) {
			List<Integer> listMonsters = new ArrayList<Integer>(monsters);
			monsters.clear();

			for (int i = 0; i < listMonsters.size() - 1; i++) {
				int mi = listMonsters.get(i);
				for (int j = i+1; j < listMonsters.size(); j++) {
					int mj = listMonsters.get(j);

					int next = mi < mj ? mj % mi : mi % mj;
					int next2 = mi < mj ? mi  : mj;
					if (next2 % next != 0) {
						monsters.add(next2);
					}

					if (next != 0) {
						monsters.add(next);
						if (next < min) {
							min = next;
						}
					}
				}
			}
		}

		System.out.println(min);

	}

}


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

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <map>
#include <set>

using namespace std;

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

	sort(a.begin(), a.end());

	// できるだけ一体の体力を小さくする
	// 計算量はO(n^2)かO(logn * n^2)にしたい
	vector<long long> dp(n, 10000000000000000); // あまりの最小値
	dp[0] = a[0];

	for (int i = 1; i < n; i++) {
		dp[i] = a[i] % dp[i - 1];
		if (dp[i] == 0) dp[i] = dp[i - 1];
	}

	for (int j = n - 1; j > 0; j--) {
		dp[j - 1] = dp[j - 1] % dp[j];
		if (dp[j - 1] == 0) dp[j - 1] = dp[j];
	}
  
  if(dp[0] % dp[n-1] != 0)
  dp[0] %= d[n-1];

	cout << dp[0] << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:12: error: 'd' was not declared in this scope; did you mean 'dp'?
   38 |   dp[0] %= d[n-1];
      |            ^
      |            dp
Language: C++

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

int main(){

int n;
cin >> n;

vector<int> vec(n);
int i,j;
int min;

for(i=0;i<n;i++)
cin >> vec.at(i);

while(vec.at(n-1)==0){
sort(vec.begin(), vec.end());
for(i=0;i<n;i++) if(vec.at(i)!=0) break;
for(j=i+1;j<n,j++){
vec.at(j) = vec.at(j)%vec.at(0);
  }
}

cout << vex.at(n);

}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: expected ';' before ')' token
   19 | for(j=i+1;j<n,j++){
      |                  ^
      |                  ;
a.cc:24:9: error: 'vex' was not declared in this scope; did you mean 'vec'?
   24 | cout << vex.at(n);
      |         ^~~
      |         vec
Language: C++

#include <bits/stdc++.h>
using namespace std;
int func (int a,int b);
int main(){
long a=0;
long b =0;
int c;
int n;
long ans;
int cnt =0;
cin >> n;
/*  
for(int i=0;i>=n; i++){
if(i==0){
  cin >> a >> b;
}
cin >> c;
} 
  */
 cin >> a >> b;
if(a>=b){
ans = func(a,b);
}else{
ans = func(b,a);
}
cout <<ans<<endl;
}

int func(a,b){
int ans;
while(1){
int r;
r = a%b;
if(r == 0){
ans = b;
break;
}else{
a=b;
b=r;
 }
 }
 return ans;
}

Compiler output:
a.cc:29:10: error: 'int func' redeclared as different kind of entity
   29 | int func(a,b){
      |          ^
a.cc:3:5: note: previous declaration 'int func(int, int)'
    3 | int func (int a,int b);
      |     ^~~~
a.cc:29:10: error: 'a' was not declared in this scope
   29 | int func(a,b){
      |          ^
a.cc:29:12: error: 'b' was not declared in this scope
   29 | int func(a,b){
      |            ^
Language: C

#include<stdio.h>
#include<stdlib.h>
int compar(const int *val1, const int *val2) {
    if ( *val1 < *val2 ) {
        return -1;
    } else if ( *val1 == * val2 ) {
        return 0;
    } else {
        return 1;
    }
}

int main(){
  int N;
  scanf("%d",&N);
  int i,j,k=0;
  int A[N];
  int flg=0;
  for(i=0;i<N;i++){
    scanf("%d ",&A[i]);
    for(j=0;j<i;j++){
      if(A[j] == A[i]){
        N--;
        i--;
        break;
      }
  }
  int tmp,ans=0;
  
  while(k < 10000000){
    ans=0;
    qsort(A, N, sizeof(int),
        (int (*)(const void *, const void *))compar);
    

    for(i=1;i<N;i++){
      A[i] -= A[0];
    }
    
    for(i=0;i<N;i++){
      if(A[i] > 0)
        ans++;
    }
    
    if(ans == 1)
      break;
    
    k++;
  }
  for(i=0;i<N;i++){
    if(A[i] >0){
    printf("%d\n",A[i]);
  return 0;}
  }
}
  


Compiler output:
main.c: In function 'main':
main.c:55:1: error: expected declaration or statement at end of input
   55 | }
      | ^