Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};
typedef pair<ll,ll> pint
using mint = Fp<1000000007>;
vector<pint> prime_factorize(ll n){
  vector<pint> ans;
  for(ll i=2;i<=sqrt(n);i++){
    if(n%i!=0) continue;
    ll num=0;
    while(n%i==0){
      n/=i;
      num++;
    }
    ans.push_back(make_pair(i,num));
  }
  if(n!=1) ans.push_back(make_pair(n,1));
  return ans;
}

int main(){
  ll n;
  cin>>n;
  vector<ll> v(n);
  vector<ll> num(1100000,0);
  rep(i,n){
    cin>>v[i];
    auto pf=prime_factorize(v[i]);
    for(auto p:pf) num[p.first]=max(num[p.first],p.second);
  }
  mint LCM=1;
  rep(i,1100000){
    LCM*=modpow((mint)i,num[i]);
  }
  mint ans=0;
  rep(i,n){
    ans+=LCM/v[i];
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc:60:1: error: expected initializer before 'using'
   60 | using mint = Fp<1000000007>;
      | ^~~~~
a.cc:61:8: error: 'pint' was not declared in this scope; did you mean 'uint'?
   61 | vector<pint> prime_factorize(ll n){
      |        ^~~~
      |        uint
a.cc:61:12: error: template argument 1 is invalid
   61 | vector<pint> prime_factorize(ll n){
      |            ^
a.cc:61:12: error: template argument 2 is invalid
a.cc: In function 'int prime_factorize(ll)':
a.cc:62:10: error: 'pint' was not declared in this scope; did you mean 'uint'?
   62 |   vector<pint> ans;
      |          ^~~~
      |          uint
a.cc:62:14: error: template argument 1 is invalid
   62 |   vector<pint> ans;
      |              ^
a.cc:62:14: error: template argument 2 is invalid
a.cc:70:9: error: request for member 'push_back' in 'ans', which is of non-class type 'int'
   70 |     ans.push_back(make_pair(i,num));
      |         ^~~~~~~~~
a.cc:72:16: error: request for member 'push_back' in 'ans', which is of non-class type 'int'
   72 |   if(n!=1) ans.push_back(make_pair(n,1));
      |                ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:81:7: error: 'i' was not declared in this scope
   81 |   rep(i,n){
      |       ^
a.cc:81:3: error: 'rep' was not declared in this scope
   81 |   rep(i,n){
      |   ^~~
a.cc:86:3: error: 'mint' was not declared in this scope; did you mean 'uint'?
   86 |   mint LCM=1;
      |   ^~~~
      |   uint
a.cc:90:7: error: expected ';' before 'ans'
   90 |   mint ans=0;
      |       ^~~~
      |       ;
a.cc:94:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   94 |   cout<<ans<<endl;
      |         ^~~
      |         abs