Language: C++

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

const int cm = 1 << 17;
char cn[cm], *ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread(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 gcd(int a, int b) {
	if (b == 0) {
		return a;
	}
	return gcd(b, a % b);
}

int gcd_of_vector(vector<int> A, int begin, int end){
  int result = A[begin];
  for(int i=begin;i<end;i++){
    result = gcd(A[i],result);
  }
  return result;
}

int gcd_of_vector_with_skip(vector<int> A, int skip){
  int result = A[0];
  if(skip==0)result=A[1];
  for(int i=1;i<A.size();i++){
    if(i==skip)continue;
    result = gcd(A[i],result);
  }
  return result;
}

int main() {
  int N = getint();
  vector<int> A[N];
  for(int i=0;i<N;i++)A[i]=getint();

  if(N>=100){
    ans=1000000010;
    for(int i=0;i<1;i++){
      //random_shuffle(A.begin(),A.end());
      gcd1 = gcd_of_vector(A,1,N/2);
      gcd2 = gcd_of_vector(A,N/2,N);
      ans = min(ans,max(gcd1,gcd2));
    }
  }else{
    ans=0;
    for(int i=0;i<N;i++){
      ans=max(ans,gcd_of_vector_with_skip(A,i));
    }
  }

  cout<<ans<<"\n";

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:35: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'int')
   45 |   for(int i=0;i<N;i++)A[i]=getint();
      |                                   ^
In file included from /usr/include/c++/14/vector:72,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'int' to 'const std::vector<int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'int' to 'std::vector<int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:48:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   48 |     ans=1000000010;
      |     ^~~
      |     abs
a.cc:51:7: error: 'gcd1' was not declared in this scope; did you mean 'gcd'?
   51 |       gcd1 = gcd_of_vector(A,1,N/2);
      |       ^~~~
      |       gcd
a.cc:51:28: error: could not convert '(std::vector<int>*)(& A)' from 'std::vector<int>*' to 'std::vector<int>'
   51 |       gcd1 = gcd_of_vector(A,1,N/2);
      |                            ^
      |                            |
      |                            std::vector<int>*
a.cc:52:7: error: 'gcd2' was not declared in this scope; did you mean 'gcd'?
   52 |       gcd2 = gcd_of_vector(A,N/2,N);
      |       ^~~~
      |       gcd
a.cc:52:28: error: could not convert '(std::vector<int>*)(& A)' from 'std::vector<int>*' to 'std::vector<int>'
   52 |       gcd2 = gcd_of_vector(A,N/2,N);
      |                            ^
      |                            |
      |                            std::vector<int>*
a.cc:56:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   56 |     ans=0;
      |     ^~~
      |     abs
a.cc:58:43: error: could not convert '(std::vector<int>*)(& A)' from 'std::vector<int>*' to 'std::vector<int>'
   58 |       ans=max(ans,gcd_of_vector_with_skip(A,i));
      |                                           ^
      |                                           |
      |                                           std::vector<int>*
a.cc:62:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   62 |   cout<<ans<<"\n";
      |         ^~~
      |         abs