Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll=long long;

int gcd(ll a, ll b) {
    if (b==0) return a;
    else return gcd(b, a%b);
}
//素因数分解(素因数,何乗か？)
vector<pair<ll,ll>> fact(ll n){
	vector<pair<ll,ll>> res;
	for(ll i=2;i*i<=n;i++){
		if(n%i)continue;
		res.push_back(i,0);//res[]=make_pair(?,?)の形も記憶
		while(n%i==0){
			n/=i;
			res.back().second++;
		}
	}
	if(n!=1)res.push_back(n,1);
	return res;
}

//考察よりgcd(A,B)の素因数を求めればよい
int main() {
	ll a,b,c;
	cin>>a>>b;
	
	c=gcd(a,b);
	auto f=fact(c);
	cout<<f.size()+1<<endl;
	
}


Compiler output:
a.cc: In function 'std::vector<std::pair<long long int, long long int> > fact(ll)':
a.cc:15:30: error: no matching function for call to 'std::vector<std::pair<long long int, long long int> >::push_back(ll&, int)'
   15 |                 res.push_back(i,0);//res[]=make_pair(?,?)の形も記憶
      |                 ~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/vector:66,
                 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/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; value_type = std::pair<long long int, long long int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; value_type = std::pair<long long int, long long int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided
a.cc:21:30: error: no matching function for call to 'std::vector<std::pair<long long int, long long int> >::push_back(ll&, int)'
   21 |         if(n!=1)res.push_back(n,1);
      |                 ~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; value_type = std::pair<long long int, long long int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; value_type = std::pair<long long int, long long int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided