Language: C++

#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

vector<int> pri;

//素数かどうか判定
bool isprime(long long int x){

	if(x%2==0 && x!=2) return false;

	int sqrtn;
	sqrtn=(int)sqrt(x)+1;

	for(int i=0;i<pri.size();i++){
		if(x%pri[i]==0) return false;
		if(sqrtn<pri[i]) return true;
	}
	return true;
}

//n以下の素数を配列に
void list_prime(long long int n){
	//int flag, sqrtn;
	pri.emplace_back(2);

	for(int i=3;i<=n;i+=2){
		if(isprime(i)) pri.emplace_back(i);
	}
}

//nを素因数分解
vector<long long int> prime_fac(long long int n){
	int lmt=0;
	long long int tmp;
	while(1){
		tmp=pri[lmt];
		tmp*=pri[lmt];
		if(n<=tmp) break;
		lmt++;
		//if(pri.size()<=lmt) list_prime(n);
		//cout<< lmt << " " << pri[lmt] << endl;
	}

	vector<long long int> fac(lmt+1, 0);

	for(int i=0;i<pri.size();i++){
		while(n%pri[i]==0){
			n/=pri[i];
			fac[i]++;
		}
		if(n==1) break;
	}
	
	if(n!=1) fac.emplace_back(-n);

	return fac;

}

int main(){

	long long int a, b, ans=1, lim, ae, be;
	vector<int> af, bf;

	cin>> a >> b;

	lim=sqrt(max(a, b))+100;
	list_prime((int)lim);

	af=prime_fac(a);
	bf=prime_fac(b);

	lim=min(af.size(), bf.size());

	for(int i=0;i<lim;i++){
		if(af[i]>0 && bf[i]>0) ans++;
	}

	ae=af[af.size()-1];
	be=bf[bf.size()-1];
	if(ae<0 && be<0 && ae==be) ans++;
//cout<< ae << " " << be <<endl;

	cout<< ans <<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:74:23: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'std::vector<long long int>')
   74 |         af=prime_fac(a);
      |                       ^
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 'std::vector<long long 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 'std::vector<long long 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 'std::vector<long long int>' to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:75:23: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'std::vector<long long int>')
   75 |         bf=prime_fac(b);
      |                       ^
/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 'std::vector<long long int>' to 'const std::vector<int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/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 'std::vector<long long 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 'std::vector<long long int>' to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~