Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const int NMAX = 201;
int gcd[NMAX][NMAX];

int _gcd(int a,int b)
{
	return a%b == 0?b:_gcd(b,a%b);
}
int main()
{
	int n;
	scanf("%d",&n);
	for(register int i = 1;i <= n;i++)
		for(register int j = i;j <= n;j++)
			gcd[j][i] = gcd[i][j] = _gcd(i,j);
	ll ans = 0;
	for(register int i = 1;i <= n;i++)
		for(register int j = 1;j <= n;j++)
			for(register int k = 1;k <= n;k++)
				ans += gcd[i][gcd[j][k]];
	printf("%lld\n",ans );
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   16 |         for(register int i = 1;i <= n;i++)
      |                          ^
a.cc:17:34: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   17 |                 for(register int j = i;j <= n;j++)
      |                                  ^
a.cc:18:25: error: reference to 'gcd' is ambiguous
   18 |                         gcd[j][i] = gcd[i][j] = _gcd(i,j);
      |                         ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/numeric:173:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:6:5: note:                 'int gcd [201][201]'
    6 | int gcd[NMAX][NMAX];
      |     ^~~
a.cc:18:37: error: reference to 'gcd' is ambiguous
   18 |                         gcd[j][i] = gcd[i][j] = _gcd(i,j);
      |                                     ^~~
/usr/include/c++/14/numeric:173:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:6:5: note:                 'int gcd [201][201]'
    6 | int gcd[NMAX][NMAX];
      |     ^~~
a.cc:20:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   20 |         for(register int i = 1;i <= n;i++)
      |                          ^
a.cc:21:34: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   21 |                 for(register int j = 1;j <= n;j++)
      |                                  ^
a.cc:22:42: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   22 |                         for(register int k = 1;k <= n;k++)
      |                                          ^
a.cc:23:40: error: reference to 'gcd' is ambiguous
   23 |                                 ans += gcd[i][gcd[j][k]];
      |                                        ^~~
/usr/include/c++/14/numeric:173:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:6:5: note:                 'int gcd [201][201]'
    6 | int gcd[NMAX][NMAX];
      |     ^~~
a.cc:23:47: error: reference to 'gcd' is ambiguous
   23 |                                 ans += gcd[i][gcd[j][k]];
      |                                               ^~~
/usr/include/c++/14/numeric:173:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:6:5: note:                 'int gcd [201][201]'
    6 | int gcd[NMAX][NMAX];
      |     ^~~