Language: C++

#include<bits/stdc++.h>
#define N 	100001
int main() {
  long long  n, m, temp = INT_MAX;
  cin>>n;
  long long dp[40][n];
  for(int i = 0; i < n; i++){
		cin>>dp[0][i];
    	temp = min(dp[0][i], temp);
  }
  for(int i = 1; i < 40; i++){
    m = temp;
    temp = INT_MAX;
    bool tem= true;
    int cnt = 0;
    for(int j = 0; j < n; j++){
          if(dp[i-1][j] != m)
           dp[i][j] = dp[i-1][j] % m;
          else if(tem){
           dp[i][j] = dp[i-1][j] % m;
           tem = 0;
          }
          else
            dp[i][j] = dp[i-1][j];
      	if(dp[i][j] == 0) cnt++;
    	if(dp[i][j] > 0 && dp[i][j] < temp)
          	temp = dp[i][j];
      	if(temp == 1){
          cout << 1 << endl;
      		return 0;
        }
      	else if(cnt == n-1){
          cout<<temp << endl;
          return 0;
        }
    }
   }
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:16: error: 'min' was not declared in this scope; did you mean 'std::min'?
    9 |         temp = min(dp[0][i], temp);
      |                ^~~
      |                std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:29:11: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   29 |           cout << 1 << endl;
      |           ^~~~
      |           std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:29:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   29 |           cout << 1 << endl;
      |                        ^~~~
      |                        std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:33:11: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   33 |           cout<<temp << endl;
      |           ^~~~
      |           std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:33:25: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   33 |           cout<<temp << endl;
      |                         ^~~~
      |                         std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~