Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <sstream>
#include <iostream>
#include <time.h>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <string.h>
#define sf scanf
#define pf printf
#define lf double
#define ll long long
#define p123 printf("123\n");
#define pn printf("\n");
#define pk printf(" ");
#define p(n) printf("%d",n);
#define pln(n) printf("%d\n",n);
#define s(n) scanf("%d",&n);
#define ss(n) scanf("%s",n);
#define ps(n) printf("%s",n);
#define sld(n) scanf("%lld",&n);
#define pld(n) printf("%lld",n);
#define slf(n) scanf("%lf",&n);
#define plf(n) printf("%lf",n);
#define sc(n) scanf("%c",&n);
#define pc(n) printf("%c",n);
#define gc getchar();
#define re(n,a) memset(n,a,sizeof(n));
#define len(a) strlen(a)
using namespace std;
//https://codeforces.com/contest/1228/problems
//https://codeforces.com/contest/1228/submit
/*int main() {
    int n;
    s(n)
    int count0 = 0;
    int count1 = 0;
    int x;

    for(int i = 0; i < n; i ++) {
        s(x)
        if(x % 4 == 0) {
            count0 ++;
        }else if(x % 2 == 0){
            count1 ++;
        }
    }
    n -= count0*3;
    if(n <= 0) {
        puts("Yes");
    } else {
        n ++;
        if(n <= count1){
            puts("Yes");
        }else{
            puts("No");
        }
    }
    return 0;
}
*/
#include<iostream>
#include<cmath>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
#define ll long long

ll cmd(ll a, ll b){
return b==0?a:cmd(b,a%b);}
ll gcd(ll a , ll b){
    ll k = cmd(a,b);
    return (a/k)*b;
}
ll a[10000]={0};
int main(){
    ll n,num=1;
    cin >>n;
    for(ll i=1;i<=n;i++){
        cin >>a[i];
    }
    num=gcd(a[1],a[2]);
    for(ll i=1;i<=n;i++){
        num=gcd(a[i],num);
    }
    cout<<num<<endl;

}


Compiler output:
In file included from /usr/include/c++/14/chrono:41,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:172,
                 from a.cc:76:
/usr/include/c++/14/bits/chrono.h:1387:5: error: declaration of 'operator""scanf' as non-function
 1387 |     operator""s(long double __secs)
      |     ^~~~~~~~
/usr/include/c++/14/bits/chrono.h:1387:15: error: expected primary-expression before 'long'
 1387 |     operator""s(long double __secs)
      |               ^
/usr/include/c++/14/bits/chrono.h:1388:5: error: expected unqualified-id before '{' token
 1388 |     { return chrono::duration<long double>{__secs}; }
      |     ^
/usr/include/c++/14/bits/chrono.h:1393:7: error: declaration of 'operator""scanf' as non-function
 1393 |       operator""s()
      |       ^~~~~~~~
a.cc:29:27: error: expected primary-expression before ')' token
   29 | #define s(n) scanf("%d",&n);
      |                           ^
/usr/include/c++/14/bits/chrono.h:1394:7: error: expected unqualified-id before '{' token
 1394 |       { return __check_overflow<chrono::seconds, _Digits...>(); }
      |       ^
a.cc:29:20: error: expected identifier before string constant
   29 | #define s(n) scanf("%d",&n);
      |                    ^~~~
a.cc:29:20: error: expected ',' or '...' before string constant
In file included from /usr/include/c++/14/random:48,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:179:
/usr/include/c++/14/bits/random.h:2372:9: error: expected unqualified-id before '{' token
 2372 |         { return _M_s; }
      |         ^
a.cc:29:20: error: expected identifier before string constant
   29 | #define s(n) scanf("%d",&n);
      |                    ^~~~
a.cc:29:20: error: expected ',' or '...' before string constant
/usr/include/c++/14/bits/random.h:2417:7: error: expected unqualified-id before '{' token
 2417 |       { return _M_param.s(); }
      |       ^
/usr/include/c++/14/bits/random.h: In member function 'std::lognormal_distribution<_RealType>::result_type std::lognormal_distribution<_RealType>::operator()(_UniformRandomNumberGenerator&, const param_type&)':
a.cc:29:27: error: expected primary-expression before ')' token
   29 | #define s(n) scanf("%d",&n);
      |                           ^
a.cc:29:28: error: expected ')' before ';' token
   29 | #define s(n) scanf("%d",&n);
      |                            ^
/usr/include/c++/14/bits/random.h:2460:26: note: to match this '('
 2460 |         { return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
      |                          ^
/usr/include/c++/14/bits/random.h:2460:60: error: expected ';' before ')' token
 2460 |         { return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
      |                                                            ^
/usr/include/c++/14/bits/random.h: At global scope:
a.cc:27:21: error: expected identifier before string constant
   27 | #define p(n) printf("%d",n);
      |                     ^~~~
a.cc:27:21: error: expected ',' or '...' before string constant
/usr/include/c++/14/bits/random.h:3751:7: error: expected unqualified-id before '{' token
 3751 |       { return _M_p; }
      |       ^
a.cc:27:21: error: expected identifier before string constant
   27 | #define p(n) printf("%d",n);
      |                     ^~~~
a.cc:27:21: error: expected ',' or '...' before string constant
/usr/include/c++/14/bits/random.h:3802:5: error: expected unqualified-id before '{' token
 3802 |     { return _M_param.p(); }
      |     ^
/usr/include/c++/14/bits/random.h: In member function 'std::bernoulli_distribution::result_type std::bernoulli_distribution::operator()(_UniformRandomNumberGenerator&, const param_type&)':
a.cc:27:27: error: expected primary-expression before ')' token
   27 | #define p(n) printf("%d",n);
      |                           ^
/usr/include/c++/14/bits/random.h: At global scope:
a.cc:27:21: error: expected identifier before string constant
   27 | #define p(n) printf("%d",n);
      |                     ^~~~
a.cc:27:21: error: expected ',' or '...' before string constant
/usr/include/c++/14/bits/random.h:3986:9: error: expected unqualified-id before '{' token
 3986 |         { return _M_p; }
      |         ^
a.cc:27:21: error: expected identifier before string constant
   27 | #define p(n) printf("%d",n);
      |                     ^~~~
a.cc:27:21: error: expected ',' or '...' before string constant
/usr/include/c++/14/bits/random.h:4046:7: error: expected unqualified-id before '{' token
 4046 |       { return _M_param.p(); }
      |       ^
a.cc:27:21: error: expected identifier before string constant
   27 | #define p(n) printf("%d",n);
      |                     ^~~~
a.cc:27:21: error: expected ',' or '...' before string constant
/usr/include/c++/14/bits/random.h:4226:9: error: expected unqualified-id before '{' token
 4226 |         { return _M_p; }
      |         ^
a.cc:27:21: error: expected identifier before string constant
   27 | #define p(n) printf("%d",n);
      |                     ^~~~
a.cc:27:21: error: expected ',' or '...' before string constant
/usr/include/c++/14/bits/random.h:4275:7: error: expected unqualified-id before '{' token
 4275 |       { return _M_param.p(); }
      |       ^
a.cc:27:21: error: expected identifier before string constant
   27 | #define p(n) printf("%d",n);
      |                     ^~~~
a.cc:27:21: error: expected ',' or '...' before string constant
/usr/include/c++/14/bits/random.h:4445:9: error: expected unqualified-id before '{' token
 4445 |         { return _M_p; }
      |         ^
/usr/include/c++/14/bits/random.h:4471:53: error: expected unqualified-id before ')' token
 4471 |       : _M_param(__p), _M_gd(__p.k(), (1.0 - __p.p()) / __p.p())
      |                                                     ^
/usr/include/c++/14/bits/random.h:4471:64: error: expected unqualified-id before ')' token
 4471 |       : _M_param(__p), _M_gd(__p.k(), (1.0 - __p.p()) / __p.p())
      |                                                                ^
a.cc:27:21: error: expected identifier before string constant
   27 | #define p(n) printf("%d",n);
      |                     ^~~~
a.cc:27:21: error: expected ',' or '...' before string constant
/usr/include/c++/14/bits/random.h:4493:7: error: expected unqualified-id before '{' token
 4493 |       { return _M_param.p(); }
      |       ^
/usr/include/c++/14/bits/random.h: In constructor 'std::negative_binomial_distribution<_IntType>::negative_binomial_distribution(const param_type&)':
a.cc:27:27: error: expected primary-expression before ')' token
   27 | #define p(n) printf("%d",n);
      |                           ^
a.cc:27:28: error: expected ')' at end of input
   27 | #define p(n) printf("%d",n);
      |                            ^
/usr/include/c++/14/bits/random.h:4471:39: note: to match this '('
 4471 |       : _M_param(__p), _M_gd(__p.k(), (1.0 - __p.p()) / __p.p())
      |                                       ^
a.cc:27:28: error: expected ')' at end of input
   27 | #define p(n) printf("%d",n);
      |                            ^
/usr/include/c++/14/bits/random.h:4471:29: note: to match this '('
 4471 |       : _M_param(__p), _M_gd(__p.k(), (1.0 - __p.p()) / __p.p())
      |                             ^
a.cc:27:28: error: expected '{' at end of input
   27 | #define p(n) printf("%d",n);
      |                            ^
/usr/include/c++/14/bits/random.tcc: In member function 'void std::bernoulli_distribution::__generate_impl(_ForwardIterator, _ForwardIterator, _UniformRandomNumberGenerator&, const param_type&)':
a.cc:27:27: error: expected primary-expression before ')' token
   27 | #define p(n) printf("%d",n);
      |                           ^
/usr/include/c++/14/bits/random.tcc: In function 'std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bernoulli_distribution&)':
a.cc:27:27: error: expected primary-expression before ')' token
   27 | #define p(n) printf("%d",n);
      |                           ^
/usr/include/c++/14/bits/random.tcc: In function 'std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const geometric_distribution<_IntType>&)':
a.cc:27:27: error: expected primary-expression before ')' token
   27 | #define p(n) printf("%d",n);
      |                           ^
In file included from /usr/include/c++/14/random:50:
/usr/include/c++/14/bits/random.tcc: In member function 'std::negative_binomial_distribution<_IntType>::result_type std::negative_binomial_distribution<_IntType>::operator()(_UniformRandomNumberGenerator&, const param_type&)':
/usr/include/c++/14/bits/random.tcc:1175:35: error: expected primary-expression before '(' token
 1175 |           _M_gd(__urng, param_type(__p.k(), (1.0 - __p.p()) / __p.p()));
      |                                   ^
a.cc:27:27: error: expected primary-expression before ')' token
   27 | #define p(n) printf("%d",n);
      |                           ^
a.cc:27:28: error: expected ')' before ';' token
   27 | #define p(n) printf("%d",n);
      |                            ^
/usr/include/c++/14/bits/random.tcc:1175:45: note: to match this '('
 1175 |           _M_gd(__urng, param_type(__p.k(), (1.0 - __p.p()) / __p.p()));
      |                                             ^
a.cc:27:28: error: expected ')' before ';' token
   27 | #define p(n) printf("%d",n);
      |                            ^
/usr/include/c++/14/bits/random.tcc:1175:35: note: to match this '('
 1175 |           _M_gd(__urng, param_type(__p.k(), (1.0 - __p.p()) / __p.p()));
      |                                   ^
/usr/include/c++/14/bits/random.tcc:1175:59: error: expected primary-expression before ')' token
 1175 |           _M_gd(__urng, param_type(__p.k(), (1.0 - __p.p()) / __p.p()));
      |                                                           ^
/usr/include/c++/14/bits/random.tcc:1175:70: error: expected primary-expression before ')' token
 1175 |           _M_gd(__urng, param_type(__p.k(), (1.0 - __p.p()) / __p.p()));
      |                                                                      ^
/usr/include/c++/14/bits/random.tcc: In member function 'void std::negative_binomial_distribut