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

#include<bits/stdc++.h>

using namespace std;

int main()
{
    while(1){
    int n;ll od=0,ev=0,m=2000000005;
    cin >> n;
    ll a[n+5];
    for(int i = 0;i<n;i++)
    {
        cin >> a[i];
        if(a[i]%2)od++;
        else ev++;
        if(a[i]<m)m=a[i];
    }

    if(od==n || ev==n)cout<<m<<endl;
    else cout<<1<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'll' was not declared in this scope
    8 |     int n;ll od=0,ev=0,m=2000000005;
      |           ^~
a.cc:10:7: error: expected ';' before 'a'
   10 |     ll a[n+5];
      |       ^~
      |       ;
a.cc:13:16: error: 'a' was not declared in this scope
   13 |         cin >> a[i];
      |                ^
a.cc:14:19: error: 'od' was not declared in this scope
   14 |         if(a[i]%2)od++;
      |                   ^~
a.cc:15:14: error: 'ev' was not declared in this scope
   15 |         else ev++;
      |              ^~
a.cc:16:17: error: 'm' was not declared in this scope
   16 |         if(a[i]<m)m=a[i];
      |                 ^
a.cc:19:8: error: 'od' was not declared in this scope
   19 |     if(od==n || ev==n)cout<<m<<endl;
      |        ^~
a.cc:19:17: error: 'ev' was not declared in this scope
   19 |     if(od==n || ev==n)cout<<m<<endl;
      |                 ^~
a.cc:19:29: error: 'm' was not declared in this scope
   19 |     if(od==n || ev==n)cout<<m<<endl;
      |                             ^
Language: C++

#include<iostream>
using namespace std;


int main() {
  int n;
  cin >> n;
  int temp;
  int ans;
  cin >> ans;
  for(int i=1; i < n; i++) {
   	cin >> temp;
    ans = __gcd(ans, temp);
  }
  cout << ans;
  return 0;
}

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

#include <iostream>
#include <algorithm> 
using namespace std; 
#define rd(t,n) for (int i = 0; i < n; i++)cin>>t[i]
int main() 
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n;cin>>n;
	ll t[n];rd(t,n);
	sort(t,t+n);
	for (int i = 0; i < n; i++)
	{
		for (int j = i+1; j < n; j++)
		{
			if(__gcd(t[i], t[j])==1)return cout<< 1,0;
		}
	}
	return cout<< t[0],0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'll' was not declared in this scope
    9 |         ll t[n];rd(t,n);
      |         ^~
a.cc:9:20: error: 't' was not declared in this scope
    9 |         ll t[n];rd(t,n);
      |                    ^
a.cc:4:49: note: in definition of macro 'rd'
    4 | #define rd(t,n) for (int i = 0; i < n; i++)cin>>t[i]
      |                                                 ^
a.cc:10:14: error: 't' was not declared in this scope
   10 |         sort(t,t+n);
      |              ^
Language: C

/*#include<iostream>
#include<cstdio>
#include<algorithm>
*/
#include<bits/stdc++.h>
using namespace std;
#define max 100000

int gcd(int big, int small)
{
    if(big<small)
    {
        swap(big,small);
    }
    if(small==0)
    {
        return big;
    }
    gcd(big%small, small);
}

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

    sort(arr,arr+n);
    int ans=gcd(arr[0],arr[1]);
    for(i=2; i<n; i++)
    {
        ans=gcd(ans,arr[i]);
    }
    printf("%d\n", ans);
    return 0;
}

Compiler output:
main.c:5:9: fatal error: bits/stdc++.h: No such file or directory
    5 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <stdio.h>
#include <vector> 
#include <math.h> 
using namespace std;
int main(void){
    int N; cin >> N;
    int i = 0;
    vector<int> x(N);
    while(N > i){
        cin >> x[i];
        i++;
    }
    sort(x.begin(), x.end());
    i = 1;
    int min = x[0];
    while (N > i) {
        while(x[i] > 0) {
            x[i] -= min;
            if (x[i] < min && x[i] > 0) {
                min = x[i];
                sort(x.begin(), x.end());
            }
        }
        if (min == 1) break;
        i++;
    }
    cout << min << endl;
}

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

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

int main() {
    size_t N;
    cin >> N;
    vector<int> A(N);
    for (int &Ai : A) cin >> Ai;

    while (true) {
        sort(A.begin(), A.end());
        A.erase(unique(A.begin(), A.end()), A.end());

        if (A.size() == 1uL) {
            cout << A.at(0) << '\n';
            return 0;
        }

        for (size_t i = 1uL; i < A.size(); ++i) {
            A.at(i) %= A.at(0);
            if (A.at(i) == 0) {
                A.erase(A.begin() + i);
                --i;
            }
        }
    }

    return 0;
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

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

int gcd(int a, int b){
  if(a%b==0)return b;
  else{
    return gcd(b,a%b);
  }
}
void solve3(){
  int n;
  cin >> n;
  vector <int> a(n);
  int res;
  int tmp;
  for(int i=0;i<n;i++){
    cin >> a[i];
    if(i>0){
      tmp = (gcd(a[i-1],tmp));
    }
    if(i==0){
      tmp = a[i];
    }
  }
  sort(a.begin(),a.end());
  int k=0;
  cout << tmp << endl;


}
int main(){
  solve3();
  return 0;
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値

// nCk を取得
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}

int main() {
ll n;
cin>>n;
ll a[n]={};
for(ll i=0; i<n; i++){
cin>>a[i];}
ll b=a[i];
ll c;
ll d;
for(ll i=1; i<n; i++){
c=__gcd(a[i],b);
d=a[i]*b/c;
c=d;}
cout<<c<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:8: error: 'i' was not declared in this scope
   25 | ll b=a[i];
      |        ^
Language: C++

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

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

int main(){
  
  int n;
  cin >>n;
  vector<int> list(n);
  rep(i,n ) cin>>list.at(i);
  int ans=list[0];
  rep(i,n-1){　ans=gcd(ans,list[i+1]);}
  cout<<ans<<endl;
}
























Compiler output:
a.cc:13:14: error: extended character 　 is not valid in an identifier
   13 |   rep(i,n-1){　ans=gcd(ans,list[i+1]);}
      |              ^
a.cc: In function 'int main()':
a.cc:13:14: error: '\U00003000ans' was not declared in this scope
   13 |   rep(i,n-1){　ans=gcd(ans,list[i+1]);}
      |              ^~~~~
Language: C++

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

typedef long long ll;
typedef long double ld;
#define pi 3.14159265359
#define inf (1 << 21)
#define mod 1000000007

int gcd(int n, int m) {
    if (n < m) swap(n, m);
    if (n % m = 0) return m;
    return gcd(m, n % m);
}

int main() {
    int N; cin >> N;
    vector<int> A(N);
    int ans;
    for (int i = 0; i < N; i++) {
        cin >> A.at(i);
        if (i == 0) ans = A.at(i);
        else ans = gcd(ans, A.at(i));
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:12:11: error: lvalue required as left operand of assignment
   12 |     if (n % m = 0) return m;
      |         ~~^~~
Language: C

#include<stdio.h>
int main(){
int gcd(int x,int y){
  	int r;
	while ((r = x % y) != 0) {
		x = y;
		y = r;
	}
	return y;
}
int main(){
  int n;
  scanf("%d",&n);
  int a[100000];
  for(int i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  int ans=a[0];
  for(int i=0;i<n;i++){
    ans=gcd(ans,a[i]);
  }
  printf("%d",ans);
}
    

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

#include<stdio.h>
int main(){
  int n;
  int a[n];
  scanf("%d",&n);
  int min=1000000000;
  for(int i=0;i<n;i++){
    scanf("%d",&a[i]);
    if(min > a[i]){
      min = a[i];
    }
  }
  int anw=min;
  for(int i=0;i<n;i++){
    if(a[i]%min != 0){
      anw = a[i]%min
    }
  }
  printf("%d",anw);
}

Compiler output:
main.c: In function 'main':
main.c:16:21: error: expected ';' before '}' token
   16 |       anw = a[i]%min
      |                     ^
      |                     ;
   17 |     }
      |     ~
Language: C

#include<stdio.h>
int main(){
  int n;
  int a[n];
  scanf("%d",&n);
  int min=1000000000;
  for(int i=0;i<n;i++){
    scanf("%d",a[i]);
    if(min > a[i]){
      min = a[i];
    }
  }
  int anw=min;
  for(int i=0;i<n;i++){
    if(a[i]%min != 0){
      anw = a[i]%min
    }
  }
  printf("%d",anw);
}

Compiler output:
main.c: In function 'main':
main.c:16:21: error: expected ';' before '}' token
   16 |       anw = a[i]%min
      |                     ^
      |                     ;
   17 |     }
      |     ~
Language: C

#include<stdio.c>
int main(){
  int n;
  int a[n];
  scanf("%d",&n);
  int min=1000000000;
  for(int i=0;i<n;i++){
    scanf("%d",a[i]);
    if(min > a[i]){
      min = a[i];
    }
  }
  int anw=min;
  for(int i=0;i<n;i++){
    if(a[i]%min != 0){
      anw = a[i]%min
    }
  }
  printf("%d",anw);
}

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

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

using ll = long long;
using vi = vector<int>;
using vi2 = vector<vector<int>>;
#define MP(a,b) make_pair((a),(b))
#define MT(...) make_tuple(__VA_ARGS__)

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl;
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl;

#define DCOUT(x,n) cout << fixed << setprecision(n) << (x) << endl;

#define sz(x) (int)(x).size()
#define HOGE cout << "hoge" << endl;

template<typename T>inline istream& operator>>(istream&i,vector<T>&v)
{REP(j,sz(v))i>>v[j];return i;}

const int INF = 1e9;

int gcd (ll a, ll b){
    if(a<b) swap(a,b);
    if(a==b){
        return a;
    }
    
    return gcd(a-b,b);
}
    
int main(){
    int N;
    cin >> N;
    vector<ll> A(N);
    cin >> A[0];
    for(int i=1; i<N; i++){
        cin >> A[i];
        A[i] %= A[0]
    }
    
    int ans = A[0];
    
    for(int i=1; i<N; i++){
        ans = gcd(ans,A[i]);
    }
    
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:21: error: expected ';' before '}' token
   45 |         A[i] %= A[0]
      |                     ^
      |                     ;
   46 |     }
      |     ~
Language: Java


import java.util.Scanner;

public class Main{
	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		int n = Integer.parseInt(scanner.nextLine());
		String[] list = scanner.nextLine().split(" ");
		int[] aaa = new int[n];

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

			aaa[i] = Integer.parseInt(list[i]);

		}

		int ans = 0;

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

			ans = Main118.gcd(aaa[i], ans);


		}



		System.out.println(ans);
	}

	public static Integer gcd(int a, int b) {

		return b == 0 ? a : gcd(b, a % b);

	}
}

Compiler output:
Main.java:22: error: cannot find symbol
			ans = Main118.gcd(aaa[i], ans);
			      ^
  symbol:   variable Main118
  location: class Main
1 error
Language: C++

#include <iostream>
#include <limits>
#include <numeric>
#include <vector>

template <typename T>
T gcd(T the_one, T the_other)
{
    return std::__gcd(the_one, the_other);
}

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

    std::vector<int> A(N);

    int min_item = std::numeric_limits<int>::max();
    for (int n = 0; n < N; ++n)
    {
        std::cin >> A[n];
        min_item = std::min(min_item, A[n]);
    }

    int min_mod = std::numeric_limits<int>::max();
    for (int i = 0; i < N; ++i)
    {
        for (int j = 0; j < N; ++j)
        {
            if (i == j)
            {
                continue;
            }

            if (A[i] <= A[j])
            {
                continue;
            }

            min_mod = std::min(min_mod, gcd<int>(A[i], A[j]));
        }
    }

    std::cout << std::min(min_item, min_mod) << std::endl;
    // std::cout << min_mod << std::endl;
}


Compiler output:
a.cc: In function 'T gcd(T, T)':
a.cc:9:17: error: '__gcd' is not a member of 'std'; did you mean 'gcd'?
    9 |     return std::__gcd(the_one, the_other);
      |                 ^~~~~
      |                 gcd
Language: C++

#include <iostream>
#include <limits>
#include <numeric>
#include <vector>

template <typename T>
T gcd(T the_one, T the_other)
{
    return __gcd(the_one, the_other);
}

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

    std::vector<int> A(N);

    int min_item = std::numeric_limits<int>::max();
    for (int n = 0; n < N; ++n)
    {
        std::cin >> A[n];
        min_item = std::min(min_item, A[n]);
    }

    int min_mod = std::numeric_limits<int>::max();
    for (int i = 0; i < N; ++i)
    {
        for (int j = 0; j < N; ++j)
        {
            if (i == j)
            {
                continue;
            }

            if (A[i] <= A[j])
            {
                continue;
            }

            min_mod = std::min(min_mod, gcd<int>(A[i], A[j]));
        }
    }

    std::cout << std::min(min_item, min_mod) << std::endl;
    // std::cout << min_mod << std::endl;
}


Compiler output:
a.cc: In instantiation of 'T gcd(T, T) [with T = int]':
a.cc:41:49:   required from here
   41 |             min_mod = std::min(min_mod, gcd<int>(A[i], A[j]));
      |                                         ~~~~~~~~^~~~~~~~~~~~
a.cc:9:17: error: '__gcd' was not declared in this scope; did you mean 'std::__detail::__gcd'?
    9 |     return __gcd(the_one, the_other);
      |            ~~~~~^~~~~~~~~~~~~~~~~~~~
      |            std::__detail::__gcd
In file included from a.cc:3:
/usr/include/c++/14/numeric:134:5: note: 'std::__detail::__gcd' declared here
  134 |     __gcd(_Tp __m, _Tp __n)
      |     ^~~~~
Language: C++

#include <iostream>
#include <vector>

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

    std::vector<int> A(N);

    int min_item = std::numeric_limits<int>::max();
    for (int n = 0; n < N; ++n)
    {
        std::cin >> A[n];
        min_item = std::min(min_item, A[n]);
    }

    int min_mod = std::numeric_limits<int>::max();
    for (int i = 0; i < N; ++i)
    {
        for (int j = 0; j < N; ++j)
        {
            if (i == j)
            {
                continue;
            }

            int mod_ij = A[i] % A[j];
            // std::cerr << "i = " << i
            //           << ", j = " << j
            //           << ", mod_ij = " << mod_ij
            //           << std::endl;
            if (mod_ij != 0)
            {
                min_mod = std::min(min_mod, mod_ij);

                for (int k = 0; k < N; ++k)
                {
                    if (i == k)
                    {
                        continue;
                    }

                    int mod_ik = mod_ij % A[k];
                    // std::cerr << "\ti = " << i
                    //           << ", k = " << k
                    //           << ", mod_ik = " << mod_ik
                    //           << std::endl;
                    if (mod_ik != 0)
                    {
                        min_mod = std::min(min_mod, mod_ik);
                    }

                    int mod_ki = A[k] % mod_ij;
                    // std::cerr << "\ti = " << i
                    //           << ", k = " << k
                    //           << ", mod_ki = " << mod_ki
                    //           << std::endl;
                    if (mod_ki != 0)
                    {
                        min_mod = std::min(min_mod, mod_ki);
                    }
                }
            }
        }
    }

    std::cout << std::min(min_item, min_mod) << std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: 'numeric_limits' is not a member of 'std'
   11 |     int min_item = std::numeric_limits<int>::max();
      |                         ^~~~~~~~~~~~~~
a.cc:11:40: error: expected primary-expression before 'int'
   11 |     int min_item = std::numeric_limits<int>::max();
      |                                        ^~~
a.cc:18:24: error: 'numeric_limits' is not a member of 'std'
   18 |     int min_mod = std::numeric_limits<int>::max();
      |                        ^~~~~~~~~~~~~~
a.cc:18:39: error: expected primary-expression before 'int'
   18 |     int min_mod = std::numeric_limits<int>::max();
      |                                       ^~~
Language: C++

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

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;
  vector<int> a(n);
  for (int i=0;i<n;++i) cin >> a[i];
  int ans=0;
  for (int i=1;i<a.size();++i){
    int ans=a[0]
    ans=gcd(ans,a[i+1]);
  }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: expected ',' or ';' before 'ans'
   16 |     ans=gcd(ans,a[i+1]);
      |     ^~~
Language: C++

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

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;
  for (int i=0;i<n;++i) cin >> a[i];
  int ans=0;
  for (int i=1;i<a.size();++i){
    int ans=a[0]
    ans=gcd(ans,a[i+1]);
  }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:32: error: 'a' was not declared in this scope
   11 |   for (int i=0;i<n;++i) cin >> a[i];
      |                                ^
a.cc:13:18: error: 'a' was not declared in this scope
   13 |   for (int i=1;i<a.size();++i){
      |                  ^
Language: C++

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

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;
  for (int i=0;i<n;++i) cin >> a[i];
  int ans=a[0];
  for (int i=1;i<a.size();++i){
        ans=gcd(ans,a[i+1]);
  }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:32: error: 'a' was not declared in this scope
   11 |   for (int i=0;i<n;++i) cin >> a[i];
      |                                ^
a.cc:12:11: error: 'a' was not declared in this scope
   12 |   int ans=a[0];
      |           ^
Language: C++

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

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;
  for (int i=0;i<n;++i) cin >> a[i];
  int ans=a[0];
  for (int i=1;i<a.size();++i){
        ans=gcd(ans,a[i+1]);
  }
    cout << ans << endl;
}


Compiler output:
a.cc:2:9: error: 'll' does not name a type
    2 | typedef ll = long long;
      |         ^~
a.cc:5:1: error: 'll' does not name a type
    5 | ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
      | ^~
a.cc:6:1: error: 'll' does not name a type
    6 | ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
      | ^~
a.cc: In function 'int main()':
a.cc:11:32: error: 'a' was not declared in this scope
   11 |   for (int i=0;i<n;++i) cin >> a[i];
      |                                ^
a.cc:12:11: error: 'a' was not declared in this scope
   12 |   int ans=a[0];
      |           ^
Language: C++

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

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;
  rep(i,n) cin >> a[i];
  int ans=a[0];
  for (int i=1;i<a.size();++i){
        ans=gcd(ans,a[i+1]);
  }
    cout << ans << endl;
}


Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'll'
    3 | using ll long long;
      |       ^~
a.cc:6:1: error: 'll' does not name a type
    6 | ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
      | ^~
a.cc:7:1: error: 'll' does not name a type
    7 | ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
      | ^~
a.cc: In function 'int main()':
a.cc:2:23: error: 'll' was not declared in this scope
    2 | #define rep(i, n) for(ll i = 0; i < (int)(n); i++)
      |                       ^~
a.cc:12:3: note: in expansion of macro 'rep'
   12 |   rep(i,n) cin >> a[i];
      |   ^~~
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   rep(i,n) cin >> a[i];
      |       ^
a.cc:2:33: note: in definition of macro 'rep'
    2 | #define rep(i, n) for(ll i = 0; i < (int)(n); i++)
      |                                 ^
a.cc:12:19: error: 'a' was not declared in this scope
   12 |   rep(i,n) cin >> a[i];
      |                   ^
a.cc:13:11: error: 'a' was not declared in this scope
   13 |   int ans=a[0];
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define rep11(i, n) for (int i = 1; i < (int)(n); ++i)
#define repo(i, o, n) for (int i = o; i < (int)(n); ++i)
#define repm(i, n) for (int i = (int)(n)-1; i >= 0; --i)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1002000007
#define INF LONG_LONG_MAX

typedef pair<long long, long long> P;
int main(){
    int n;
    cin>>n;
    vector<long long> v;
    rep(i,n){
        long long a;
        cin>>a;
        v.push_back(a);
    }
    long long ans=__gcd(v[0],v[1]);
    for(int i=2; i<n; i++){
       ans=__gcd(ans,v[i]);
    }
    cout<<ans<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:33:21: error: expected '}' at end of input
   33 |     cout<<ans<<endl;
      |                     ^
a.cc:20:11: note: to match this '{'
   20 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(long long i=0; i<n; i++)
#define REPR(i, n) for(long long i=n-1; i>=0; i--)
#define FOR(i, m, n) for(long long i=m; i<=n; i++)
#define FORR(i, m, n) for(long long i=m; i>=n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
const ll mod = 1e9+7;
const ll inf = 1e15;



int main(){FIN

    ll n;cin>>n;
    vll a(n); REP(i,n) cin>>a[i];
    ll gcd = a[0];
    REP(i,n-1){
        gcd = __gcd(gcd,a[i+1]);
    }
    cout<<gcd<<endl;
    return 0;
}

Compiler output:
a.cc:29:21: error: stray '\16' in program
   29 |     cout<<gcd<<endl;<U+000E>
      |                     ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
#include <boost/integer/common_factor_rt.hpp> // gcd, lcm
using namespace std;
using ll=long long int;
using ld=long double;
using VI=vector<ll>;
using VD=vector<ld>;
using VVI=vector<VI>;
using VC=vector<char>;
using VVC=vector<VC>;
using VS=vector<string>;
using PLL =pair<ll,ll>;
using PLD=pair<ld,ld>;
using VPLL=vector<PLL>;
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element((x).begin(),(x).end())
#define MIN(x) *min_element((x).begin(),(x).end())
#define SORTR(x) sort((x).rbegin(),(x).rend())
#define SORT(x) sort((x).begin(),(x).end())
#define SUM(x) accumulate((x).begin(),(x).end(), 0)
#define FILL(x,a) fill(x.begin(),x.end(),a)
#define EACH(i,x) for(typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i)

const long long  int INF = 1e18;
const ld EPS   = 1e-10;
const int MOD  = int(1e9)+7;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template <class BidirectionalIterator>
bool next_partial_permutation(BidirectionalIterator first, BidirectionalIterator middle,BidirectionalIterator last){reverse(middle, last); return next_permutation(first , last);}
#define COUT(x) cout<<x<<"\n"

void Main()
{
	ll N;
	ll result=0;
	string S;
	cin>>N;
	VI A(N);
	REP(i, N) cin >> A[i];

	result= boost::integer::gcd_range(ALL(A)).first;
	cout << result << "\n";
	return;
}

int main()
{
	std::cin.tie(0);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}


Compiler output:
a.cc:2:10: fatal error: boost/integer/common_factor_rt.hpp: No such file or directory
    2 | #include <boost/integer/common_factor_rt.hpp> // gcd, lcm
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

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

int main(){
  int n;
  cin>>n;
  vector<long long>x(n);
  for(int i=0;i<n;i++){
  cin>>x[i];
  }
  int j=2;
  long long ans=gcd(x[0],x[1])  
  while(j<n){
  ans=gcd(ans,x[j]);
  j++;
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:3: error: expected ',' or ';' before 'while'
   22 |   while(j<n){
      |   ^~~~~
Language: C++

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

long long gcd(long long a, long long b){
  if (b==0) return a;
  else return gcd(b,a%b);
}
long long chmax(long long a,long long b){
  a = max(a,b);
}
long long chmin(long long a, long long b){
  a = min(a,b);
}

int main() {
  long long n,k,sum=0,a=0,b=0,c=0,d=0,ans=0;
  long long MOD = 1000000007;
  long long INF = 1LL << 60;
  string S="";
  cin >> n;
  vector<long long> A(n);
  ans = 0;
  for (long long i=0;i<n;i++){
    cin >> A(i);
    ans = gcd(A(i),ans);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'long long int chmax(long long int, long long int)':
a.cc:10:1: warning: no return statement in function returning non-void [-Wreturn-type]
   10 | }
      | ^
a.cc: In function 'long long int chmin(long long int, long long int)':
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
   13 | }
      | ^
a.cc: In function 'int main()':
a.cc:24:13: error: no match for call to '(std::vector<long long int>) (long long int&)'
   24 |     cin >> A(i);
      |            ~^~~
a.cc:25:16: error: no match for call to '(std::vector<long long int>) (long long int&)'
   25 |     ans = gcd(A(i),ans);
      |               ~^~~
Language: C++

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

long long gcd(long long a, long long b){
  if (b==0) return a;
  else return gcd(b,a%b);
}
long long chmax(long long a,long long b){
  a = max(a,b);
}
long long chmin(long long a, long long b){
  a = min(a,b);
}

int main() {
  long long n,k,sum=0,a=0,b=0,c=0,d=0,ans=0;
  long long MOD = 1000000007;
  long long INF = 1LL << 60;
  string S="";
  cin >> n;
  vector<long long> A(n);
  ans = 0;
  for (int i=0;i<n;i++){
    cin >> A(i);
    ans = gcd(A(i),ans);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'long long int chmax(long long int, long long int)':
a.cc:10:1: warning: no return statement in function returning non-void [-Wreturn-type]
   10 | }
      | ^
a.cc: In function 'long long int chmin(long long int, long long int)':
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
   13 | }
      | ^
a.cc: In function 'int main()':
a.cc:24:13: error: no match for call to '(std::vector<long long int>) (int&)'
   24 |     cin >> A(i);
      |            ~^~~
a.cc:25:16: error: no match for call to '(std::vector<long long int>) (int&)'
   25 |     ans = gcd(A(i),ans);
      |               ~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const int inf = 1e9;
const ll INF = 1e18;
const double pi = 3.14159265358979323846;
#define rep(i,n) for(ll i=0;i<n;i++)

int gcd(int a,int b){
	if(a<b) return gcd(b,a);
	int r;
	while(r=a%b){
		a=b;
		b=r;
	}
	return b;
}
int main(){
	int n;cin>>n;
	int a[n];
	rep(i,n) cin>>a[i];
	int g=gcd(a[0],a[1]);
	for(int i=2,i<n;i++) g=gcd(g,a[i]);

	cout<<g<<"\n";
}

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

#include<bits/stdc++.h>
using namespace std;
int gcd(int x,int y){
if(x=0 || y==0)
  return max(x,y);
  else{
  if(x<y)
    return gcd(x,y%x);
    else if(y<x)
      return gcd(y,x%y);
    else
      return x;
  }

}
int main(){
int N;
  cin>>N;
  int Min;
  cin>>Min;
  for(int i=0;i<M-1;i++){
  int a;
    cin>>a;
    Min=gcd(a,Min);
  }cout<<Min<<endl;
         return 0;
  }

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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define sc(x) scanf("%d",&x)
int main(){
    int n, ans = 1e9+7; sc(n);
    vector<int> a(n)
    for (int i = 0; i < n; i++) sc(a[i]);
    sort(a.begin(), a.end());
    for (int i = 0; i < n-1; i++){
        for (int j = i+1; j < n; j++){
            ans = min(ans, a[j] % a[i]);
        }
    }
    cout << ans << endl;
    return 0;
}

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++) sc(a[i]);
      |     ^~~
a.cc:10:21: error: 'i' was not declared in this scope
   10 |     for (int i = 0; i < n; i++) sc(a[i]);
      |                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
unsigned euclidean_gcd(unsigned a, unsigned b) {
  if(a < b) return euclidean_gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
int main(){
  int n;
  cin >> n;
  int a;
  cin a;
  rep(i,n-1){
    int q;
    in >> q;
    a=euclidean_gcd(a,q);
  }
  cout << a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:6: error: expected ';' before 'a'
   17 |   cin a;
      |      ^~
      |      ;
a.cc:20:5: error: 'in' was not declared in this scope; did you mean 'i'?
   20 |     in >> q;
      |     ^~
      |     i
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define REP(i, d, n) for(int i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
using P = pair<int, int>;
int gcd(int a, int b){
   if (a%b == 0){
       return(b);
   }else{
       return(gcd(b, a%b));
   }
}
int main() {

int a,b;cin>>a>>b;
 int ans=gcd(a,b);
  ans=gcd(ans,c);
  cout<<ans<<endl;
  

}

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

 #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define REP(i, d, n) for(int i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
using P = pair<int, int>;
 
int main() {

int count=0;
  REP(i,1,9999999){if(a%i==0&&b%i==0){count++;}
  }
  int j=1,k=0;
  vector<int>d(count);
  while(k<count){ 
    if(a%j==0&&b%j==0){k++;d.at(k-1)=j;} j++;}
  
  cout<<d.at(k)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: 'a' was not declared in this scope
   12 |   REP(i,1,9999999){if(a%i==0&&b%i==0){count++;}
      |                       ^
a.cc:12:31: error: 'b' was not declared in this scope
   12 |   REP(i,1,9999999){if(a%i==0&&b%i==0){count++;}
      |                               ^
a.cc:17:8: error: 'a' was not declared in this scope
   17 |     if(a%j==0&&b%j==0){k++;d.at(k-1)=j;} j++;}
      |        ^
a.cc:17:16: error: 'b' was not declared in this scope
   17 |     if(a%j==0&&b%j==0){k++;d.at(k-1)=j;} j++;}
      |                ^
Language: C++

#include <bits/stdc++.h>
#include<vector>
using namespace std;
#define rep(i, n)        for(int i=0; i<(int)(n); ++i)
int main() {
  long long int a,c=INT_MAX,d=INT_MAX,e,f;cin>>a;
  int b[a];
  rep(i,a){
    cin>>b[i];
    c=min(c,b[i]);
  }
  rep(i,a-1){
    for(int o=i+1;o<a;o++){
      e=max(b[i],b[o]);
      f=min(b[i],b[o]);
      d=min(d,e%f);
    }
  }
  cout<<min(c,d);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: no matching function for call to 'min(long long int&, int&)'
   10 |     c=min(c,b[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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:10:10: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   10 |     c=min(c,b[i]);
      |       ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281: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:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:10:10: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   10 |     c=min(c,b[i]);
      |       ~~~^~~~~~~~
Language: C++

#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int GCD(int x,int y){
    int x,y;
    cin >> x >> y;
    if(x < y){
        const int a = x;
        x = y;
        y = a;
    }
    int b = 100000;
        while(b){
            b = x % y;
            x = y;
            y = b;
            if(b == 0) break;
        }
    return x;
}

int main(){
    ll n;
    cin >> n;
    vector<ll> a(n);
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    ll res = a[0];
    for(int i = 0; i < n; i++){
        res = GCD(res,a[i]);
    }
    cout << res << endl;
}

Compiler output:
a.cc: In function 'int GCD(int, int)':
a.cc:8:9: error: declaration of 'int x' shadows a parameter
    8 |     int x,y;
      |         ^
a.cc:7:13: note: 'int x' previously declared here
    7 | int GCD(int x,int y){
      |         ~~~~^
a.cc:8:11: error: declaration of 'int y' shadows a parameter
    8 |     int x,y;
      |           ^
a.cc:7:19: note: 'int y' previously declared here
    7 | int GCD(int x,int y){
      |               ~~~~^
Language: C++

#include<cmath>
#include<cstdlib>
#include<string>
#include<sstream>
#include<vector>
#include<iostream>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<algorithm>
using namespace std;

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

  a.resize(N);
  for(int i=0; i<N; i++) cin >> a[i];

  long long m;
  int k;
  while(true) {
    sort(a.begin(), a.end());

    for(int i=0; i<N; i++) {
      if(a[i] != 0) {
        m = a[i];
        k = i;
        break;
      }
    }

    int c = 0;
    for(int i=0; i<N; i++) {
      if(i != k) a[i] = a[i] % m;
      if(a[i] == 0) c++;
    }

    if(c==N-1) break;
  }

  cout << m << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:46:21: error: expected '}' at end of input
   46 |   cout << m << endl;
      |                     ^
a.cc:16:11: note: to match this '{'
   16 | int main(){
      |           ^
Language: C++

	int N;
	cin >> N;
	vector <int> a(N);
	rep(i, N) {
		cin >> a[i];
	}
	int gcd = a[0];
	REP(i, N - 1) {
		gcd = GCD(gcd, a[i]);
	}
	cout << gcd;

Compiler output:
a.cc:2:9: error: 'cin' does not name a type
    2 |         cin >> N;
      |         ^~~
a.cc:3:9: error: 'vector' does not name a type
    3 |         vector <int> a(N);
      |         ^~~~~~
a.cc:4:12: error: expected constructor, destructor, or type conversion before '(' token
    4 |         rep(i, N) {
      |            ^
a.cc:7:19: error: 'a' was not declared in this scope
    7 |         int gcd = a[0];
      |                   ^
a.cc:8:12: error: expected constructor, destructor, or type conversion before '(' token
    8 |         REP(i, N - 1) {
      |            ^
a.cc:11:9: error: 'cout' does not name a type
   11 |         cout << gcd;
      |         ^~~~
Language: C++

import sys
readline = sys.stdin.readline
INF = 10**9


def main():
  n = int(readline())
  A = list(map(int, readline().split()))
  A.sort()
  if A[1]%A[0] == 0:
    print(A[0])
  else:
    print(0)
  
  
  
  
if __name__ == "__main__":
  main()

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repd(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)

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

int main()
{
  // 入力
  ll N;
  cin >> N;
  ll A[N];
  for (ll i = 0; i < N; ++i)
    cin >> A[i];

  // 解法
  ll num_gcd = A[0];
  REP(i, N)
  {
    num_gcd = gcd(num_gcd, A[i]);
  }
  cout << num_gcd << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:7: error: 'i' was not declared in this scope
   27 |   REP(i, N)
      |       ^
a.cc:27:3: error: 'REP' was not declared in this scope
   27 |   REP(i, N)
      |   ^~~
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
int main(void){
    long num_monster;
    long *HP;
    long minHP=1000000000;
    long consist=0;

    scanf("%ld",&num_monster);
    HP=(long *)malloc(sizeof(long)*num_monster);

    long i;
    int flag=0,flag1=0;
    for(i=0;i<num_monster;i++){
        scanf("%ld",&HP[i]);
        if(HP[i]==1){
            flag1++;
        }
        if(i!=0&&HP[i]!=HP[i-1]){
            flag++;
        }
        if(minHP>HP[i]){
            minHP=HP[i];
        }
    }
    if(flag1!=0){
        printf("1");
        free(HP);
        return 0;
    }

    if(flag==0){
        printf("%ld",HP[0]);
        free(HP);
        return 0;
    }
    while(consist!=num_monster-1){
        consist=0;
        for(i=0;i<num_monster;i++){
            if(HP[i]!=minHP){
                HP[i]%=minHP;
                if(HP[i]==1){
                    printf("1");
                    free(HP);
                    return 0;
                }
            }
        }
        for(i=0;i<num_monster;i++){
            if(HP[i]<minHP%%HP[i]!=0){
                minHP=HP[i];
            }
            if(i!=0&&HP[i]==HP[i-1]){
                consist++;
            }
        }
    }
    /*for(i=0;i<num_monster;i++){
        printf("%ld ",HP[i]);
    }
    printf("\n");*/
    printf("%ld",HP[0]);



    free(HP);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:52:28: error: expected expression before '%' token
   52 |             if(HP[i]<minHP%%HP[i]!=0){
      |                            ^
Language: C++

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <deque>
#include <map>
const int MOD = 1e9+7;
typedef long long ll;
using namespace std;

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


int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++){
		cin >> a[i];
	}
	int ans = a[0];
	for (int i = 1; i < n; i++){
		ans = gcd(ans, a[i]);
	}
	cout << ans << endl;
 	return 0;
 }

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:16:21: error: 'temp' was not declared in this scope; did you mean 'tm'?
   16 |                 x = temp;
      |                     ^~~~
      |                     tm
Language: C

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
  int N;
  cin >> N;
  vector <int> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  sort(A.begin(), A.end());
  
  int atk = 0;
  for (;;) {
    int natk = atk;
    for (int i = 0; i < N; i++) {
      if (i == atk) continue;
      if (A[i] <= A[atk]) A[i] = 0;
      else {
        A[i] %= A[atk];
        if ((A[i] > 0) && (A[i] < A[natk])) {
          natk = i;
        }
      }
    }
    if (atk == natk) break;
    else atk = natk;    
  }
  cout << A[atk] << endl;
  return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+10;
int n;
long long a[maxn];
int main(){
	cin>>n;
	for(int i=0;i<n;i++) cin >> a[i];
	int ans=a[0];
	for(int i=1;i<n;i++){
		ans=__gcd(ans,a[i]);
	}
	cout<<ans<<endl;
	return 0;
}

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

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
ll gcd(ll a,llb){return b ? gcd(b,a%b) : a;}
int main(){
    int n; cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    
    ll res = a[0];
    rep(i, n) {
        res = gcd(res, a[i]);
    }
    cout << res << endl;
}


Compiler output:
a.cc:6:13: error: 'llb' has not been declared
    6 | ll gcd(ll a,llb){return b ? gcd(b,a%b) : a;}
      |             ^~~
a.cc: In function 'll gcd(ll, int)':
a.cc:6:25: error: 'b' was not declared in this scope
    6 | ll gcd(ll a,llb){return b ? gcd(b,a%b) : a;}
      |                         ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
ll gcd(ll a,llb){return b ? gcd(b,a%b) : a;}
int main(){
    int n; cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    
    ll res = a[0];
    rep(i, n) {
        res = GCD(res, A[i]);
    }
    cout << res << endl;
}


Compiler output:
a.cc:6:13: error: 'llb' has not been declared
    6 | ll gcd(ll a,llb){return b ? gcd(b,a%b) : a;}
      |             ^~~
a.cc: In function 'll gcd(ll, int)':
a.cc:6:25: error: 'b' was not declared in this scope
    6 | ll gcd(ll a,llb){return b ? gcd(b,a%b) : a;}
      |                         ^
a.cc: In function 'int main()':
a.cc:14:24: error: 'A' was not declared in this scope
   14 |         res = GCD(res, A[i]);
      |                        ^
a.cc:14:15: error: 'GCD' was not declared in this scope
   14 |         res = GCD(res, A[i]);
      |               ^~~
Language: C++

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

const int MOD = 1000000007;

//long long
using ll = long long;

//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()

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

//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

// 最小公倍数
unsigned lcm(unsigned a, unsigned b){
    return a / gcd(a, b) * b; 
}

int main(){
int N;
cin >> N;
vector<ll>A(N);
ll mi = 1e12;
REP(i, N){
  cin >> A.at(i);
  mi = mint(mi, A.at(i));
}
ll ans = mi;
REP(i, N)
  if(A.at(i) % mi != 0){
        ans = A.at(i) % ans;
        i--;
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:8: error: 'mint' was not declared in this scope; did you mean 'uint'?
   45 |   mi = mint(mi, A.at(i));
      |        ^~~~
      |        uint
Language: C++

#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
//#include<bits/stdc++.h>
#include<cstdio>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please


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() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);


	int N = getint();

	int kotae = getint();
	rep1(i, N - 1) {
		kotae = __gcd(getint(), kotae);
	}
	printf("%d", kotae);

	Would you please return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:25: error: '__gcd' was not declared in this scope; did you mean '__gid_t'?
   44 |                 kotae = __gcd(getint(), kotae);
      |                         ^~~~~
      |                         __gid_t
Language: C++

n = int(input())
num = list(map(int, input().split()))

while True:
  num = sorted(num)
  for j in range(n):
    min = num[j]
    if min != 0:
      break
  for i in range(j+1,n):
    num[i] -= (num[i]//min)*min

  if num[n-1] == sum(num):
    break

print(sum(num))

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

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

const long long INF = 1LL << 60;

int main() {
    ll N; cin >> N;
    vector<ll> A(N, -1);
    rep(i, N) cin >> A.at(i);

    ll mx, nmx;
    ll mn;
    sort(A.begin(), A.end();
    mn = A.at(0);

    for(int i=0;i<N; i++){
        if(A.at(i) % A.at(0) != 0) break;
        if(i == N-1){
            cout << A.at(0) << endl;
            return 0;
        }
    }

    cout << 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:28: error: expected ')' before ';' token
   15 |     sort(A.begin(), A.end();
      |         ~                  ^
      |                            )