Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

const long long INF=INT_MAX/4;
const long long MOD=1'000'000'007;
const double EPS=1e-14;
const bool DEBUG=true;

const string YES = "YES";
const string NO = "NO";
const string Yes = "Yes";
const string No = "No";

template<class T>
void debug(T head){
    if(DEBUG){
        cout<<head<<endl;
    }
}

template <class Head, class... Body>
void debug(Head head, Body... body){
    if(DEBUG){
        cout<<head<<" ";
        debug(body...);
    }
}

/////
tuple<long long, long long, long long> gcd(long long x, long long y) {
    // C = GCD(X, Y)
    // C = A*X + B*Y
    // return (C, A, B)
    long long a = x, b = y;
    long long r, q;
    long long u_2 = 1, u_1 = 0, v_2 = 0, v_1 = 1, u, v;

    r = a % b;
    q = a / b;
    u = u_2 - q * u_1;
    v = v_2 - q * v_1;
    while(r != 0){
        a = b;
        b = r;
        r = a % b;

        q = a / b;
        u_2 = u_1;
        u_1 = u;
        v_2 = v_1;
        v_1 = v;

        u = u_2 - q * u_1;
        v = v_2 - q * v_1;
    }
    return forward_as_tuple(b, u_1, v_1);
}

void answer(ll A, ll B){
    ll answer = 0;

    ll a, b, c;
    tie(c, a, b) = gcd(A, B);

    ull p = 1;
    answer = 1;
    for(int i=2; i<=c; ++i){
        if(c%i == 0){
            ll aa, bb, cc;
            tie(cc, aa, bb) = gcd(p, i);
            if(cc == 1){
                answer++;
                p *= i;
            }
        }
    }

    cout<<answer<<endl;

    return;
}

/////

int main(int argc, char* argv[]){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout.precision(16);

    ll A, B;
    cin>>A>>B;
    answer(A, B);

    return 0;
}


Compiler output:
a.cc: In function 'void answer(ll, ll)':
a.cc:74:39: error: no match for 'operator=' (operand types are 'std::tuple<long long int&, long long int&, long long int&>' and 'std::common_type_t<long long unsigned int, int>' {aka 'long long unsigned int'})
   74 |             tie(cc, aa, bb) = gcd(p, i);
      |                                       ^
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
                 from /usr/include/c++/14/string:68,
                 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/tuple:1930:9: note: candidate: 'template<class ... _UElements> std::__enable_if_t<((bool)__assignable<const _UElements& ...>()), std::tuple< <template-parameter-1-1> >&> std::tuple< <template-parameter-1-1> >::operator=(const std::tuple<_Args1 ...>&) [with _UElements = {_UElements ...}; _Elements = {long long int&, long long int&, long long int&}]'
 1930 |         operator=(const tuple<_UElements...>& __in)
      |         ^~~~~~~~
/usr/include/c++/14/tuple:1930:9: note:   template argument deduction/substitution failed:
a.cc:74:39: note:   mismatched types 'const std::tuple<_UTypes ...>' and 'std::common_type_t<long long unsigned int, int>' {aka 'long long unsigned int'}
   74 |             tie(cc, aa, bb) = gcd(p, i);
      |                                       ^
/usr/include/c++/14/tuple:1940:9: note: candidate: 'template<class ... _UElements> std::__enable_if_t<((bool)__assignable<_UElements ...>()), std::tuple< <template-parameter-1-1> >&> std::tuple< <template-parameter-1-1> >::operator=(std::tuple<_Args1 ...>&&) [with _UElements = {_UElements ...}; _Elements = {long long int&, long long int&, long long int&}]'
 1940 |         operator=(tuple<_UElements...>&& __in)
      |         ^~~~~~~~
/usr/include/c++/14/tuple:1940:9: note:   template argument deduction/substitution failed:
a.cc:74:39: note:   mismatched types 'std::tuple<_UTypes ...>' and 'std::common_type_t<long long unsigned int, int>' {aka 'long long unsigned int'}
   74 |             tie(cc, aa, bb) = gcd(p, i);
      |                                       ^
/usr/include/c++/14/tuple:1907:7: note: candidate: 'std::tuple< <template-parameter-1-1> >& std::tuple< <template-parameter-1-1> >::operator=(std::__conditional_t<((bool)__assignable<const _Elements& ...>()), const std::tuple< <template-parameter-1-1> >&, const std::__nonesuch&>) [with _Elements = {long long int&, long long int&, long long int&}; std::__conditional_t<((bool)__assignable<const _Elements& ...>()), const std::tuple< <template-parameter-1-1> >&, const std::__nonesuch&> = const std::tuple<long long int&, long long int&, long long int&>&]'
 1907 |       operator=(__conditional_t<__assignable<const _Elements&...>(),
      |       ^~~~~~~~
/usr/include/c++/14/tuple:1909:52: note:   no known conversion for argument 1 from 'std::common_type_t<long long unsigned int, int>' {aka 'long long unsigned int'} to 'std::__conditional_t<true, const std::tuple<long long int&, long long int&, long long int&>&, const std::__nonesuch&>' {aka 'const std::tuple<long long int&, long long int&, long long int&>&'}
 1907 |       operator=(__conditional_t<__assignable<const _Elements&...>(),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1908 |                                 const tuple&,
      |                                 ~~~~~~~~~~~~~       
 1909 |                                 const __nonesuch&> __in)
      |                                 ~~~~~~~~~~~~~~~~~~~^~~~
/usr/include/c++/14/tuple:1918:7: note: candidate: 'std::tuple< <template-parameter-1-1> >& std::tuple< <template-parameter-1-1> >::operator=(std::__conditional_t<((bool)__assignable<_Elements ...>()), std::tuple< <template-parameter-1-1> >&&, std::__nonesuch&&>) [with _Elements = {long long int&, long long int&, long long int&}; std::__conditional_t<((bool)__assignable<_Elements ...>()), std::tuple< <template-parameter-1-1> >&&, std::__nonesuch&&> = std::tuple<long long int&, long long int&, long long int&>&&]'
 1918 |       operator=(__conditional_t<__assignable<_Elements...>(),
      |       ^~~~~~~~
/usr/include/c++/14/tuple:1920:47: note:   no known conversion for argument 1 from 'std::common_type_t<long long unsigned int, int>' {aka 'long long unsigned int'} to 'std::__conditional_t<true, std::tuple<long long int&, long long int&, long long int&>&&, std::__nonesuch&&>' {aka 'std::tuple<long long int&, long long int&, long long int&>&&'}
 1918 |       operator=(__conditional_t<__assignable<_Elements...>(),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1919 |                                 tuple&&,
      |                                 ~~~~~~~~       
 1920 |                                 __nonesuch&&> __in)
      |                                 ~~~~~~~~~~~~~~^~~~