Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
#define erep(i,n) for(int i = 0;i<=n;i++)
#define rep1(i,n) for(int i = 1;i<n;i++)
#define erep1(i,n) for(int i = 1;i<=n;i++)
typedef long long ll;
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstring vector<string>
#define vdouble vector<double>
#define vll vector<ll>
#define vbool vector<bool>
#define INF 100000000000000009
#define int long long
using P = pair<int,int>;

vector<P> prime_factorize(int n){
  vector<P> res;
  for(int p = 2;p*p <= n;p++){
    if(n % p != 0) continue;
    int num = 0;
    while(n % p == 0){
      num++;
      n /= p;
    }
    res.push_back(p,num);
  }
  if(n != 1) res.push_back(n,1);
  return res;
}

signed main(){
  int n,p;
  cin >> n >> p;
  auto res = prime_factorize(n);
  int ans = 1;
  for(auto p:fac){
    for(int j = 0;j < p.second/n;j++){
      ans *= p.first;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'std::vector<std::pair<long long int, long long int> > prime_factorize(long long int)':
a.cc:27:18: error: no matching function for call to 'std::vector<std::pair<long long int, long long int> >::push_back(long long int&, long long int&)'
   27 |     res.push_back(p,num);
      |     ~~~~~~~~~~~~~^~~~~~~
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:29:27: error: no matching function for call to 'std::vector<std::pair<long long int, long long int> >::push_back(long long int&, int)'
   29 |   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
a.cc: In function 'int main()':
a.cc:38:14: error: 'fac' was not declared in this scope
   38 |   for(auto p:fac){
      |              ^~~