Language: C++

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

int size = 1e5+10;
int gcdleft[size], gcdright[size], a[size];

int main() {
	int n, result=0;
	cin >> n;
	// int a[n+1], gcdleft[n+1], gcdright[n+2];
	for(int i = 1; i<n+1; i++){
		cin >> a[i];
		gcdleft[i] = __gcd(a[i], gcdleft[i-1]);
	}

	for(int i = n; i>-1; i--){
		gcdright[i] = __gcd(a[i], gcdright[i+1]);
	}

	for(int i = 1; i<n; i++){
		result = max(result, __gcd(gcdleft[i-1], gcdright[i+1]));
	}
	cout << result << '\n';		
}


Compiler output:
a.cc:5:13: error: reference to 'size' is ambiguous
    5 | int gcdleft[size], gcdright[size], a[size];
      |             ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:4:5: note:                 'int size'
    4 | int size = 1e5+10;
      |     ^~~~
a.cc:5:29: error: reference to 'size' is ambiguous
    5 | int gcdleft[size], gcdright[size], a[size];
      |                             ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:4:5: note:                 'int size'
    4 | int size = 1e5+10;
      |     ^~~~
a.cc:5:38: error: reference to 'size' is ambiguous
    5 | int gcdleft[size], gcdright[size], a[size];
      |                                      ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:4:5: note:                 'int size'
    4 | int size = 1e5+10;
      |     ^~~~
a.cc: In function 'int main()':
a.cc:12:24: error: 'a' was not declared in this scope
   12 |                 cin >> a[i];
      |                        ^
a.cc:13:17: error: 'gcdleft' was not declared in this scope
   13 |                 gcdleft[i] = __gcd(a[i], gcdleft[i-1]);
      |                 ^~~~~~~
a.cc:17:17: error: 'gcdright' was not declared in this scope
   17 |                 gcdright[i] = __gcd(a[i], gcdright[i+1]);
      |                 ^~~~~~~~
a.cc:17:37: error: 'a' was not declared in this scope
   17 |                 gcdright[i] = __gcd(a[i], gcdright[i+1]);
      |                                     ^
a.cc:21:44: error: 'gcdleft' was not declared in this scope
   21 |                 result = max(result, __gcd(gcdleft[i-1], gcdright[i+1]));
      |                                            ^~~~~~~
a.cc:21:58: error: 'gcdright' was not declared in this scope
   21 |                 result = max(result, __gcd(gcdleft[i-1], gcdright[i+1]));
      |                                                          ^~~~~~~~