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

#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
    long long int a[100000];
    long long int n,m,k;
    scanf("%lld",&n);
    for(int i = 1 ; i <= n ; i ++ )
    {
        scanf("%lld",&a[i]);
    }
    sort(a,a + n);
    m = a[n - 1] - (a[n] % a[n - 1]);
    k = a[n] % a[n - 1];
    m = min(m,k);
    if(m != 0 && a[1] > m)
        printf("%lld\n",m);
    if(m == 0)
        printf("%lld\n",a[1]);
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: expected '}' at end of input
   21 |     return 0;
      |              ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C

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

using namespace std;
typedef long long ll;
int g(int a,int b){
	return b?g(b,a%b):a;
}
int main(){
	int n,a,b;
	cin>>n;
	cin>>b;
	for(int i=1;i<n;i++){
		cin>>b;
		a=g(a,b);
	}
	cout<<a<<endl;
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
int n;cin>>n;
vector<int> k;
for(int i=0;i<n:i++) cin>>k.at(i);
int s=k[0];
for(int i=0;i<n:i++) s=gcd(s,k.at(i));
cout<<s<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
    6 | for(int i=0;i<n:i++) cin>>k.at(i);
      |             ^
a.cc:6:16: error: found ':' in nested-name-specifier, expected '::'
    6 | for(int i=0;i<n:i++) cin>>k.at(i);
      |                ^
      |                ::
a.cc:6:15: error: 'n' is not a class, namespace, or enumeration
    6 | for(int i=0;i<n:i++) cin>>k.at(i);
      |               ^
a.cc:8:1: error: expected primary-expression before 'for'
    8 | for(int i=0;i<n:i++) s=gcd(s,k.at(i));
      | ^~~
a.cc:7:12: error: expected ')' before 'for'
    7 | int s=k[0];
      |            ^
      |            )
    8 | for(int i=0;i<n:i++) s=gcd(s,k.at(i));
      | ~~~         
a.cc:6:4: note: to match this '('
    6 | for(int i=0;i<n:i++) cin>>k.at(i);
      |    ^
a.cc:8:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
    8 | for(int i=0;i<n:i++) s=gcd(s,k.at(i));
      |             ^
a.cc:8:16: error: found ':' in nested-name-specifier, expected '::'
    8 | for(int i=0;i<n:i++) s=gcd(s,k.at(i));
      |                ^
      |                ::
a.cc:8:15: error: 'n' is not a class, namespace, or enumeration
    8 | for(int i=0;i<n:i++) s=gcd(s,k.at(i));
      |               ^
a.cc:10:1: error: expected primary-expression before '}' token
   10 | }
      | ^
a.cc:9:15: error: expected ')' before '}' token
    9 | cout<<s<<endl;
      |               ^
      |               )
   10 | }
      | ~              
a.cc:8:4: note: to match this '('
    8 | for(int i=0;i<n:i++) s=gcd(s,k.at(i));
      |    ^
a.cc:10:1: error: expected primary-expression before '}' token
   10 | }
      | ^
Language: C++

#include<bits/stdc++.h>
#include <cstring>
using namespace std;
#define ll  long long
#define endl '\n'
const ll mod = 1000000007;
const double PI = 3.141592653589793238463;
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int x,y,g
    cin>>x;
    cin>>y;
    g=y;
    for (int i=1;i<x;i++)
    {
        cin>>y;
        g=__gcd(g,y);
    }
    cout<<g<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: expected initializer before 'cin'
   13 |     cin>>x;
      |     ^~~
a.cc:15:5: error: 'g' was not declared in this scope
   15 |     g=y;
      |     ^
Language: C++

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

long long gcd(long long a,long long b){
  if(b == 0) return a;
  return gcd(b,a%b);
}


int main(void){
	long long int  a,b[100010];
  cin >> a >>b[0];
  
  d=b[0];
  
  for(int i=1;i<a;i++){
    cin >> b[i];
    d = gcd(d,b[i]);
  }
 
  cout << d << endl;
  return 0;
}
      
  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'd' was not declared in this scope
   15 |   d=b[0];
      |   ^
Language: C++

/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
#define rep(i, n) for(long long int i = 0; i < (n); i++)


int Len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}


int Sint(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}


int Svec(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}


int GCD(int a,int b){
  int r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return b;
}


int LCM(int a,int b){
  int c=a,d=b,r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return c/b*d;
}


int Factorial(int n){
  int m=1;
  while(n>=1) m*=n,n--;
  return m;
}


/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  int n;
  cin>>n;
  vector<int> v(n);
  rep(i,n) cin>>v[i];
  ans=v[0];
  rep(i,n){
    ans=GCD(ans,v[i]);
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:73:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   73 |   ans=v[0];
      |   ^~~
      |   abs
Language: C++

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

typedef long long int ll;

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

    vector<ll> A(N);
    for(int i=0; i<N; i++){
        cin >> A[i];
        }
    sort(A.begin(), A.end());
    int Size = N;
    int k = 0;
    while(Size > 1){
        if(A[k] == 0){ k++;if(k>N)k=0;continue;}
        for(int i=0; i<N; i++){
            if(i != k && A[i] != 0){
                A[i] = A[i] % A[k];
                if(A[i]==0){
                    Size--;
                    if(Size==1) cout << A[k];
                    }
                }



            }
            k++;
            if(k>N)k=0;
        }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |     sort(A.begin(), A.end());
      |     ^~~~
      |     short
Language: Java

import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();
    int[] A = new int[N];

    for (int i = 0; i < N; i++) {
      A[i] = sc.nextInt();
    }

    sc.close();

    int gcd = gcd(A[0], A[1]);

    for (int i = 2; i < N-1; i++) {
      gcd = gcd(gcd, A[i]);
    }

    System.out.println(gcd);

  }

  public static int gcd(int x, int y){

    if (b == 0) {
      return a;
    }

    return gcd(b, a % b);

  }

}

Compiler output:
Main.java:30: error: cannot find symbol
    if (b == 0) {
        ^
  symbol:   variable b
  location: class Main
Main.java:31: error: cannot find symbol
      return a;
             ^
  symbol:   variable a
  location: class Main
Main.java:34: error: cannot find symbol
    return gcd(b, a % b);
               ^
  symbol:   variable b
  location: class Main
Main.java:34: error: cannot find symbol
    return gcd(b, a % b);
                  ^
  symbol:   variable a
  location: class Main
Main.java:34: error: cannot find symbol
    return gcd(b, a % b);
                      ^
  symbol:   variable b
  location: class Main
5 errors
Language: C++

#include<bits/stdc++.h>

using namespace std;

int gcd(int x. int y) {
	if (y == 1) return x;
    return gcd(x%y, y);
}

int main() {
  int N;
  
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  
  int ans = A[0];
  for (int i = 0; i < N; i++) {
    ans = min(gcd(ans, A[i]), ans);
  }
  
  cout << ans << endl;
}


Compiler output:
a.cc:5:14: error: expected ',' or '...' before '.' token
    5 | int gcd(int x. int y) {
      |              ^
a.cc: In function 'int gcd(int)':
a.cc:6:13: error: 'y' was not declared in this scope
    6 |         if (y == 1) return x;
      |             ^
a.cc:7:18: error: 'y' was not declared in this scope
    7 |     return gcd(x%y, y);
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, n) for (int i = (a); i < (n); i++)
#define repb(i, n) for (int i = (n - 1); i >= 0; i--)
#define repb2(i, a, n) for (int i = (n - 1); i >= (a); i--)
#define all(x) x.begin(), x.end()
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
inline void fastio() { ios_base::sync_with_stdio(false), cin.tie(NULL) }

const int cm = 1 << 17;
char cn[cm], *ci = cn + cm, ct;
inline char getcha() {
    if (ci - cn == cm) {
        fread_unlocked(cn, 1, cm, stdin);
        ci = cn;
    }
    return *ci++;
}
inline int getint() {
    int A = 0;
    if (ci - cn + 16 > cm)
        while ((ct = getcha()) >= '0')
            A = A * 10 + ct - '0';
    else
        while ((ct = *ci++) >= '0')
            A = A * 10 + ct - '0';
    return A;
}

int main() {
    fastio();

    int N = getint();

    int kotae = getint();
    rep1(i, N - 1) { kotae = __gcd(getint(), kotae); }
    co(kotae);
}

Compiler output:
a.cc: In function 'void fastio()':
a.cc:11:71: error: expected ';' before '}' token
   11 | inline void fastio() { ios_base::sync_with_stdio(false), cin.tie(NULL) }
      |                                                                       ^~
      |                                                                       ;
a.cc: In function 'int main()':
a.cc:39:10: error: 'i' was not declared in this scope
   39 |     rep1(i, N - 1) { kotae = __gcd(getint(), kotae); }
      |          ^
a.cc:39:5: error: 'rep1' was not declared in this scope; did you mean 'rep'?
   39 |     rep1(i, N - 1) { kotae = __gcd(getint(), kotae); }
      |     ^~~~
      |     rep
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, n) for (int i = (a); i < (n); i++)
#define repb(i, n) for (int i = (n - 1); i >= 0; i--)
#define repb2(i, a, n) for (int i = (n - 1); i >= (a); i--)
#define all(x) x.begin(), x.end()
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
inline void fastio() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); }

int main(void) {
    int N;
    cin >> N;
    vector<int> vec;
    rep(i, N) {
        int a;
        cin >> a;
        vec.push_back(a);
    }
    sort(all(vec));
    int min1 = vec[0], min2 = vec[1];
    while (true) {
        if (min1 == 0 || min2 == 0) {
            co((min1 != 0) ? min1 : min2);
            return 0;
        }
        ll tmp = min1;
        if (min1 < min2 - min1) {
            min1 = min1;
            min2 = min2 - min1;
        } else {
            min1 = min2 - min1;
            min2 = tmp;
        }
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:37:6: error: expected '}' at end of input
   37 |     }
      |      ^
a.cc:13:16: note: to match this '{'
   13 | int main(void) {
      |                ^
Language: C++

#include<stdio.h>
#include<stdlib.h>
long long int gcd(lli,lli);
typedef long long int lli;
int lli_compare(const void*a,const void*b){return *(lli*)a-*(lli*)b;}
int main(void)
{
    lli n;
    lli a[100000];

    scanf("%lld",&n);
    for(lli i=0;i<n;i++){
        scanf("%lld",&a[i]);
    }
    for(lli i=0;i<n-1;i++){
        a[i+1]=gcd(a[i],a[i+1]);
    }
    printf("%lld\n",a[n-1]);
    return 0;
}
long long int gcd(lli x,lli y)
{
    if(x<y){
        lli tmp=x;
        x=y;
        y=tmp;
    }
    if(x%y==0)return y;
    else return gcd(y,x%y);
}

Compiler output:
a.cc:3:19: error: 'lli' was not declared in this scope; did you mean 'lldiv'?
    3 | long long int gcd(lli,lli);
      |                   ^~~
      |                   lldiv
a.cc:3:23: error: 'lli' was not declared in this scope; did you mean 'lldiv'?
    3 | long long int gcd(lli,lli);
      |                       ^~~
      |                       lldiv
a.cc:3:26: error: expression list treated as compound expression in initializer [-fpermissive]
    3 | long long int gcd(lli,lli);
      |                          ^
a.cc: In function 'int main()':
a.cc:16:19: error: 'gcd' cannot be used as a function
   16 |         a[i+1]=gcd(a[i],a[i+1]);
      |                ~~~^~~~~~~~~~~~~
a.cc: At global scope:
a.cc:21:30: error: 'long long int gcd(lli, lli)' redeclared as different kind of entity
   21 | long long int gcd(lli x,lli y)
      |                              ^
a.cc:3:15: note: previous declaration 'long long int gcd'
    3 | long long int gcd(lli,lli);
      |               ^~~
a.cc: In function 'long long int gcd(lli, lli)':
a.cc:29:20: error: 'gcd' cannot be used as a function
   29 |     else return gcd(y,x%y);
      |                 ~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
using namespace std;
  
int gcd(int64_t x, int64_t y) {
  if(x < y) swap(x,y);
  int64_t z = x % y;
  while(z != 0) {
    x = y;
    y = r;
    z = x % y;
  }
  return y;
}

int main () {
  int n;
  cin >> n;
  vector<int64_t> a(n);
  rep(i,n) cin >> a.at(i);
  sort(a.begin(),a.end());
  int64_t ans = a.at(0);
  rep(i,n-1) {
    ans = gcd(ans,a.at(i+1));
    }
  cout << ans;             
}


Compiler output:
a.cc: In function 'int gcd(int64_t, int64_t)':
a.cc:10:9: error: 'r' was not declared in this scope
   10 |     y = r;
      |         ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
using namespace std;
  
int gcd(int64_t x, int64_t y) {
  if(x < y) swap(x,y);
  int64_t z = x % y;
  while(r != 0) {
    x = y;
    y = r;
    z = x % y;
  }
  return y;
}

int main () {
  int n;
  cin >> n;
  vector<int64_t> a(n);
  rep(i,n) cin >> a.at(i);
  sort(a.begin(),a.end());
  int64_t ans = a.at(0);
  rep(i,n-1) {
    ans = gcd(ans,a.at(i+1));
    }
  cout << ans;             
}


Compiler output:
a.cc: In function 'int gcd(int64_t, int64_t)':
a.cc:8:9: error: 'r' was not declared in this scope
    8 |   while(r != 0) {
      |         ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
using namespace std;
  
int main () {
  int n;
  cin >> n;
  vector<int64_t> a(n);
  rep(i,n) cin >> a.at(i);
  int ans = a.at(0);
  rep(i,n-1) {
    ans = __gcd(ans,a.at(i+1));
    }
  cout << ans;             
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: no matching function for call to '__gcd(int&, __gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type&)'
   12 |     ans = __gcd(ans,a.at(i+1));
      |           ~~~~~^~~~~~~~~~~~~~~
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:12:16: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('int' and 'long int')
   12 |     ans = __gcd(ans,a.at(i+1));
      |           ~~~~~^~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
using namespace std;
  
int main () {
  int n;
  cin >> n;
  vector<int64_t> a(n);
  rep(i,n) cin >> a.at(i);
  int ans = a.at(0);
  rep(i,n-1) {
    ans = __gcd(ans,a.at(i+1);
    }
  cout << ans;             
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:30: error: expected ')' before ';' token
   12 |     ans = __gcd(ans,a.at(i+1);
      |                ~             ^
      |                              )
Language: C++

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

int main(){
  long long N;
  cin>>N;
  vector <long long> mon(N);
  for(int i=0;i<N;i++){
    cin>>mon(i);
  }
    for(int i=0;i<N;i++){
      for(int k=0;k<N;k++){
        if(mon.at(i)!=0&&mon.at(k)!=0){
           if(mon.at(i)<=mon.at(k))
             mon.at(k)=mon.at(k)%mon.at(i);
          else
            mon.at(i)=mon.at(i)%mon.at(k);
        }
      }
    }
  int ans=0;
  for(int i=0;i<N;i++){
    if(mon.at(i)>mon.at(ans))
      ans=i;
  }
  cout << mon.at(ans)<<endl
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: no match for call to '(std::vector<long long int>) (int&)'
    9 |     cin>>mon(i);
      |          ~~~^~~
a.cc:26:28: error: expected ';' before '}' token
   26 |   cout << mon.at(ans)<<endl
      |                            ^
      |                            ;
   27 | }
      | ~
Language: C++

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

int main(){
  long long N;
  cin>>N;
  vector <long long> mon(N);
  for(int i=0;i<N;i++){
    cin>>mon(i);
  }
    for(int i=0;i<N;i++){
      for(int k=0;k<N;k++){
        if(mon.at(i)!=0&&mon.at(k)!=0){
           if(mon.at(i)<=mon.at(k))
             mon.at(k)=mon.at(k)%mon.at(i);
          else
            mon.at(i)=mon.at(i)%mon.at(k);
        }
      }
    }
  int ans=0;
  for(int i=0;i<N;i++){
    if(mon.at(i)>mon.at(ans))
      ans=i;
  }
  cout << mon.at(ans)<<ensl
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: no match for call to '(std::vector<long long int>) (int&)'
    9 |     cin>>mon(i);
      |          ~~~^~~
a.cc:26:24: error: 'ensl' was not declared in this scope
   26 |   cout << mon.at(ans)<<ensl
      |                        ^~~~
Language: C++

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

int main(){
  long long N;
  cin>>N;
  vector <long long> mon(N);
  for(int i=0;i<N;i++){
    cin>>mon(i);
  }
    for(int i=0;i<N;i++){
      for(int k=0;k<N;k++){
        if(mon.at(i)!=0&&mon.at(k)!=0){
           if(mon.at(i)<=mon.at(k))
             mon.at(k)=mon.at(k)%mon.at(i);
          else
            mon.at(i)=mon.at(i)%mon.at(k);
        }
      }
    }
  int ans=0;
  for(int i=0;i<N;i++){
    if(mon.at(i)>mon.at(ans))
      ans=i;
  }
  cout << mon.at(ans)<<ensl
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'nameplace'
    2 | using nameplace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   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:7:3: error: 'vector' was not declared in this scope
    7 |   vector <long long> mon(N);
      |   ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:7:11: error: expected primary-expression before 'long'
    7 |   vector <long long> mon(N);
      |           ^~~~
a.cc:9:10: error: 'mon' was not declared in this scope
    9 |     cin>>mon(i);
      |          ^~~
a.cc:13:12: error: 'mon' was not declared in this scope
   13 |         if(mon.at(i)!=0&&mon.at(k)!=0){
      |            ^~~
a.cc:23:8: error: 'mon' was not declared in this scope
   23 |     if(mon.at(i)>mon.at(ans))
      |        ^~~
a.cc:26:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   26 |   cout << mon.at(ans)<<ensl
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:26:11: error: 'mon' was not declared in this scope
   26 |   cout << mon.at(ans)<<ensl
      |           ^~~
a.cc:26:24: error: 'ensl' was not declared in this scope
   26 |   cout << mon.at(ans)<<ensl
      |                        ^~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} 
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}　


int main()
{
  ll n ;
  cin >> n ;
  ll m ;
  
  vector<ll> num(n) ;
  
  REP(i,n){
    cin >> num.at(i) ;
  }
  
  REP(i,n-1){
    m = gcd(num.at(i),num.at(i+1)) ;
    num.at(i+1) = m ;
  }
  
  cout << m <<endl ;
  


  return 0 ;
}



Compiler output:
a.cc:26:47: error: extended character 　 is not valid in an identifier
   26 | ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}　
      |                                               ^
a.cc:26:47: error: '\U00003000' does not name a type
   26 | ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}　
      |                                               ^~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} 
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}　


int main()
{
  int n ;
  cin >> n ;
  int m ;
  
  vint num(n) ;
  
  REP(i,n){
    cin >> num.at(i) ;
  }
  
  REP(i,n-1){
    m = gcd(num.at(i),num.at(i+1)) ;
    num.at(i+1) = m ;
  }
  
  cout << m <<endl ;
  


  return 0 ;
}



Compiler output:
a.cc:26:47: error: extended character 　 is not valid in an identifier
   26 | ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}　
      |                                               ^
a.cc:26:47: error: '\U00003000' does not name a type
   26 | ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}　
      |                                               ^~
Language: C++

#include <bits/stdc++.h>
#include <stdio.h>
#include <algorithm>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
#define rn(i,n) for(int i=1;i<=n;i++)
#define ll long long

ll gcd(ll a,ll b){

  if(b==0)return a;
  return gcd(a,a%b);
}

int main(){
  ll n;cin>>n;
  vector<ll> a(n);
  r(i,n)cin>>a.at(i);
  ll ans=a.at(i);
  r(i,n){
    ans=gcd(a.at(0),a.at(i));
  }


  cout<<ans<<endl;
  return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:15: error: 'i' was not declared in this scope
   19 |   ll ans=a.at(i);
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int ans,p;
  cin>>ans;
  for(int i=1;i<n;++i)
  {cin>>p;
   ans=_gcd(ans,p);
  }
  cout<<ans;
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: '_gcd' was not declared in this scope
   11 |    ans=_gcd(ans,p);
      |        ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int64_t gcd(int64_t a,int64_t b) {
    if(a < b) {
        swap(a,b);
    }
    int64_t r = a;
    while(b != 0) {
        r = a % b;
        swap(b,r);
    }
    return r;
}
int main() {
    int64_t n;
    cin >> n;
    vector<int64_t> a(n);
    for(int i = 0;i < n;i++) {
        cin >> a.at(i);
    }
    g = gcd(a.at(0),a.at(1));
    for(int i = 2;i < n;i++) {
      g = gcd(g,a.at(i));
    }
    cout << g << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'g' was not declared in this scope
   21 |     g = gcd(a.at(0),a.at(1));
      |     ^
Language: Java

mport java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];
        int min = Integer.MAX_VALUE;
        int minIndex = 0;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
            if (min > a[i]) {
                min = a[i];
                minIndex = i;
            }
        }

        int alive = n;
        while (true) {
            for (int i = 0; i < n; i++) {
                if (a[i] > 0 && i != minIndex) {
                    a[i] = a[i] % min;
                    if (a[i] <= 0) {
                        alive--;
                    }
                    if (a[i] > 0 && min > a[i]) {
                        min = a[i];
                        minIndex = i;
                    }

                    if (alive == 1) {
                        System.out.print(a[minIndex]);
                        return;
                    }
                }
            }
        }
    }

}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.*;
^
1 error
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
signed main(){
int a,c,d,e：
  cin>>a;
  vector<int> b(a);
  rep(i,a)
    cin>>b.at(i);
  rep(i,a-1){
    c=b.at(i);
    d=b.at(i+1);
    e=c%d;
    if(e==0)
      b.at(i+1)=c;
    else{
      b.at(i+1)=c;
      b.at(i)=e;
      i--;
      }
}
  cout<<c<<endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected initializer before 'cin'
   10 |   cin>>a;
      |   ^~~
a.cc:17:5: error: 'e' was not declared in this scope
   17 |     e=c%d;
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
 int $(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }

signed main(){
  int a,d,c,e;
  cin>>a;
  vector<int> b(a);
  for(int i=0;i<a;i++)
    cin>>b.at(i);
  sort(b.begin(),b.end());
  for(int i=0;i<a=1;i++){
    c=b.at(i);
    d=b.at(i+1);
    e=d%c;
    if(e==0)
      b.at(i+1)=c;
    else{
      b.at(i+1)=c;
      b.at(i)=e;
      i--;
    }
  }
  cout<<c<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: lvalue required as left operand of assignment
   18 |   for(int i=0;i<a=1;i++){
      |               ~^~
Language: C++

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

int gcd(int x, int y) { if(x<y) swap(x, y); if(y==0) return x; return gcd(y, x%y)};

int main(void){
  int N;
  cin >> N;
  int ans = 2e9;
  for(int i=0; i<N; i++){
    int tmp;
    cin >> tmp;
    ans = min(ans, gcd(ans, tmp));
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:4:82: error: expected ';' before '}' token
    4 | int gcd(int x, int y) { if(x<y) swap(x, y); if(y==0) return x; return gcd(y, x%y)};
      |                                                                                  ^
      |                                                                                  ;
Language: C++

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

int gcd(int x, int y) { if(x<y) swap(x, y); if(y==0) return x; return gcd(y, x%y);};

int main(void){
  int N;
  cin >> N;
  A[N];
  int ans = 2e9;
  for(int i=0; i<N; i++){
    int tmp;
    cin >> tmp;
    ans = min(ans, gcd(ans, tmp));
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'A' was not declared in this scope
    9 |   A[N];
      |   ^
Language: C++

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

int gcd(int x, int y) { if(x<y) swap(x, y); if(y==0) return x; return gcd(y, x%y)};

int main(void){
  int N;
  cin >> N;
  A[N];
  int ans = 2e9;
  for(int i=0; i<N; i++){
    int tmp;
    cin >> tmp;
    ans = min(ans, gcd(ans, tmp));
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:4:82: error: expected ';' before '}' token
    4 | int gcd(int x, int y) { if(x<y) swap(x, y); if(y==0) return x; return gcd(y, x%y)};
      |                                                                                  ^
      |                                                                                  ;
a.cc: In function 'int main()':
a.cc:9:3: error: 'A' was not declared in this scope
    9 |   A[N];
      |   ^
Language: C++

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

int gcd(int x, int y) { if(x<y) swap(x, y); if(y==0) return x; return gcd(y, x%y);

int main(void){
  int N;
  cin >> N;
  A[N];
  int ans = 2e9;
  for(int i=0; i<N; i++){
    int tmp;
    cin >> tmp;
    ans = min(ans, gcd(ans, tmp));
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:6:15: error: a function-definition is not allowed here before '{' token
    6 | int main(void){
      |               ^
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:4:23: note: to match this '{'
    4 | int gcd(int x, int y) { if(x<y) swap(x, y); if(y==0) return x; return gcd(y, x%y);
      |                       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long int gcd(long long int number1,long long int number2){
	long long int m = number1;
	long long int n = number2;

	if(number2 > number1){
		m = number2;
		n = number1;
	}

	while(m != n){
		long long int temp = n;
		n = m - n;
		m = temp;
	}

	return m;
}

long long int lcm(long long int number1,long long int number2){
	return number1 * number2 / ggd(number1,number2);	
}
int main(){
  long long int N;
  cin>>N;
  
  vector<long long int>a(N);
  
 long long int min=gcd(a[0],a[1]);
  
  for(long long int i=0;i<N;i++){
    cin>>a[i];   
  }
  
  for(int i=0;i<N;i++){
    if(gcd(min,a[i])<min){
      min=gcd(min,a[i]);
    }
  }
  
  
cout<<min<<endl;
}
  
  


Compiler output:
a.cc: In function 'long long int lcm(long long int, long long int)':
a.cc:22:36: error: 'ggd' was not declared in this scope; did you mean 'gcd'?
   22 |         return number1 * number2 / ggd(number1,number2);
      |                                    ^~~
      |                                    gcd
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  long long int N;
  cin>>N;
  
  vector<long long int>A(N);
  
 long long int min=1000000000;
  
  for(int i=0;i<N;i++){
    cin>>a[i];
    if(min>a[i]){
      min=a[i];
      
  }
  }
  long long int min2=1000000000;
  for(int i=0;i<N;i++){
    if(a[i]!=min){
      if(a[i]%min<min){
        min2=a[i]%min;
      }
    }
  }
  
  if(min2>min){
    cout<<min<<endl;
  }
  
  else{
    cout<<min2<<endl;
  }
}

  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'a' was not declared in this scope
   12 |     cin>>a[i];
      |          ^
a.cc:20:8: error: 'a' was not declared in this scope
   20 |     if(a[i]!=min){
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin >> n;
  vector<int> v(n);
  
  for(int i=0;i<n;i++){
    cin >> v[i];
  }
  int min = 10000000
  sort(v.begin(),v.end());
  for(int i=0;i<n;i++){
    for(int j=0;j<i;j++){
      int k;
      k = v[i]%v[j];
      min = min(min,k)
    }
  }
  if(min==0) cout << v[0] << endl;
  else cout << min << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: expected ',' or ';' before 'sort'
   13 |   sort(v.begin(),v.end());
      |   ^~~~
a.cc:18:16: error: 'min' cannot be used as a function
   18 |       min = min(min,k)
      |             ~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int saikou(int n,vector<int> a);

int main(){
    int n,ans;
    cin >> n;
    vector<int> a(n);
    for(int i = 0;i < n;i ++){
        cin >> a.at(i);
    }
    sort(a.begin(),a.end());

    ans = saikou(n,a);

    cout << ans << endl;
}

saikou(int n,vector<int> a){
    for(int i = a.at(0);i > 0;i --){
        int j;
        for(j = 0;j < n;j ++){
            if(a.at(j) % i != 0){
                break;
            }
        }
        if(j == n){
            return i;
        }
    }

}

Compiler output:
a.cc:21:1: error: ISO C++ forbids declaration of 'saikou' with no type [-fpermissive]
   21 | saikou(int n,vector<int> a){
      | ^~~~~~
a.cc: In function 'int saikou(int, std::vector<int>)':
a.cc:34:1: warning: control reaches end of non-void function [-Wreturn-type]
   34 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int gcd(int a, int b){
	swap(a,b);
	if(b==0) return a;
	return gcd(b,a%b);
}

int main() {
	int n; cin >> n;
	std::vector<int> A(n);
	for (int i = 0; i < n; ++i) cin >> A[i];

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

	cout << ans << endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:22: error: expected primary-expression before ';' token
   29 |         for (int i = ; i < n; ++i)
      |                      ^
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main() {
	int mx = 0;
  int n; cin >> n;
  while(n--){
    cin >> u;
    mx = __gcd(mx, u);
  }
  
  cout << mx;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'u' was not declared in this scope
   10 |     cin >> u;
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int gcd(int a, int b) {
  if (a < b) {
    return gcd(b,a);
  }
  if (b == 0) {
    return a;
  }
  else {
    return gcd(b,a%b);
  }
}
  
  
}
int main() {
  int N, ans;
  cin >> N >> ans;
  
  for (int i = 0; i < N-1; i++) {
    int a;
    cin >> a;
    ans = gcd(ans,a);
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int gcd(int a, b) {
  if (a < b) {
    return gcd(b,a);
  }
  if (b == 0) {
    return a;
  }
  else {
    return gcd(b,a%b);
  }
}
  
  
}
int main() {
  int N, ans;
  cin >> N >> ans;
  
  for (int i = 0; i < N-1; i++) {
    int a;
    cin >> a;
    ans = gcd(ans,a);
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc:4:16: error: 'b' has not been declared
    4 | int gcd(int a, b) {
      |                ^
a.cc: In function 'int gcd(int, int)':
a.cc:5:11: error: 'b' was not declared in this scope
    5 |   if (a < b) {
      |           ^
a.cc:8:7: error: 'b' was not declared in this scope
    8 |   if (b == 0) {
      |       ^
a.cc: At global scope:
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, ans;
  cin >> N >> ans;
  
  for (int i = 0; i < N-1; i++) {
    int a;
    cin >> a;
    ans = gcd(ans, a)
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: expected ';' before '}' token
   11 |     ans = gcd(ans, a)
      |                      ^
      |                      ;
   12 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++);

// 全体の最大公約数に一致するというまさかの展開
// 細かい証明は調べればよろし
// gcd(a,b) = gcd(b,b-a) から　ユークリッドの互助法的に二匹の時は解ける。
// あとは帰納法なりなんなりで証明すればよさそう。
// とりあえず、数字のランダム引き算で最小になるときは「最大公約数」と覚えておくことがポイント

int GCD(int a,int b){ //ユークリッドの互助法で最大公約数
    if (a%b == 0){
        return b;
    }
    else {
        return GCD(b,a%b);
    }
}

int main(){
    int N; cin >> N;
    vector<int> mons;

    rep(i,N){
        cin >> mons[i];
    }

    int temp = mons[0];

    rep(j,N){
        temp = GCD(temp,mons[j+1]);
    }

    cout << temp << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:21: error: 'i' was not declared in this scope
   25 |         cin >> mons[i];
      |                     ^
a.cc:31:30: error: 'j' was not declared in this scope
   31 |         temp = GCD(temp,mons[j+1]);
      |                              ^
Language: C++

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

int gcd(int a, int b) {
  if (b == 0) {
    return A;
  }
  return gcd(b, a % b);
}

int main() {
  int N, A, B;
  cin >> N >> A;
  for (int i = 0; i < N - 1; i++) {
    cin >> B;
    A = gcd(A, B);
  }
  cout << A << endl;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:6:12: error: 'A' was not declared in this scope
    6 |     return A;
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a[50];
int main()
{
   int n,maxi=0;
   scanf("%d",&n);
   long long ba[n+1];
   for(int i=0;i<n;i++)scanf("%lld",&ba[i]);
   for(int i=0;i<n;i++)
   {
       maxi=__gcd(ba[i],maxi);
   }
   cout<<maxi<<endl;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: no matching function for call to '__gcd(long long int&, int&)'
   12 |        maxi=__gcd(ba[i],maxi);
      |             ~~~~~^~~~~~~~~~~~
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:12:18: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('long long int' and 'int')
   12 |        maxi=__gcd(ba[i],maxi);
      |             ~~~~~^~~~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <tuple>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <queue>

using namespace std;


int main() {

    int N;
    cin >> N;
    vector<long> vs;

    long currentMinV = LONG_MAX;
    int currentMinVPosition;

    for (int i = 0; i < N; i++) {
        long A;
        cin >> A;
        vs.push_back(A);

        if (currentMinV > A) {
            currentMinV = A;
            currentMinVPosition = i;
        }


    }

    int numOfLivingM = N;

    while (numOfLivingM != 1) {

        for (int i = 0; i < N; i++) {

            if (i == currentMinVPosition) {
                continue;
            }

            if (vs[i] > 0) {
                vs[i] %= currentMinV;

                if (vs[i] <= 0) {
                    numOfLivingM -= 1;
                } else {

                    if (currentMinV > vs[i]) {
                        currentMinV = vs[i];
                        currentMinVPosition = i;
                    }

                }
            }
        }
    }

    cout << currentMinV << "\n";

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:24: error: 'LONG_MAX' was not declared in this scope
   21 |     long currentMinV = LONG_MAX;
      |                        ^~~~~~~~
a.cc:11:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   10 | #include <queue>
  +++ |+#include <climits>
   11 |
Language: C++

#include<string>
#include<algorithm>
#include <math.h> 

using namespace std;
// a <b
int gcd(int a, int b)
{
	if (a > b) swap(a, b);
	while (a != 0)
	{
		int temp = a;
		a = b % a;
		b = temp;
	}

	return b;
}
int main(void)
{
	int N;
	const int SIZE = 100000;
	int a[SIZE];
	int smallest;
	cin >> N;

	for (int i = 0; i < N; i++)
	{
		cin >> a[i];
	}
	smallest = a[0];
	for (int i = 1; i < N; i++)
	{
		smallest = gcd(smallest, a[i]);
		
	}
	cout << smallest;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'cin' was not declared in this scope
   25 |         cin >> N;
      |         ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <math.h>
  +++ |+#include <iostream>
    4 | 
a.cc:37:9: error: 'cout' was not declared in this scope
   37 |         cout << smallest;
      |         ^~~~
a.cc:37:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<cstdio>
#include<iostream>
#include<string>
#include<algorithm>
#include <math.h> 

using namespace std;
int gcd(int a, int b);
int main(void)
{
	int N;
	const int SIZE = 100000;
	long long int a[SIZE];
	int smallest = 1000000000;
	cin >> N;

	for (int i = 0; i < N; i++)
	{
		cin >> a[i];
	}
	smallest = a[0];
	for (int i = 1; i < N; i++)
	{
		smallest = gcd(smallest, a[i]);
		
	}
	cout << smallest;
}

Compiler output:
/usr/bin/ld: /tmp/cc0Wqick.o: in function `main':
a.cc:(.text+0x94): undefined reference to `gcd(int, int)'
collect2: error: ld returned 1 exit status
Language: C++

include <bits/stdc++.h>
using namespace std;
 
int gcd_euclid(int u, int v) {
  int r;
  while (0 != v) {
    r = u % v; u = v; v = r; /* swap */
  }
  return u;
}
 
int main() {
  int n;
  cin >> n;
  int a[n];
  for(i=0;i<n;i++){
    cin >> a[i];
  	}
  for(j=1;j<n;j++){
    a[j]=gcd_euclid(a[j],a[j-1]);
  }
  cout << a[n] << endl;
}
  
#include <bits/stdc++.h>
using namespace std;

int gcd_euclid(int u, int v) {
  int r;
  while (0 != v) {
    r = u % v; u = v; v = r; /* swap */
  }
  return u;
}

int main() {
  int n;
  cin >> n;
  int a[n];
  for(int i=0;i<n;i++){
    cin >> a[i];
  	}
  for(int j=1;j<n;j++){
    a[j]=gcd_euclid(a[j],a[j-1]);
  }
  cout << a[n] << endl;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:14:3: error: 'cin' was not declared in this scope
   14 |   cin >> n;
      |   ^~~
a.cc:16:7: error: 'i' was not declared in this scope
   16 |   for(i=0;i<n;i++){
      |       ^
a.cc:19:7: error: 'j' was not declared in this scope
   19 |   for(j=1;j<n;j++){
      |       ^
a.cc:22:3: error: 'cout' was not declared in this scope
   22 |   cout << a[n] << endl;
      |   ^~~~
a.cc:22:19: error: 'endl' was not declared in this scope
   22 |   cout << a[n] << endl;
      |                   ^~~~
a.cc: At global scope:
a.cc:28:5: error: redefinition of 'int gcd_euclid(int, int)'
   28 | int gcd_euclid(int u, int v) {
      |     ^~~~~~~~~~
a.cc:4:5: note: 'int gcd_euclid(int, int)' previously defined here
    4 | int gcd_euclid(int u, int v) {
      |     ^~~~~~~~~~
a.cc:36:5: error: redefinition of 'int main()'
   36 | int main() {
      |     ^~~~
a.cc:12:5: note: 'int main()' previously defined here
   12 | int main() {
      |     ^~~~
Language: C++

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

int gcd_euclid(int u, int v) {
  int r;
  while (0 != v) {
    r = u % v; u = v; v = r; /* swap */
  }
  return u;
}

int main() {
  int n;
  cin >> n;
  int a[n];
  for(i=0;i<n;i++){
    cin >> a[i];
  	}
  for(j=1;j<n;j++){
    a[j]=gcd_euclid(a[j],a[j-1]);
  }
  cout << a[n] << endl;
}
  

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

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

int main(){
  int N;
  cin >> N;
  long long A[N];
  for(int i=0;i<N;i++){
    cin >> A[i];
  }
  //最大公約数を求めるアルゴリズム
  int ans = 0;
  std::sort(A.begin(),A.end());
  for(int i=2;i<A[0];i++){
    int cnt = 0;
    for(int j=0;j<N;j++){
      if(A[j]%i == 0){
        cnt++;
      }
      if(cnt==N){
      ans = max(ans,i);
    }
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: request for member 'begin' in 'A', which is of non-class type 'long long int [N]'
   16 |   std::sort(A.begin(),A.end());
      |               ^~~~~
a.cc:16:25: error: request for member 'end' in 'A', which is of non-class type 'long long int [N]'
   16 |   std::sort(A.begin(),A.end());
      |                         ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std ;
#define int long long 
int32_t main(){
	int n ;
  	cin >> n ;
  	int ans = 0 ;
  	for(int i = 0 ; i < n ; i++){
    	cin >> x ;
  		ans = __gcd(ans , x) ;
  	}
  	cout << ans << endl ;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:9:16: error: 'x' was not declared in this scope
    9 |         cin >> x ;
      |                ^
Language: C

#include<stdio.h>

int gcd(int a, int b){
  int tmp,r;
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
 
  /* ユークリッドの互除法 */
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
  
  return b;
}

int main(){
  
  int N;
  
  scanf("%d",&N);
  int i;
  int gcdd;
  for(i=0;i<N;i++)
    scanf("%d ",&A[i]);
  gcdd =A[0];
  for(i=1;i<N;i++){
    gcdd = gcd(gcdd,A[i]);
  }
  
  printf("%d\n",gcdd);
  return 0;
}
    
  

Compiler output:
main.c: In function 'main':
main.c:30:18: error: 'A' undeclared (first use in this function)
   30 |     scanf("%d ",&A[i]);
      |                  ^
main.c:30:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
#include<vector>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define all(v) v.begin(),v.end()
#define pb push_back
#define INF 1e10
using namespace std;
typedef long long ll;

ll func(ll a){
	return (a>0)?a:-a;
}

ll min(ll a,ll b){
	return (a<b)?a:b;
}

int main(){
	int n;
	cin>>n;
	ll a[n];
	vector<ll> vec;
	rep(i,n)cin>>a[i];
	rep(i,n){
		rep(j,n){
			if(i==j)continue;
			vec.pb(func(a[i]-a[j]));
		}
	}
	sort(all(vec));
	ll m=vec[0];
	if(m==0){
		m=INF;
		rep(i,n)m=min(m,a[i]);
	}else{
		rep(i,n){
			if(a[i]%m){
				ll res=a[i]%m;
				m=min(m,res);
			}
		}
	}
	cout<<m<<endl;
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
long long n,a[100010];
long long gcd(long long a, long long b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int main(){
	cin>>n;
	for (long long i=0;i<n;i++) cin>>a[i];
	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:11:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |         ans=a[0];
      |         ^~~
      |         abs