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

#include <stdio.h>
#include <stdlib.h>

int N;
long *arr;
long i;

long compare(const void *a, const void *b)
{
    return *(long*)a - *(long*)b;
}

long caluc(long *a, long *b){
    long r = *a % *b;
    while(r!=0){
        *a = *b;
        *b = r;
        r = *a % *b;
    }
    return *b;
}

int main(int argc, char *argv[])
{
    long y;
    scanf("%ld",N);
    arr = (long*)malloc(N*sizeof(long));
    for (i = 0; i < N; i++) scanf("%ld",&arr[i]);
    qsort(arr, N ,sizeof(long),compare);
    y = cluc(&arr[N],&arr[N-1]);
    printf("%ld", y);
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:29:32: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   29 |     qsort(arr, N ,sizeof(long),compare);
      |                                ^~~~~~~
      |                                |
      |                                long int (*)(const void *, const void *)
In file included from main.c:2:
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'long int (*)(const void *, const void *)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
main.c:30:9: error: implicit declaration of function 'cluc'; did you mean 'caluc'? [-Wimplicit-function-declaration]
   30 |     y = cluc(&arr[N],&arr[N-1]);
      |         ^~~~
      |         caluc
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  long long A[N];
  for(int i=0;i<N;i++) cin >> A[i];
  long long gcd[N];
  for(int i=0;i<N;i++){
    if(i==0) A[i] = A[N-1];
    else A[i] = A[i-1];
    while(true){
      bool jud = false;
      long long mini = 1000000000;
      for(int j=0;j<N;j++){
        if(mini > A[j]) mini = A[j];
      }
      for(int j=0;j<N;j++){
        A[j] = A[j] - mini;
        if(A[j] != 0) jud = true;
      }
      if(!jud){
        gcd[i] = mini;
        break;
      }
    }
  }
  long long gcdmax = gcd[0];
  for(int i=o;i<N;i++) gcdmax = max(gcdmax, gcd[i]);
  cout << gcdmax << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:13: error: 'o' was not declared in this scope
   29 |   for(int i=o;i<N;i++) gcdmax = max(gcdmax, gcd[i]);
      |             ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;

int euclidean_gcd(int a, int b);

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

  vector<int> a(n);
  for (size_t i = 0; i < n; i++) {
    cin >> a.at(i);
  }

  int max;

  if (n == 1 | n == 2) {
    max = *max_element(a.begin(), a.end());
  } else {
    int ar = euclidean_gcd(a.at(0), a.at(1));
    for (int i = 2; i < n; i++) {
      ar = euclidean_gcd(ar, a.at(i));
    }
    max = ar;

    for (int i = 0; i < n; i++) {
      vector<int> b(a.size());
      copy(a.begin(), a.end(), b.begin());
      b.erase(b.begin()+i);
      int br = euclidean_gcd(b.at(0), b.at(1));
      for (int j = 2; j < b.size(); j++) {
        br = euclidean_gcd(br, b.at(j));
        if (br < max) {
          break
        }
      }
      if (br > max) {
        max = br;
      }
    }
  }

  cout << max << endl;
}

int euclidean_gcd(int a, int b) {
  if (a < b) euclidean_gcd(b, a);
  int r;
  while (a % b > 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return b;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:16: error: expected ';' before '}' token
   38 |           break
      |                ^
      |                ;
   39 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int gcd(int m, int n);
    int gcdarr(vector<int> & arr);

    int n;
    int count = 0;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++)
    {
        cin >> a.at(i);
    }
    if (n >= 3)
    {
        vector<int> lcmarr(n - 1);
        int temp =0;

        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < n; j++)
            {
                if (j < i)
                {
                    lcmarr.at(j) = a.at(j);
                }
                else if (j > i)
                {
                    lcmarr.at(j - 1) = a.at(j);
                }
            }
            temp = gcdarr(lacmarr);
            if (temp > count)
            {
                count = temp;
            }
        }
    }else{
        count = max(a.at(0),a.at(1));
    }

    cout << count << endl;

    return 0;
}
int gcd(int m, int n)
{

    if ((0 == m) || (0 == n))
    {
        return 0;
    }
    while (m != n)
    {
        if (m > n)
            m = m - n;
        else
            n = n - m;
    }
    return m;
}
int gcdarr(vector<int> &arr)
{
    int gcdans = gcd(arr.at(0), arr.at(1));
    for (int i = 2; i < arr.size(); i++)
    {
        gcdans = gcd(arr.at(i), gcdans);
    }
    return gcdans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:27: error: 'lacmarr' was not declared in this scope; did you mean 'lcmarr'?
   34 |             temp = gcdarr(lacmarr);
      |                           ^~~~~~~
      |                           lcmarr
Language: Java

package main.atcoder;

import fastIO.InputReader;

import java.io.PrintWriter;
import java.util.*;

public class CGCDOnBlackboard {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.nextInt();
        int[] arr = new int[n];
        int res = Integer.MAX_VALUE;
        for (int i = 0; i < n; i++) {
            arr[i] = in.nextInt();
        }
        int min = Integer.MAX_VALUE;
        if (n == 2) {
            out.println(Math.max(arr[0], arr[1]));
            return;
        }
        int val = 0;
        int val2 = 0;
        int res2 = Integer.MAX_VALUE;
        List<Integer> list1 = new ArrayList<>();
        List<Integer> list2 = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list1.add(arr[i]);
            list2.add(arr[i]);
        }

        for (int i = 0; i < n - 1; i++) {
            int gcd = GCD(arr[i], arr[i + 1]);
            if (gcd < min) {
                val = arr[i];
                val2 = arr[i + 1];
                min = gcd;
            }
        }
        list1.remove(Integer.valueOf(val));
        list2.remove(Integer.valueOf(val2));
        for (Integer value : list2) {
            int gcd = GCD(value, val);
            res = Math.min(res, gcd);
        }
        for (Integer integer : list1) {
            int gcd = GCD(integer, val2);
            res2 = Math.min(res2, gcd);

        }
        out.println(Math.max(res, res2));
    }

    private int GCD(int a, int b) {
        return b == 0 ? a : GCD(b, a % b);
    }

}


Compiler output:
Main.java:8: error: class CGCDOnBlackboard is public, should be declared in a file named CGCDOnBlackboard.java
public class CGCDOnBlackboard {
       ^
Main.java:3: error: package fastIO does not exist
import fastIO.InputReader;
             ^
Main.java:9: error: cannot find symbol
    public void solve(int testNumber, InputReader in, PrintWriter out) {
                                      ^
  symbol:   class InputReader
  location: class CGCDOnBlackboard
3 errors
Language: C

#include <stdio.h>
#include <stdlib.h>

int N;
long *arr;
long i;

long compare(const void *a, const void *b)
{
    return *(long*)a - *(long*)b;
}

long caluc(long *a, long *b){
    long r = *a % *b;
    while(r!=0){
        *a = *b;
        *b = r;
        r = *a % *b;
    }
    return *b;
}

int main(int argc, char *argv[])
{
    long y;
    scanf("%d",N);
    arr = (long*)malloc(N*sizeof(long));
    for (i = 0; i < N; i++) scanf("%d",&arr[i]);
    qsort(arr, N ,sizeof(long),compare);
    y = cluc(&arr[N],&arr[N-1]);
    printf("%d", y);
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:29:32: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   29 |     qsort(arr, N ,sizeof(long),compare);
      |                                ^~~~~~~
      |                                |
      |                                long int (*)(const void *, const void *)
In file included from main.c:2:
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'long int (*)(const void *, const void *)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
main.c:30:9: error: implicit declaration of function 'cluc'; did you mean 'caluc'? [-Wimplicit-function-declaration]
   30 |     y = cluc(&arr[N],&arr[N-1]);
      |         ^~~~
      |         caluc
Language: Java

public class Main {
	public static void main(String[] args) {
		int i, j;
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int[] a = new int[n];
		for(i=0; i<n; i++) {
			a[i] = Integer.parseInt(sc.next());
		}
		sc.close();
		sc = null;
		if(n==2) {
			System.out.println(Math.max(a[0], a[1]));
		} else {
			int max = 1;
			int pre;
			for(i=0; i < n; i++) {
				pre = i==0?a[1]:a[0];
				for(j=1; j < n; j++) {
					if(i==j) continue;
					pre = gcd(a[j], pre);
					if(pre==1)break;
				}
				if(pre>max)max=pre;
			}
			System.out.println(max);
		}
	}
	public static int gcd(int a, int b) {
		int t;
		while((t=a%b)!=0) {
			a = b;
			b = t;
		}
		return b;
	}
}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <iostream>
using namespace std;


void swap(int *x, int *y){
    int temp;

    temp = *x;
    *x = *y;
    *y = temp;
}

int euclid(int small, int big){
    int amari = 0;

    if(small > big)
        swap(&small, &big);

    while(true){
        if((amari = big % small) == 0)
            return small;

        big = small;
        small = amari;
    }

    return 0;
}



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

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

    int kouyakusuu = 0;
    int max_kouyakusuu = 0;

    kouyakusuu = number[1];
	for(int i = 2; number[i] != 0; i++){
		if((kouyakusuu = euclid(kouyakusuu, number[i])) == 1){
			break;
		}else if(kouyakusuu == 0){
			return 0;
		}
	}
	if(kouyakusuu > max_kouyakusuu) max_kouyakusuu = kouyakusuu;



    for(int skip_i=1;skip_i<n;++skip_i){
        kouyakusuu = number[0];
		for(int i = 1; number[i] != 0; ++i){
			if(i>=n) break;
			if(skip_i != i){
				if((kouyakusuu = euclid(kouyakusuu, number[i])) == 1){
					break;
				}else if(kouyakusuu == 0){
					return 0;
				}
			}
		}
		if(kouyakusuu > max_kouyakusuu) max_kouyakusuu = kouyakusuu;
    }
    cout << max_kouyakusuu << endl;
    return 0;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:36:20: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   36 |         int number[10e6]={0};
      |                    ^~~~
a.cc:36:20: error: could not convert '1.0e+7' from 'double' to 'long unsigned int'
   36 |         int number[10e6]={0};
      |                    ^~~~
      |                    |
      |                    double
a.cc:36:20: error: size of array 'number' has non-integral type 'double'
Language: C

#include <algorithm>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <math.h>
#include <numeric>
#include <sstream>
#include <unordered_map>
#include <vector>
using namespace std;

int gcd(int a, int b) {
  if (a < b) {
    a ^= b;
    b ^= a;
    a ^= b;
  }

  return b ? gcd(b, a % b) : a;
}

int main() {
  long long int n, tmp;
  vector<long long int>  gcdval;
  vector<long long int> v;

  cin >> n;

  for (int i = 0; i < n; i++) {
    scanf("%lld", &tmp);
    v.push_back(tmp);
  }

  sort(v.rbegin(), v.rend()); //降順

  for (int i = 0; i < n-1; i++){
      for (int j = n-1; j > i; j--){
          if(gcd(v[i], v[j])>1){
            gcdval.push_back(gcd(v[i], v[j]));
          }
      }
  }
  
  sort(gcdval.rbegin(), gcdval.rend());
  cout << gcdval[0] << endl;

  return 0;
}


Compiler output:
main.c:1:10: fatal error: algorithm: No such file or directory
    1 | #include <algorithm>
      |          ^~~~~~~~~~~
compilation terminated.
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.at(i);
    }
  
  int M = A.at(0); //Mを小さくしていっていくつ割り切るか調べる
  
  while(true){
    int count=0;//MがAをいくつ割り切るか数える
    for(int i=0;i<N;i++){
      if(A.at(i) % M == 0){
        count ++;
      }
    }    
    if(count >= N-1){
      break;
    }
    M -= 1;
  }
  
  cout << M << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected ',' or ';' before 'for'
   10 |     for(int i=0;i<N;i++){
      |     ^~~
a.cc:10:17: error: 'i' was not declared in this scope
   10 |     for(int i=0;i<N;i++){
      |                 ^
Language: C

#include<stdio.h>
int main(void){
  int n;
  int i, j, ans;
  int max = 0;
  int flg = 0;
  
  scanf("%d", &n);
  
  int a[n];
  for(i = 0; i < n; i++){
    scanf("%d", &a[i]);
    if(max < a[i]){
      max = a[i];
    }
  }
  
  for(j = max; j > 0; j--){
    for(i = 0; i < n; i++){
      if((a[i] % j) != 0){
        cnt++;
        if(cnt == 2){
          cnt = 0;
          break;
        }
      }
      else if(i == n -1){
        ans = j;
        flg = 1;
        break;
      }
    }
    if(flg == 1){
      printf("%d\n", ans);
      break;
    }
  }
  return 0;
}
  

Compiler output:
main.c: In function 'main':
main.c:21:9: error: 'cnt' undeclared (first use in this function); did you mean 'int'?
   21 |         cnt++;
      |         ^~~
      |         int
main.c:21:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>

int N;
long *arr;
long i;

long compare(const void *a, const void *b)
{
    return *(long*)a - *(long*)b;
}

void caluc(long *a, long *b){
    long r = a % b;
    while(r!=0){
        *a = *b;
        *b = r;
        r = *a % *b;
  }
}

int main(int argc, char *argv[])
{
    scanf("%d",N);
    arr = (long*)malloc(N*sizeof(long));
    for (i = 0; i < N; i++) scanf("%d",&arr[i]);
    qsort(arr, N ,sizeof(long),compare);
    cluc(&arr[N],&arr[N-1]);
    return 0;
}



Compiler output:
main.c: In function 'caluc':
main.c:14:16: error: invalid operands to binary % (have 'long int *' and 'long int *')
   14 |     long r = a % b;
      |                ^
main.c: In function 'main':
main.c:27:32: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   27 |     qsort(arr, N ,sizeof(long),compare);
      |                                ^~~~~~~
      |                                |
      |                                long int (*)(const void *, const void *)
In file included from main.c:2:
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'long int (*)(const void *, const void *)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
main.c:28:5: error: implicit declaration of function 'cluc'; did you mean 'caluc'? [-Wimplicit-function-declaration]
   28 |     cluc(&arr[N],&arr[N-1]);
      |     ^~~~
      |     caluc
Language: Java

import java.io.PrintStream;
import java.util.Scanner;

import library.common.Predef;

public class Main {
    static final PrintStream so = System.out;
    static final Scanner sc = new Scanner(System.in);
    
    public static void main(String[] args) {
        int N = ni();
        int[] A = new int[N];
        for (int i = 0; i < N; i++) {
            A[i] = ni();
        }
        
        int idx = -1;
        int minGCD = Integer.MAX_VALUE;
        
        for (int i = 0; i < N; i++) {
            int nextI = (i == N-1) ? 0 : i+1;
            int GCDi = gcd(A[i], A[nextI]);
            if (GCDi < minGCD) {
                minGCD = GCDi;
                idx = i;
            }
        }

        int[] copy1 = A.clone();
        copy1[idx] = 0;
        int[] copy2 = A.clone();
        copy2[idx == N-1 ? 0 : idx+1] = 0;
        
        so.println(Math.max(gcd(copy1), gcd(copy2)));
    }
    
    static int gcd(int[] a) {
        int ans = 0;
        for (int i = 0; i < a.length; i++) {
            int nextI = i == a.length-1 ? 0 : i+1;
            int GCDi = gcd(a[i], a[nextI]);
            ans = gcd(ans, GCDi);
        }
        return ans;
    }
    
    static int gcd(int m, int n) {
        if(m < n) return gcd(n, m);
        if(n == 0) return m;
        return gcd(n, m % n);
    }
        
       
    static int ni() {
        return sc.nextInt();
    }
    
    static long nl() {
        return sc.nextLong();
    }

    static char[] nsToChars() {
        return sc.next().toCharArray();
    }
}


Compiler output:
Main.java:4: error: package library.common does not exist
import library.common.Predef;
                     ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int ucrid(int x,int y){
  int a;
  int b;
  a=max(x,y);
  b=min(x,y);
  while (true){
    if (a/b==0){
      return b;
    }
    else if{
      x=b;
      y=a/b;
      a=x;
      b=y;
    }
  }
}
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> ml(n);
  vector<int> mr(n);
  vector<int> m(n);
  for (int i=0; i<n; i++){
    cin >> a[i] ;
  }
  ml[0]=a[0];
  mr[n-1]=a[n-1];
  for (int i=1; i<n; i++){
    ml[i] = ucrid(a[i], ml[i-1]);
    mr[n-i-1] = ucrid(a[n-i-1], mr[n-i]);
  }
  for (int i=0; i<n-1; i++){
    m[i] = ucrid(ml[i-1],mr[i+1]);
  }
  m[0]= mr[1];
  m[n-1]=ml[n-2];
  int answer;
  answer=m[0];
  for (int i=1; i<n; i++){
    answer=max(answer,m[i]);
  }
  cout << answer << endl;
}

Compiler output:
a.cc: In function 'int ucrid(int, int)':
a.cc:12:12: error: expected '(' before '{' token
   12 |     else if{
      |            ^
      |            (
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	long long a[i];
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	long long sum;
	for(int i=1;i<=n-1;i++){
		if(a[i]<=0)a[i]-=a[i]*2;
		else a[i]+=a[i]*2;
		sum+=a[i];
		if(a[i+1]<=0)a[i+1]-=a[i+!]*2;
		else a[i+1]+=a[i+1]*2;
		sum+=a[i+1];
	}
	cout<<sum;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:21: error: 'i' was not declared in this scope
    4 |         long long a[i];
      |                     ^
a.cc:8:22: error: 'a' was not declared in this scope
    8 |                 cin>>a[i];
      |                      ^
a.cc:12:20: error: 'a' was not declared in this scope
   12 |                 if(a[i]<=0)a[i]-=a[i]*2;
      |                    ^
a.cc:14:22: error: 'a' was not declared in this scope
   14 |                 sum+=a[i];
      |                      ^
a.cc:15:43: error: expected primary-expression before ']' token
   15 |                 if(a[i+1]<=0)a[i+1]-=a[i+!]*2;
      |                                           ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<queue>
#include<stack>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<algorithm>
#include<math.h>
using namespace std;
int GCD(int a, int b){
  return b?GCD(b,a%b):a;
}
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  vector<int> b(n,a[0]);
  b[0]=b[1];
  for(int i=0;i<n;i++){
    for(int i=0;j<n;j++){
      if(i!=j){
        b[j]=GCD(b[j],a[i]);
      }
    }
  }
  int ans=0;
  for(int i=0;i<n;i++){
    if(ans<b[i])ans=b[i];
  }
  cout << ans << endl;
}

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

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

int main(){
  int N;
  vector<int> A;
  cin >> N;
  for(int i=0;i<N;i++){
    int temp;
    cin >>temp;
    A.push_back(temp);
  }
  sort(A.begin(),A.end(),greater<int>());

  vector<int> ans1,ans2,ans3;

  //一番大きいものと一番小さいものの最大公約数を求めてみる。
  //二番目と1番小さい
  // 一番目と二番目
  int r1=A[0]%A[N-1];
  int a=A[0],b=A[N-1];
 
  while(r1!=0){
    a = b;
    b = r1;
    r1 = a%b;
  }
  r1 = b;
  int r2=A[1]%A[N-1];
  a=A[1],b=A[N-1];
  while(r2!=0){
    a = b;
    b = r2;
    r2 = a%b;
  }
  r2 = b;
  int r3=A[0]%A[N-2];
  a=A[0],b=A[N-2];
  while(r3!=0){
    a = b;
    b = r3;
    r3 = a%b;
  }
  r3 = b;
  //cout<<r1<<" "<<r2<<" "<<r3<<endl;
  int result=0;
  int change1,change2,change3=0;
  bool flag = false;
  while(!flag){
    for(int i=0;i<N;i++){
      if(A[i]%r1 !=0) change1++;
      if(A[i]%r2 !=0) change2++;
      if(A[i]%r3 !=0) change3++;
    }
    //cout<<change1<<" "<<change2<<" "<<change3<<endl;
    if(change1<2 && change2<2 && change3<2){
      result = max(r1,r2);
      result = max(result,r3);
      flag=true;
    }else{
      int res1,res2,res3;
      if(r1>r2) res1=r1%r2;
      else res1 = r2%r1;
      if(r1>r3) res2=r1%r3;
      else res2 = r3%r1;
      if(r2>r3) res3=r2%r3;
      else res3 = r2%r3;
      a = max(r1,r2);
      b = min(r1,r2);
      while(res1!=0){
	a = b;
	b = res1;
	res1 = a%b;
      }
      res1 = b;
      a = max(r1,r3);
      b = min(r1,r3);
      while(res2!=0){
	a = b;
	b = res2;
	res2 = a%b;
      }
      res2 = b;
      a = max(r2,r3);
      b = min(r2,r3);
      while(res3!=0){
	a = b;
	b = res3;
	res3 = a%b;
      }
      res3=b;
    }
  }//end of while

  cout<<result<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |   sort(A.begin(),A.end(),greater<int>());
      |   ^~~~
      |   short
Language: C++

#include<bits/stdc++.h>
using namespace std;
int ucrid(int x,int y){
  int a;
  int b;
  a=max(x,y);
  b=min(x,y);
  while (true){
    if (a/b==0){
      return b;
    }
    else if{
      a=b;
      b=a/b;
    }
  }
}
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> ml(n);
  vector<int> mr(n);
  vector<int> m(n);
  for (int i=0; i<n; i++){
    cin >> a[i] ;
  }
  ml[0]=a[0];
  mr[n-1]=a[n-1];
  for (int i=1; i<n; i++){
    ml[i] = ucrid(a[i], ml[i-1]);
    mr[n-i-1] = ucrid(a[n-i-1], mr[n-i]);
  }
  for (int i=0; i<n-1; i++){
    m[i] = ucrid(ml[i-1],mr[i+1]);
  }
  m[0]= mr[1];
  m[n-1]=ml[n-2];
  int answer;
  answer=m[0];
  for (int i=1; i<n; i++){
    answer=max(answer,m[i]);
  }
  cout << answer << endl;
}

Compiler output:
a.cc: In function 'int ucrid(int, int)':
a.cc:12:12: error: expected '(' before '{' token
   12 |     else if{
      |            ^
      |            (
Language: C

#include<stdio.h>

int main(void){
  int n,i,j,count,max=0;
  scanf("%d",&n);
  int c[n];
  for(i=0;i<=n;i++){
    scanf("%d",&c[i]);
    if(max<c[i]){
      max=c[i];
    }
  }
  for(i=max;i>0;i--){
    count=0
    for(j=0;j<=n;j++){
      if(c[j]%i!=0){
        count++;
      }
    }
    if count==1 || count==0{
      printf("%d\n",i);
      break;
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:12: error: expected ';' before 'for'
   14 |     count=0
      |            ^
      |            ;
   15 |     for(j=0;j<=n;j++){
      |     ~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int ucrid(int x,int y){
  int a;
  int b;
  a=max(x,y);
  b=min(x,y);
  while (true){
    if (a/b==0){
      return b;
    }
    else if{
      a=b;
      b=a/b
    }
  }
}
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> ml(n);
  vector<int> mr(n);
  vector<int> m(n);
  for (int i=0; i<n; i++){
    cin >> a[i] ;
  }
  ml[0]=a[0];
  mr[n-1]=a[n-1];
  for (int i=1; i<n; i++){
    ml[i] = ucrid(a[i], ml[i-1]);
    mr[n-i-1] = ucrid(a[n-i-1], mr[n-i]);
  }
  for (int i=0; i<n-1; i++){
    m[i] = ucrid(ml[i-1],mr[i+1]);
  }
  m[0]= mr[1];
  m[n-1]=ml[n-2];
  int answer;
  answer=m[0];
  for (int i=1; i<n; i++){
    answer=max(answer,m[i]);
  }
  cout << answer << endl;
}

Compiler output:
a.cc: In function 'int ucrid(int, int)':
a.cc:12:12: error: expected '(' before '{' token
   12 |     else if{
      |            ^
      |            (
Language: C++

#include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
int n;
int a[100000];
int b[100000][100000];
queue<long> q;

int gcd(int n,int m){
    int tmp;
    if(n < m){
        tmp = m;
        m = n;
        n = tmp;
    }
    while(m != 0){
        tmp = m;
        m = n%m;
        n = tmp;
    }
    return n;
}
int solve(){
    int tmp1,tmp2;
    while(!(q.size() == 1)){
        tmp1 = q.front();
        q.pop();
        tmp2 = q.front();
        q.pop();
        q.push(gcd(tmp1,tmp2));
    }
    return q.front();
}

int main(){
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> a[i];    
    }
    if(n == 2){
        cout << max(a[0],a[1]) << endl;
        return 0;
    }
    int ans = 0;
    for(int i=0;i<n;i++){
        int tans = 0;
        while(!q.empty()){
            q.pop();
        }
        for(int j = 0;j<n;j++){
            if(j==i){

            }
            else{
                q.push(a[j]);
            }
        }
         tans = solve();
         if(tans > ans){
             ans = tans;
         }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
/tmp/ccpCE0aD.o: in function `solve()':
a.cc:(.text+0x54): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccpCE0aD.o
a.cc:(.text+0x69): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccpCE0aD.o
a.cc:(.text+0x78): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccpCE0aD.o
a.cc:(.text+0x8d): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccpCE0aD.o
a.cc:(.text+0xb8): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccpCE0aD.o
a.cc:(.text+0xc7): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccpCE0aD.o
a.cc:(.text+0xe5): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccpCE0aD.o
/tmp/ccpCE0aD.o: in function `main':
a.cc:(.text+0x1c1): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccpCE0aD.o
a.cc:(.text+0x1d0): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccpCE0aD.o
a.cc:(.text+0x21b): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccpCE0aD.o
/tmp/ccpCE0aD.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x28d): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

ull gcd(ull m, ull n) {
    while(true) {
        if(n==0)
            return m;

        ull tmp = n;
        n = m % n;
        m = tmp;
    }
}

ull exec(ull x, vector<ull>& A) {
    ull min_gcd = x;
    ull second_min_gcd = x;
    for(int i=0; i<(int)A.size(); i++) {
        ull t = gcd(x, A[i]);
        if(min_gcd > t) {
            min_gcd = t;
        } else if (second_min_gcd > t) {
            second_min_gcd = t;
        }
    }

    return second_min_gcd;
}

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

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

    if(N == 2)
        cout << max(A[0], A[1]) << endl;
    else
        cout << max(exec(A[0], A), exec(A[1], A), exec(A[2], A)) << endl;

    return 0;
}

Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = long long unsigned int; _Compare = long long unsigned int]':
a.cc:50:20:   required from here
   50 |         cout << max(exec(A[0], A), exec(A[1], A), exec(A[2], A)) << endl;
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <cstdlib>
#include <iostream>
#include <memory>

using namespace std;
int calcGCD(int *list, int len);

int calcGCD(int *list, int len)
{
  int c = len;

  // ユークリッドの互除法を末尾2要素にかける
  int v = list[c - 1] % list[c - 2];
  if (v == 0)
  {
    if (c == 2)
    {
      return list[c - 2];
    }
    // 2要素の最大公約数が決まったら、配列を更新して再帰
    return calcGCD(list, len - 1);
  }

  list[c - 1] = list[c - 2];
  list[c - 2] = v;
  return calcGCD(list, len);
}

int gcd(int *list, int len)
{
  int c = len;
  if (c == 0)
    return 0;
  else if (c == 1)
    return list[0];
  return calcGCD(list, len);
}

int main()
{
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);

  int N;
  cin >> N;

  int *A = nullptr;
  A = new int[N];
  int min = 1000 * 000 * 000;
  int secondMin = 1000 * 1000 * 1000;

  for (int index = 0; index < N; index++)
  {
    cin >> A[index];
  }
  int maxGCD = 1;
  int *copy = nullptr;
  copy = new int[N];
  int currentGCD = 1;
  for (int removeIndex = 0; removeIndex < N; removeIndex++)
  {
    memcpy(copy, A, N * __SIZEOF_INT__);
    if (removeIndex == 0)
    {
      copy[0] = copy[1];
    }
    else
    {
      copy[removeIndex] = copy[0];
    }

    currentGCD = gcd(copy, N);
    if (maxGCD < currentGCD)
    {
      maxGCD = currentGCD;
    }
  }

  cout << maxGCD << endl;

  return EXIT_SUCCESS;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:5: error: 'memcpy' was not declared in this scope
   62 |     memcpy(copy, A, N * __SIZEOF_INT__);
      |     ^~~~~~
a.cc:4:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <memory>
  +++ |+#include <cstring>
    4 |
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<queue>
#include<stack>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<algorithm>
#include<math.h>
using namespace std;
int GCD(int a, int b){
  return b?GCD(b,a%b):a;
}
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  vector<int> b(n,a[0]);
  b[0]=b[1];
  for(int i=0;i<n;i++){
    for(int i=0;j<n;j++){
      if(i!=j){
        b[j]=gcd(b[j],a[i]);
      }
    }
  }
  int ans=0;
  for(int i=0;i<n;i++){
    if(ans<b[i])ans=b[i];
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'j' was not declared in this scope
   26 |     for(int i=0;j<n;j++){
      |                 ^
a.cc:28:14: error: 'gcd' was not declared in this scope
   28 |         b[j]=gcd(b[j],a[i]);
      |              ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int ucrid(int x,int y){
  int a;
  int b;
  a=max(x,y);
  b=min(x,y);
  while (true){
    if (a/b==0){
      return b;
    }
    else if{
      a=b;
      b=a/b
    }
  }
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> ml(n);
  vector<int> mr(n);
  vector<int> m(n);
  for (int i=0; i<n; i++){
    cin >> a[i] ;
  }
  ml[0]=a[0];
  mr[n-1]=a[n-1];
  for (int i=1; i<n; i++){
    ml[i] = ucrid(a[i], ml[i-1]);
    mr[n-i-1] = ucrid(a[n-i-1], mr[n-i]);
  }
  for (int i=0; i<n-1; i++){
    m[i] = ucrid(ml[i-1],mr[i+1]);
  }
  m[0]= mr[1];
  m[n-1]=ml[n-2];
  int answer;
  answer=m[0];
  for (int i=1; i<n; i++){
    answer=max(answer,m[i]);
  }
  cout << answer << endl;
}

Compiler output:
a.cc: In function 'int ucrid(int, int)':
a.cc:12:12: error: expected '(' before '{' token
   12 |     else if{
      |            ^
      |            (
a.cc:17:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   17 | int main(){
      |         ^~
a.cc:17:9: note: remove parentheses to default-initialize a variable
   17 | int main(){
      |         ^~
      |         --
a.cc:17:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:17:11: error: a function-definition is not allowed here before '{' token
   17 | int main(){
      |           ^
a.cc:44:2: error: expected '}' at end of input
   44 | }
      |  ^
a.cc:3:23: note: to match this '{'
    3 | int ucrid(int x,int y){
      |                       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  long long A[N];
  for(int i=0;i<N;i++) cin >> A[i];
  long long gcd[N];
  for(int i=0;i<N;i++){
    if(i==0) A[i] = A[N-1];
    else A[i] = A[i-1];
    while(true){
      bool jud = false;
      long long mini = 1000000000;
      for(int j=0;j<N;j++){
        if(mini > A[j]) mini = A[j];
      }
      for(int j=0;j<N;j++){
        A[j] = A[j] - mini;
        if(A[j] != 0) jud = true;
      }
      if(!jud){
        gcd[i] = mini;
        break;
      }
    }
  }
  int gcdmax = gcd[0];
  for(int i=o;i<N;i++) gcdmax = max(gcdmax, gcd[i]);
  cout << gcdmax << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:13: error: 'o' was not declared in this scope
   29 |   for(int i=o;i<N;i++) gcdmax = max(gcdmax, gcd[i]);
      |             ^
a.cc:29:36: error: no matching function for call to 'max(int&, long long int&)'
   29 |   for(int i=o;i<N;i++) gcdmax = max(gcdmax, gcd[i]);
      |                                 ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:29:36: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   29 |   for(int i=o;i<N;i++) gcdmax = max(gcdmax, gcd[i]);
      |                                 ~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:29:36: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   29 |   for(int i=o;i<N;i++) gcdmax = max(gcdmax, gcd[i]);
      |                                 ~~~^~~~~~~~~~~~~~~~
Language: C++

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

int main(){
    int n;
    cin >> n;
    vector<int> a(n),b(n-1);
    for(int i=0;i<n;i++) cin >> a.at(i);
    sort(a.begin(),a.end());
    for(int i=0;i<n-1;i++){
        b.at(i)=gcdgcd(a.at(i),a.at(i+1));
        if(b.at(i+1)<b.at(i)){
            cout << b.at(i) << endl;
            return 0;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'gcdgcd' was not declared in this scope
   12 |         b.at(i)=gcdgcd(a.at(i),a.at(i+1));
      |                 ^~~~~~
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
 
int main() {
  int n,p,max,s=1,n2;
  cin >> n;
  n2 = n-1;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a.at(i);
  }
  max = max_element(a.begin(),a.end());
  int b;
  for(b=2;b<=max;b++){
    p=0;
    for(int j=0;j<n;j++){
      if(a[j]%b==0) p++; 
    }
    if(p==n2) s = b;
  }
  cout << s << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in assignment
   15 |   max = max_element(a.begin(),a.end());
      |         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
      |                    |
      |                    __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  long long A[N];
  for(int i=0;i<N,i++) cin >> A[i];
  long long gct[N];
  for(int i=0;i<N;i++){
    if(i==0) A[i] = A[N-1];
    else A[i] = A[i-1];
    while(true){
      bool jud = false;
      long long mini = 1000000000;
      for(int j=0;j<N;j++){
        if(mini > A[j]) mini = A[j];
      }
      for(int j=0;j<N;j++){
        A[j] = A[j] - mini;
        if(A[j] != 0) jud = true;
      }
      if(!jud){
        gct[i] = mini;
        break;
      }
    }
  }
  int gctmax = gct[0];
  for(int i=o;i<N;i++) gctmax = max(gctmax, gct[i]);
  cout << gctmax << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: expected ';' before ')' token
    7 |   for(int i=0;i<N,i++) cin >> A[i];
      |                      ^
      |                      ;
a.cc:29:13: error: 'o' was not declared in this scope
   29 |   for(int i=o;i<N;i++) gctmax = max(gctmax, gct[i]);
      |             ^
a.cc:29:36: error: no matching function for call to 'max(int&, long long int&)'
   29 |   for(int i=o;i<N;i++) gctmax = max(gctmax, gct[i]);
      |                                 ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:29:36: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   29 |   for(int i=o;i<N;i++) gctmax = max(gctmax, gct[i]);
      |                                 ~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:29:36: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   29 |   for(int i=o;i<N;i++) gctmax = max(gctmax, gct[i]);
      |                                 ~~~^~~~~~~~~~~~~~~~
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
 
int main() {
  int n,p,max,s=1,n2;
  cin >> n;
  n2 = n-1;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a.at(i);
  }
  max = max_element(a.begin(),a.end())
  int i;
  for(i=2;i<=max;i++){
    p=0;
    for(int j=0;j<n;j++){
      if(a[j]%i==0) p++; 
    }
    if(P==n2) s = i;
  }
  cout << s << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in assignment
   15 |   max = max_element(a.begin(),a.end())
      |         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
      |                    |
      |                    __gnu_cxx::__normal_iterator<int*, std::vector<int> >
a.cc:17:7: error: 'i' was not declared in this scope
   17 |   for(i=2;i<=max;i++){
      |       ^
a.cc:22:8: error: 'P' was not declared in this scope
   22 |     if(P==n2) s = i;
      |        ^
Language: C++

#include <iostream>
#include <queue>
using namespace std;
int n;
long a[100000];
long b[100000][100000];
queue<long> q;

long gcd(long n,long m){
    long tmp;
    if(n < m){
        tmp = m;
        m = n;
        n = tmp;
    }
    while(m != 0){
        tmp = m;
        m = n%m;
        n = tmp;
    }
    return n;
}
long solve(){
    int tmp1,tmp2;
    while(!(q.size() == 1)){
        tmp1 = q.front();
        q.pop();
        tmp2 = q.front();
        q.pop();
        q.push(gcd(tmp1,tmp2));
    }
    return q.front();
}

int main(){
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> a[i];    
    }
    if(n == 2){
        cout << max(a[0],a[1]) << endl;
        return 0;
    }
    int ans = 0;
    for(int i=0;i<n;i++){
        int tans = 0;
        queue<long> g;
        q = g;
        for(int j = 0;j<n;j++){
            if(j==i){

            }
            else{
                q.push(a[j]);
            }
        }
         tans = solve();
         if(tans > ans){
             ans = tans;
         }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
/tmp/ccBCn0CM.o: in function `solve()':
a.cc:(.text+0x68): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccBCn0CM.o
a.cc:(.text+0x7d): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccBCn0CM.o
a.cc:(.text+0x8c): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccBCn0CM.o
a.cc:(.text+0xa1): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccBCn0CM.o
a.cc:(.text+0xd1): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccBCn0CM.o
a.cc:(.text+0xe0): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccBCn0CM.o
a.cc:(.text+0xfe): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccBCn0CM.o
/tmp/ccBCn0CM.o: in function `main':
a.cc:(.text+0x1ee): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccBCn0CM.o
a.cc:(.text+0x228): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccBCn0CM.o
/tmp/ccBCn0CM.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x2c6): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccBCn0CM.o
a.cc:(.text+0x2df): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <queue>
using namespace std;
int n;
long a[100000];
long b[100000][100000];
queue<long> q;

long gcd(long n,long m){
    long tmp;
    if(n < m){
        tmp = m;
        m = n;
        n = tmp;
    }
    while(m != 0){
        tmp = m;
        m = n%m;
        n = tmp;
    }
    return n;
}
long solve(){
    int tmp1,tmp2;
    while(!(q.size() == 1)){
        tmp1 = q.front();
        q.pop();
        tmp2 = q.front();
        q.pop();
        q.push(gcd(tmp1,tmp2));
    }
    return q.front();
}

int main(){
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> a[i];    
    }
    if(n == 2){
        cout << max(a[0],a[1]) << endl;
        return 0;
    }
    int ans = 0;
    for(int i=0;i<n;i++){
        int tans = 0;
        queue<long> g;
        q = g;
        for(int j = 0;j<n;j++){
            if(j==i){

            }
            else{
                q.push(a[j]);
            }
        }
         tans = solve();
         if(tans > ans){
             ans = tans;
         }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
/tmp/ccJdCvpJ.o: in function `solve()':
a.cc:(.text+0x68): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccJdCvpJ.o
a.cc:(.text+0x7d): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccJdCvpJ.o
a.cc:(.text+0x8c): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccJdCvpJ.o
a.cc:(.text+0xa1): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccJdCvpJ.o
a.cc:(.text+0xd1): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccJdCvpJ.o
a.cc:(.text+0xe0): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccJdCvpJ.o
a.cc:(.text+0xfe): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccJdCvpJ.o
/tmp/ccJdCvpJ.o: in function `main':
a.cc:(.text+0x1ee): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccJdCvpJ.o
a.cc:(.text+0x228): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccJdCvpJ.o
/tmp/ccJdCvpJ.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x2c6): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccJdCvpJ.o
a.cc:(.text+0x2df): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <vector>
#include <iostream>
#include <unordered_map>
#include <map>
#include <cmath>
#include <set>
using namespace std;

#define int long long
 
map<int, int> prime_factor(int n) {
    map<int, int> ret;
    for (int i = 2; i * i <= n; i++) {
        while (n % i == 0) {
            ret[i]++;
            n /= i;
        }
    }
 
    if (n != 1) ret[n] = 1;
    return move(ret);
};
 
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  
  set<int> keys;
  for (int i = 0; i < N; i++) {
  	map<int, int> factors = prime_factor(A[i]);
    for (auto it = factors.begin(); it != factors.end(); it++) keys.insert(it->first);
  }
  
  unordered_map<int, int> first;
  unordered_map<int, int> second;
  for (auto it = keys.begin(); it != keys.end(); it++) {
  	first[*it] = 1 << 30;
    second[*it] = 1 << 30;
  }
  
  for (int i = 0; i < N; i++) {   
    map<int, int> factors = prime_factor(A[i]);
    
    for (auto it = keys.begin(); it != keys.end(); it++) {
      if (factors.find(*it) == factors.end()) factors[*it] = 0;
    }
    
    for (auto it = factors.begin(); it != factors.end(); it++) {
      if (it->second < first[it->first]) {
        second[it->first] = first[it->first];
        first[it->first] = it->second;
      } else if (it->second < second[it->first]) {
        second[it->first] = it->second;
      }
    }
  }
  
  int ret = 1;
  for (auto it = second.begin(); it != second.end(); it++) {
    ret *= (int) pow(it->first, it->second);
  }
  cout << ret << endl;
}

Compiler output:
cc1plus: error: '::main' must return 'int'