Language: C++

#include <math.h>
#include <regex>
#include "bits/stdc++.h"
#define FOR(i, s, e) for (int i = int(s); i < int(e); ++i)
#define REP(i, e) FOR(i, 0, e)
#define INF (INT_MAX / 2)
#define EPS (1.0e-8)
#define LINF (LLONG_MAX / 2)
const int MGN = 10;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vd = vector<double>;
using vs = vector<string>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using psi = pair<string, int>;

ll gcd(ll a, ll b) {
    if (b == 0) return a;
    return gcd(b, a%b);
}

ll lcm(ll a, ll b) {
    ll g = gcd(a, b);
    return a / g * b;
}

int is_prime(ll num) {
    for(ll i=2; i*i <= num; i++) {
        if (num%i == 0) return 0;
    }
    return 1;
}
 
void get_isprimes(vi& isPrime, const ll PMAX) {
    isPrime = vb(PMAX + 1, 1);
    isPrime[0] = 0;
    isPrime[1] = 0;
 
    for(ll i=2; i*i<=PMAX; i++) {
        for(ll j= i*2; j <=PMAX; j+=i) {
            isPrime[j] = 0;
        }
    }
}
 
void get_primes(vl& prime, const ll PMAX) {
    vi isPrime;
    get_isprimes(isPrime, PMAX);
 
    for(ll i=2; i<=PMAX; i++) {
        if (isPrime[i]) prime.push_back(i);
    }
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  ll A,B; cin >> A >> B;

  ll c = gcd(A, B);
  vl v;
  v.push_back(1);
  if (c%2==0) {
    v.push_back(2);
    c/=2;
  }
  if (c%3==0) {
    v.push_back(2);
    c/=3;
  }
  if (c%5==0) {
    v.push_back(2);
    c/=5;
  }
  if (c%7==0) {
    v.push_back(2);
    c/=7;
  }

  vl prime;
  get_primes(prime, c);
  for(auto p : prime) {
    if (c%p == 0) v.push_back(p);
  }

  int ans = v.size();
  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'void get_isprimes(vi&, ll)':
a.cc:46:29: error: no match for 'operator=' (operand types are 'vi' {aka 'std::vector<int>'} and 'vb' {aka 'std::vector<bool>'})
   46 |     isPrime = vb(PMAX + 1, 1);
      |                             ^
In file included from /usr/include/c++/14/regex:59,
                 from a.cc:2:
/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 'vb' {aka 'std::vector<bool>'} to 'const std::vector<int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/regex:57:
/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 'vb' {aka 'std::vector<bool>'} 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 'vb' {aka 'std::vector<bool>'} to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~