criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned ll;
using ld = long double;
using pll = pair<ll, ll>;
using pss = pair<string, string>;
using pdd = pair<ld, ld>;
using graph = vector<vector<int>>;

const ll MOD = 1000000007;
const ld EPS = 1e-9;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ex[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const int ey[8] = {0, 1, 1, 1, 0, -1, -1, -1};

template<class T>
T gcd(T a,T b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    if(a%b==0)return b;
    return gcd(a%b,b);
}
template<class T>
T lcm(T a,T b){
    return a/gcd(a,b)*b;
}

#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
int main()
{
    int i, j, k, cnt;
    int n;
    cin >> n;
    mp::cpp_int a[n];
    ll num=1;
    for (i = 0; i < n; i++)
    {
        cin >> a[i];
        num=lcm(a[i],num);
    }
    for (i = 0; i < n; i++)
    {
        t += num / a[i];
    }
    cout << t % MOD << endl;
}


Compiler output:
a.cc:30:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
   30 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

#include <boost/multiprecision/cpp_dec_float.hpp>
 
using mpd = boost::multiprecision::cpp_dec_float_100;

mpd gcd(mpd a, mpd b){
    if(b==0) return a;
    return gcd(b,a - a/b*b);
}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int n;
    cin>>n;
    mpd a[n];
    mpd l = 1;
    for(int i=0;i<n;i++){
        cin>>a[i];
        l = l*a[i]/gcd(a[i],l);
    }
    ll ans = 0;
    ll mod = 1e9+7;
    for(int i=0;i<n;i++){
        mpd ret = (mpd)(l/a[i]);
      ret -= ret/mod*mod;
      ans += ret;
      ans %= mod;
    }
    cout << ans << endl;


}

Compiler output:
a.cc:5:10: fatal error: boost/multiprecision/cpp_dec_float.hpp: No such file or directory
    5 | #include <boost/multiprecision/cpp_dec_float.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

#include <boost/multiprecision/cpp_dec_float.hpp>
 
using mpd = boost::multiprecision::cpp_dec_float_100;

mpd gcd(mpd a, mpd b){
    if(b==0) return a;
    return gcd(b,a - a/b*b);
}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int n;
    cin>>n;
    mpd a[n];
    mpd l = 1;
    for(int i=0;i<n;i++){
        cin>>a[i];
        l = l*a[i]/gcd(a[i],l);
    }
    ll ans = 0;
    ll mod = 1e9+7;
    for(int i=0;i<n;i++){
        mpd ret = (mpd)(l/a[i]);
      ret -= ret/mod*mod;
      ans += ret;
    }
    cout << ans << endl;


}

Compiler output:
a.cc:5:10: fatal error: boost/multiprecision/cpp_dec_float.hpp: No such file or directory
    5 | #include <boost/multiprecision/cpp_dec_float.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

#include <boost/multiprecision/cpp_dec_float.hpp>
 
using mpd = boost::multiprecision::cpp_dec_float_100;

mpd gcd(mpd a, mpd b){
    if(b==0) return a;
    return gcd(b,a - a/b*b);
}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int n;
    cin>>n;
    mpd a[n];
    mpd l = 1;
    for(int i=0;i<n;i++){
        cin>>a[i];
        l = l*a[i]/gcd(a[i],l);
    }
     ans = 0;
    ll mod = 1e9+7;
    for(int i=0;i<n;i++){
        mpd ret = (mpd)(l/a[i]);
      ret -= ret/mod*mod;
      ans += ret;
    }
    cout << ans << endl;


}

Compiler output:
a.cc:5:10: fatal error: boost/multiprecision/cpp_dec_float.hpp: No such file or directory
    5 | #include <boost/multiprecision/cpp_dec_float.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
const int mod = 1000000007;
template< int mod >
struct ModInt {
  int x;

  ModInt() : x(0) {}

  ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

  ModInt &operator+=(const ModInt &p) {
    if((x += p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator-=(const ModInt &p) {
    if((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator*=(const ModInt &p) {
    x = (int) (1LL * x * p.x % mod);
    return *this;
  }

  ModInt &operator/=(const ModInt &p) {
    *this *= p.inverse();
    return *this;
  }

  ModInt operator-() const { return ModInt(-x); }

  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }

  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }

  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }

  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

  bool operator==(const ModInt &p) const { return x == p.x; }

  bool operator!=(const ModInt &p) const { return x != p.x; }

  ModInt inverse() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while(b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }

  ModInt pow(int64_t n) const {
    ModInt ret(1), mul(x);
    while(n > 0) {
      if(n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }

  friend ostream &operator<<(ostream &os, const ModInt &p) {
    return os << p.x;
  }

  friend istream &operator>>(istream &is, ModInt &a) {
    int64_t t;
    is >> t;
    a = ModInt< mod >(t);
    return (is);
  }

  static int get_mod() { return mod; }
};
using modint = ModInt< mod >;
template <typename T>
T binaryPowerMethod(T z,T n){
  T ans = 1;
  while(n != 0){
    if(n%2){
      ans=(ans*z);
    }
    n = n/2;
    z= z*z;
  }
  return ans;
}
__attribute__((constructor))
void initial() {
 cin.tie(0);
 ios::sync_with_stdio(false);
}
unordered_map<int,int> ya;
int main() { 
  int n;cin>>n;
  vector<int> A(n);
  for(int i = 0; n > i; i++){
    cin>>A[i];
    int t = A[i];
    int nw = 2;
    while(t > 1){
      int Z = 0;
      while(!(t%nw)){
        t/=nw;
        Z++;
      }
      ya[nw] = max(ya[nw],Z);
      nw++;
    }
  }
  modint ret = 1;
  for(auto i:ya){
    modint nw = 1;
    nw = pow(i.first,i.second);
    ret = (ret*nw);
  }
  modint ans = 0;
  for(int i = 0; n > i; i++){
    ans = ans+(ret/A[i]);
  }
  cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:120:10: error: 'pow' was not declared in this scope
  120 |     nw = pow(i.first,i.second);
      |          ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned ll;
using ld = long double;
using pll = pair<ll, ll>;
using pss = pair<string, string>;
using pdd = pair<ld, ld>;
using graph = vector<vector<int>>;

const ll MOD = 1000000007;
const ld EPS = 1e-9;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ex[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const int ey[8] = {0, 1, 1, 1, 0, -1, -1, -1};

T gcd(T a,T b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    if(a%b==0)return b;
    return gcd(a%b,b);
}
template<class T>
T lcm(T a,T b){
    return a/gcd(a,b)*b;
}

#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
int main()
{
    int i, j, k, cnt;
    int n;
    cin >> n;
    mp::cpp_int a[n];
    mp::cpp_int s = 1, t = 0;
    for (i = 0; i < n; i++)
    {
        cin >> a[i];
        s *= a[i];
    }
    for (i = 0; i < n; i++)
    {
        t += s / a[i];
    }
    cout << t / gcd(s, t) % MOD << endl;
}


Compiler output:
a.cc:29:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
   29 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

#include <boost/multiprecision/cpp_dec_float.hpp>
 
using mpd = boost::multiprecision::cpp_dec_float_100;

mpd gcd(mpd a, mpd b){
    if(b==0) return a;
    return gcd(b,a - a/b*b);
}
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int n;
    cin>>n;
    mpd a[n];
    mpd l = 1;
    for(int i=0;i<n;i++){
        cin>>a[i];
        l = l*a[i]/gcd(a[i],l);
    }
    ll ans = 0;
    ll mod = 1e9+7;
    for(int i=0;i<n;i++){
        ans += (mpd)(l/a[i])% mod;
    }
    cout << ans << endl;


}

Compiler output:
a.cc:5:10: fatal error: boost/multiprecision/cpp_dec_float.hpp: No such file or directory
    5 | #include <boost/multiprecision/cpp_dec_float.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

#include <boost/multiprecision/cpp_dec_float.hpp>
 
using mpd = boost::multiprecision::cpp_dec_float_100;

mpd gcd(mpd a, mpd b){
    if(b==0) return a;
    return gcd(b,a%b);
}
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int n;
    cin>>n;
    mpd a[n];
    mpd l = 1;
    for(int i=0;i<n;i++){
        cin>>a[i];
        l = l*a[i]/gcd(a[i],l);
    }
    ll ans = 0;
    ll mod = 1e9+7;
    for(int i=0;i<n;i++){
        ans += (mpd)(l/a[i])% mod;
    }
    cout << ans << endl;


}

Compiler output:
a.cc:5:10: fatal error: boost/multiprecision/cpp_dec_float.hpp: No such file or directory
    5 | #include <boost/multiprecision/cpp_dec_float.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

N = int(input())
A = list(map(int,input().split()))


def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
def lcm(a,b):
    return a*b/gcd(a,b)

L = 1

D = 1000000007
for i in range(N):
    L = lcm(L,A[i]) 
L = L % D

res = 0
for i in range(N):
    res = (res + L * pow(A[i],D-2,D)) % D  
print(int(res))





Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <numeric>
#include <map>
#include <iomanip>
#include <limits.h>
#include <queue>
#include <numeric>
using namespace std;    
typedef long long ll;
typedef pair<ll, ll> pll;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const bool DEBUG = false;

const ll MOD = 1000000007;

// xを素因数分解
map <ll, ll> primeFactorization(ll x){
    map <ll, ll> ret;
    for(ll i = 2; i * i <= x; i++){
        while(x % i == 0){
            ret[i] ++;
            x /= i;
        }
    }
    if(x != 1) ret[x] = 1;

    return ret;
}

map <ll, ll> primeDiv( map<ll, ll> x, map<ll, ll> y){
    for(auto it = y.begin(); it != y.end() ; ++it){
        x[ it->first ] -= it->second;
    }
    return x;
}

ll reproduct(map<ll, ll> x, ll MOD){

    ll L = 1;
    for( auto it = x.begin(); it != x.end(); it++ ){
        for(int i = 0; i < it->second; i++){
            L *= it->first;
            L %= MOD;
        }
    }
    return L;
}

// a ÷ b mod. MOD を計算してみる
int main() {

    ll n;
    cin >> n;
 
    vector<ll> v(n);
    for(int i = 0; i < n; i++) cin >> v[i];
 
    map<ll, ll> LCM;
    vector< map<ll, ll> > lsm(n);
    for(int i = 0; i < n; i++){
        lcm[i] = primeFactorization(v[i]);
        for( auto it = lcm[i].begin(); it != lcm[i].end(); ++it ){
            LCM[ it->first ] = max( LCM[ it->first ],   it->second );
        }
    }

    ll ans = 0;
    for(int i = 0; i < n; i++){
        auto tmp = primeDiv( LCM, lcm[i] );
        ll L = reproduct(tmp, MOD);
        ans += L;
        ans %= MOD;
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:12: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   65 |         lcm[i] = primeFactorization(v[i]);
      |            ^
a.cc:66:27: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   66 |         for( auto it = lcm[i].begin(); it != lcm[i].end(); ++it ){
      |                           ^
a.cc:66:49: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   66 |         for( auto it = lcm[i].begin(); it != lcm[i].end(); ++it ){
      |                                                 ^
a.cc:73:38: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   73 |         auto tmp = primeDiv( LCM, lcm[i] );
      |                                      ^
Language: C++

class Integer
  def mod_pow(n, mod = 10 ** 9 + 7)
    x = self
    res = 1

    while n > 0
      res = res * x % mod if n[0] == 1
      x = x * x % mod
      n >>= 1
    end

    res
  end

  def mod_inverse(mod = 10 ** 9 + 7)
    mod_pow(mod - 2, mod)
  end
end

require 'prime'

MOD = 10 ** 9 + 7
N = gets.to_i
A = gets.split.map(&:to_i)

primes = Hash.new(0)

A.each do |a|
  a.prime_division.each do |n, e|
    if primes[n] < e
      primes[n] = e
    end
  end
end

lcm = 1

primes.each do |n, e|
  e.times do
    lcm *= n
    lcm %= MOD
  end
end

ans = 0

A.each do |a|
  ans += lcm * a.mod_inverse
  ans %= MOD
end

puts ans



Compiler output:
a.cc:20:9: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
   20 | require 'prime'
      |         ^~~~~~~
a.cc:2:7: error: expected initializer before 'mod_pow'
    2 |   def mod_pow(n, mod = 10 ** 9 + 7)
      |       ^~~~~~~
Language: C++

import fractions
import functools
def pin(type=int):
    return map(type,input().split())

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return functools.reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return functools.reduce(lcm_base, numbers, 1)
N,=pin()
As=list(pin())

L=(lcm_list(As))
B=[L//As[i] for i in range(N)]
print(sum(B) % 1000000007)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import fractions
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: Java

import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		BigInteger[] a = new BigInteger[10007];
		for(int i = 0;i < n;i++) {
			a[i] = in.nextBigInteger();
		}
		in.close();
		BigInteger x = a[0];
		BigInteger gcd = x;
		for(int i = 1;i < n;i++) {
			gcd = Quick_GCD(gcd,a[i]);
			x = x.multiply(a[i].divide(gcd));
			gcd = x;
		}
		BigInteger ans = BigInteger.ZERO;
		for(int i = 0;i < n;i++) {
			ans = ans.add(x.divide(a[i]));
		}
		System.out.print(ans.mod(BigInteger.valueOf(1000000007)));
	}
	
	public static BigInteger Quick_GCD(BigInteger a,BigInteger b)
    {
	        BigInteger r;
	        while(b.compareTo(BigInteger.ZERO)==1)
	        {
	             r=a.mod(b);
	             a=b;
	             b=r;
	        }
	        return a;
    }
}
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		BigInteger[] a = new BigInteger[10007];
		for(int i = 0;i < n;i++) {
			a[i] = in.nextBigInteger();
		}
		in.close();
		BigInteger x = a[0];
		BigInteger gcd = x;
		for(int i = 1;i < n;i++) {
			gcd = Quick_GCD(gcd,a[i]);
			x = x.multiply(a[i].divide(gcd));
			gcd = x;
		}
		BigInteger ans = BigInteger.ZERO;
		for(int i = 0;i < n;i++) {
			ans = ans.add(x.divide(a[i]));
		}
		System.out.print(ans.mod(BigInteger.valueOf(1000000007)));
	}
	
	public static BigInteger Quick_GCD(BigInteger a,BigInteger b)
    {
	        BigInteger r;
	        while(b.compareTo(BigInteger.ZERO)==1)
	        {
	             r=a.mod(b);
	             a=b;
	             b=r;
	        }
	        return a;
    }
}


Compiler output:
Main.java:39: error: class, interface, enum, or record expected
import java.math.BigInteger;
^
Main.java:40: error: class, interface, enum, or record expected
import java.util.Scanner;
^
2 errors
Language: Java

import java.util.Scanner;
public class Main {
	static long lcm (long a, long b) {
		long temp;
		long c = a;
		c *= b;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return (c/b);
	}
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		long[] a = new long[N];
		for(int i=0 ; i<N ; i++) {
			a[i] = stdIn.nextLong();
		}
		long x=a[0] ;
		for(int i=1 ; i<N ;i++) {
			x = lcm(x,a[i]);
		}
				long sum = 0;
		for(int i=0; i<N ; i++) {
			sum += (x/a[i]);
		}
		System.out.println(sum%(1000000000+7));
	}
}
import java.util.Scanner;
public class Main {
	static long lcm (long a, long b) {
		long temp;
		long c = a;
		c *= b;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return (c/b);
	}
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		long[] a = new long[N];
		for(int i=0 ; i<N ; i++) {
			a[i] = stdIn.nextLong();
		}
		long x=a[0] ;
		for(int i=1 ; i<N ;i++) {
			x = lcm(x,a[i]);
		}
				long sum = 0;
		for(int i=0; i<N ; i++) {
			sum += (x/a[i]);
		}
		System.out.println(sum%(1000000000+7));
	}
}


Compiler output:
Main.java:31: error: class, interface, enum, or record expected
import java.util.Scanner;
^
1 error
Language: Java

 package program;
// by lxk
 
 
import java.util.*;
import java.math.*;
import java.io.*;
 
public class Main {
	
	public static void main(String[] args) {
		StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
	//	Scanner in = new Scanner(System.in);
			int n = in.nextInt();
			BigInteger a[] = new BigInteger[n];
			BigInteger ans = in.nextBigInteger();
			a[0] = ans;
			for(int i = 1; i < n; ++i) {
				BigInteger x = in.nextBigInteger();
				a[i] = x;
				ans = ans.multiply(x).divide(ans.gcd(x));
			}
			BigInteger res=new BigInteger("0");
			BigInteger mm=new BigInteger("1000000007");
			for(int i=0;i<n;i++){
				res = res.add(ans.divide(a[i]));
				res=res.mod(mm);
			}
			System.out.println(res);
			System.gc();
	}
}

Compiler output:
Main.java:15: error: cannot find symbol
			int n = in.nextInt();
			          ^
  symbol:   method nextInt()
  location: variable in of type StreamTokenizer
Main.java:17: error: cannot find symbol
			BigInteger ans = in.nextBigInteger();
			                   ^
  symbol:   method nextBigInteger()
  location: variable in of type StreamTokenizer
Main.java:20: error: cannot find symbol
				BigInteger x = in.nextBigInteger();
				                 ^
  symbol:   method nextBigInteger()
  location: variable in of type StreamTokenizer
3 errors
Language: C++

#include <bits/stdc++.h> 
using namespace std; 
typedef long long int ll; 
int gcd(int a, int b) 
{ 
    if (b == 0) 
        return a; 
    return gcd(b, a % b); 
} 
ll findlcm(int arr[], int n) 
{
    ll ans = arr[0]; 
  
    for (int i = 1; i < n; i++) 
        ans = (((arr[i] * ans)) / 
                (gcd(arr[i], ans))); 
  
    return ans; 
} 
int main() 
{ 
    int a;
  	ll b,sum=0,m=1000000007;
    cin>>a;
    int arr[a];
    for int (i=0;i<a;i++)
    {
      cin>>arr[i];
    }
    b=findlcm(arr, a);
  	for(int i=0;i<a;i++)
    {
    sum=sum+b-arr[i];
    sum=sum%m;
    }
  	cout<<sum;
    return 0; 
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: expected '(' before 'int'
   26 |     for int (i=0;i<a;i++)
      |         ^~~
      |         (
a.cc:26:14: error: 'i' was not declared in this scope
   26 |     for int (i=0;i<a;i++)
      |              ^
Language: C++

#include <bits/stdc++.h>
	
using namespace std;
	
#define endl "\n"
#define ll long long
#define vi vector <int >
#define vii vector < pii >
#define vll vector <ll >
#define pii pair <int, int>
#define pdd pair< double, double>
#define piii pair < pii, int > 
#define pll pair<ll, ll >
#define umap unordered_map
#define pb push_back
#define pq priority_queue
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define rep(i,b,c) for(int i = (int)b; i < (int)c; i++)
#define double long double
#define a first
#define b second

const ll mod = 1e9 + 7;
vll arr(20010);

unsigned long long int LCM(ll arr[], ll n) 
{ 
    // Find the maximum value in arr[] 
    int max_num = 0; 
    for (int i=0; i<n; i++) 
        if (max_num < arr[i]) 
            max_num = arr[i]; 
  
    // Initialize result 
    unsigned long long int res = 1; 
  
    // Find all factors that are present in 
    // two or more array elements. 
    int x = 2;  // Current factor. 
    while (x <= max_num) 
    { 
        // To store indexes of all array 
        // elements that are divisible by x. 
        vector<int> indexes; 
        for (int j=0; j<n; j++) 
            if (arr[j]%x == 0) 
                indexes.push_back(j); 
  
        // If there are 2 or more array elements 
        // that are divisible by x. 
        if (indexes.size() >= 2) 
        { 
            // Reduce all array elements divisible 
            // by x. 
            for (int j=0; j<indexes.size(); j++) 
                arr[indexes[j]] = arr[indexes[j]]/x; 
  
            res = res * x; 
        } 
        else
            x++; 
    } 
  
    // Then multiply all reduced array elements 
    for (int i=0; i<n; i++) 
        res = res*arr[i]; 
  
    return res; 
}




ll gcd(ll a, ll b){
	while(b){
		a = a%b;
		swap(a, b);
	}
	return a;
}

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

	ll n;
	cin >> n;
	cin >> arr[0];
	ll g = arr[0];
	ll l = g;

	rep(i, 1, n){
		cin >> arr[i];
	}

	map <ll, bool > aux;
	aux[arr[0]] = true;
	vll ax;
	ax.pb(arr[0]);
	rep(i,1, n){
		if(!aux[arr[i]]){
			ax.pb(arr[i]);
			aux[arr[i]] = true;
		}
	}

	rep(i, 1, ax.size()){
		l = (l*ax[i])/gcd(l, ax[i]);
		//l %= mod;
	}


	ll ans = 0;
	l = LCM(arr, n);
	forn(i, n){
		ans = (ans + (l/arr[i])%mod )%mod;
		ans %= mod;
	}
	cout << ans%mod << endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:113:17: error: cannot convert 'std::vector<long long int>' to 'long long int*'
  113 |         l = LCM(arr, n);
      |                 ^~~
      |                 |
      |                 std::vector<long long int>
a.cc:26:31: note:   initializing argument 1 of 'long long unsigned int LCM(long long int*, long long int)'
   26 | unsigned long long int LCM(ll arr[], ll n)
      |                               ^
Language: C++

//最小公倍数を求める
#include <iostream>
using namespace std;
typedef long long ll;
const int MOD = 1000000007;
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

ll culko(ll a,b)
{
 
  ll r, x, tmp;
  x = (a * b)%MOD;
 
  /* 自然数 a > b を確認・入替 */
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
 
  /* ユークリッドの互除法 */
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
  return x * modinv(b, MOD) % MOD;
}
int main(){
  int N;
  ll ko = 0,As[10010],sum=0;
  cin >> N;
  for(int i = 0;i<N;i++){
    cin >> N[i];
  }
  ko = N[0];
  for(int i=0;i<N-1;i++){
    ko = culko(N[i],ko);
  }
  for(int i=0;i<N;i++){
    sum += ko * modinv(N[i], MOD) % MOD;
    sum %= MOD;
  }
  cout << sum;
  return 0;
}

Compiler output:
a.cc:18:15: error: 'b' has not been declared
   18 | ll culko(ll a,b)
      |               ^
a.cc: In function 'll culko(ll, int)':
a.cc:22:12: error: 'b' was not declared in this scope
   22 |   x = (a * b)%MOD;
      |            ^
a.cc: In function 'int main()':
a.cc:45:13: error: invalid types 'int[int]' for array subscript
   45 |     cin >> N[i];
      |             ^
a.cc:47:9: error: invalid types 'int[int]' for array subscript
   47 |   ko = N[0];
      |         ^
a.cc:49:17: error: invalid types 'int[int]' for array subscript
   49 |     ko = culko(N[i],ko);
      |                 ^
a.cc:52:25: error: invalid types 'int[int]' for array subscript
   52 |     sum += ko * modinv(N[i], MOD) % MOD;
      |                         ^
Language: C

#include<stdio.h>
#define ARR_SIZE 10000

//2つの整数から最小公倍数を求める
int get_lcm(int a, int b) {
	int temp;
	if (b > a) {
		temp = a;
		a = b;
		b = temp;
	}
	int m = a;  int n = b;

	while (a % b != 0) {
		temp = b;
		b = a % b;
		a = temp;
	}
	int LCM = (m * n) / b;
	return  LCM;
}

int main() {
	int N, i;
	int A[ARR_SIZE];
	scanf_s("%d", &N);
	for (i = 0; i < N; i++) {
		scanf_s("%d", &A[i]);
	}

	int LCM = 1;
	for (i = 0; i < N; i++) {
		LCM = get_lcm(LCM, A[i]);
	}
	unsigned long long int Sum = 0;
	for (i = 0; i < N; i++) {
		Sum += LCM / A[i];
	}
	printf("%d", Sum);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:26:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   26 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

int lcm(int a, int b)
{
   return a * b / gcd(a, b);
}
int main() {
  int y=pow(10,9)+7
  int n;
  cin>>n;
  vector<long long>a(n);
  for(int i=0;i<n;i++) cin>>a[i];
  vector<long long>b(n);
  long long x=a[0];
  for(int i=1;i<n;i++){
    x=lcm(x,a[i]);
    x%=y;
  }
  for(int i=0;i<n;i++) {
    b[i]=x/a[i];
    b[i]%=y;
  }
  long long ans=0;
  for(int i=0;i<n;i++){
    ans+=b[i];
    ans%=y;
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:3: error: expected ',' or ';' before 'int'
   21 |   int n;
      |   ^~~
a.cc:22:8: error: 'n' was not declared in this scope
   22 |   cin>>n;
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

#define mp make_pair
#define pb push_back

#define int int64_t

const int MOD = 1e9+7;

int mpow(int a,int b) {
	if(b==0)
		return 1;
	int temp= mpow(a,b/2);
	temp*=temp;
	temp%=MOD;
	if(b&1) {
		return (a*temp)%MOD;
	}
	else return temp;
} 

int modinv(int a) {
	return mpow(a, MOD-2);
} 

int cp[1000001];
int cnt[1000001];
int pr[1000001];

int32_t main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int32_t n;
    cin>>n;
    int32_t arr[n];
    int32_t maxa=0;
    for(int i=0;i<n;i++)
    {	cin>>arr[i];
    	maxa=max(maxa, arr[i]);
    }
    int prcnt=0;
    for(int i=2;i*i<=maxa;i++) {
    	if(cp[i]==0)
    	{
    		for(int j=2*i;j<1000001;j+=i)
    			cp[j]=1;
    		//pr.pb(i);
    		//cout<<i<<" ";
    	}
    }
    //cout<<pr.size()<<"\n";
    //cout<<cp[2]<<" ";
    for(int i=2;i<=maxa;i++) {
    	if(cp[i]==0)
    	{
    		pr[prcnt]=i;
    		prcnt++;
    	}
    }
    int lcm=1;
    //cout<<pr.size()<<"\n";
    vector<int32_t> cnt(prcnt, 0);
    for(int j=0;j<n;j++) {
    	if(lcm%arr[i]==0)
    		continue;
    	int t=arr[j];
    	for(int i=0;i<prcnt;i++) {
    		int c=0;
    		//if(pr[i]>maxa)
    		while(t%(pr[i])==0) {
    			t/=pr[i];
    			c++;
    		}
    		if(c>cnt[i])
    		{
    			lcm*=mpow(pr[i], c-cnt[i]);
    			lcm%=MOD;
    			cnt[i]=c;
    		}
    		if(t==1)
    			break;
    	}
    }

    int ans=0;
    for(int i=0;i<n;i++) {
    	ans+=lcm*modinv(arr[i]);
    	if(ans>MOD);
    	ans%=MOD;
    }

    cout<<ans;

	return 0;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:67:20: error: 'i' was not declared in this scope
   67 |         if(lcm%arr[i]==0)
      |                    ^
Language: C++

#include  <cmath>
#include  <fstream>
#include  <iostream>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include  <sstream>
using namespace std;


long long int lcm(long long int a, long long int b)
{
   return a * b / gcd(a, b);
}

int main()
{
   int N_tmp, b;
   cin >> N_tmp;
   const int N = N_tmp;
   long long int Array[N];
   long long int  value;
   long long int LCM = 1;
   for(int i=0; i< N; i++)
   {
        cin >> Array[i];
        LCM = lcm(LCM, Array[i]);
   }
   long long int Sum = 0;
   for(int i=0; i< N; i++)
   {
        Sum += LCM / Array[i];
   }


   cout << Sum % (pow(10, 9)+7) << endl;
   return 0;
}


Compiler output:
a.cc: In function 'long long int lcm(long long int, long long int)':
a.cc:13:19: error: 'gcd' was not declared in this scope
   13 |    return a * b / gcd(a, b);
      |                   ^~~
a.cc: In function 'int main()':
a.cc:36:16: error: invalid operands of types 'long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   36 |    cout << Sum % (pow(10, 9)+7) << endl;
      |            ~~~ ^ ~~~~~~~~~~~~~~
      |            |                |
      |            long long int    __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int gcd(int x, int y){
    if (x == 0){
        return y;
    }
    return gcd(y % x, x);
}
int lcm(int x, int y){
    return x * y / gcd(x, y);
}
int findlcm(vector<int> v, int n){
    if (n == 1){
        return v[0];
    }else if (n == 2){
        return lcm(v[0], v[1]);
    }else{
        vector<int> left(v.begin(), v.begin() + v.size() / 2);
        vector<int> right(v.begin() + v.size() / 2, v.end());
        return lcm(findlcm(left, v.size()/2), findlcm(right, n - n / 2));
    }

}
int main() {
	int n;
    int a[1000];
	cin >> n;
    vector<int> v(n);
    for (auto&& e : v) {
        std::cin >> e;
    }
    int ans, l;
    l = findlcm(v, n);
    for(int i = 0; i < n;i++){
        ans = ans + l / v[i]
        ans = ans % 1000000007
    }
    
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:29: error: expected ';' before 'ans'
   36 |         ans = ans + l / v[i]
      |                             ^
      |                             ;
   37 |         ans = ans % 1000000007
      |         ~~~
Language: C++

#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
#include <list>
#include <stack>
#include <math.h>
#include <map>
#include <unordered_map>
#include <set>

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using boost::multiprecision::cpp_int;
using namespace std;

#define ll long long
#define ull unsigned long long

#define	maxp	1000000007

int gcd(cpp_int a, int b) {
	if (a < b)
		return gcd(b, (int)a);
	int r;
	while ((r = (int)(a % b)))
	{
		a = b;
		b = r;
	}
	return b;
}

int main()
{
	int n;
	cin >> n;
	vector<int> a(n);
	cin >> a[0];
	cpp_int M = a[0];

	for (int i = 1; i < n; i++)
	{
		cin >> a[i];
		int g = gcd(M, a[i]);
		M *= a[i] / g;
	}

	cpp_int r = 0;
	for (int i = 0; i < n; i++)
		r += M / a[i];
	ll rp = r % maxp;
	printf("%lld", rp);
	return 0;
}


Compiler output:
a.cc:16:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
   16 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define sz(x) ((int)(x).size())

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
T lcm(T x, T y)
{
    T xy = x * y;
    if (x < y)
    {
        swap(x, y);
    }
    T r;
    r = x % y;
    while (r != 0)
    {
        x = y;
        y = r;
        r = x % y;
    }
    return xy / y;
};
int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n)
    {
        cin >> a[i];
    }
    int num = 1;
    for (int i = 0; i < n; i++)
    {
        num = lcm(num, a[i]);
    }
    ll ans = 0;

    rep(i, n)
    {
        ans = (ans + num / a[i]) % MOD;
    }
    cout << ans << endl;
}


Compiler output:
a.cc:13:1: error: 'T' does not name a type
   13 | T lcm(T x, T y)
      | ^
Language: C++

/*
confirm 0LL and 1LL
confirm cornercases such as 0
confirm times of cin < 10^6
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using VecVec = vector<Vec>;
using Tree = vector<VecP>;
template <typename T>
using Vec1 = vector<T>;
template <typename T>
using Vec2 = vector<Vec1<T> >;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPN(i, m, n) for(ll (i) = (m); (i) <= (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m)-1; (i) >= (n); --(i))
#define REPNR(i, m, n) for(ll (i) = (m); (i) >= (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define repn(i, n) REPN(i, 1, n)
#define repr(i, n) REPR(i, n, 0)
#define repnr(i, n) REPNR(i, n, 1)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
template <typename T>
bool chmax(T &a, const T& b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T& b){if(a > b){a = b; return true;} return false;}
template <typename T>
void co(const T n){cout << n << endl;}
template <typename T>
void cosp(const T n){cout << n << ' ';}
void coVec(const Vec &v){for(ll i : v) cosp(i); cout << endl;}
void sonic(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ld PI = acos(-1);
const ld EPS = 1e-11;


ll sosu[1e5];

int main(void){
	ll n;
	cin >> n;
	Vec a(n);
	rep(i, n) cin >> a[i];

	bool flag;
	ll k = 1;
	for(ll i=2;i<1e5;i++){
		flag=0;
		for(ll j=0;sosu[j]*sosu[j]<=i;j++){
			if(i%sosu[j]==0){
				flag=1;
				break;
			}
		}
		sosu[k]=i;
		k++;
	}
	

	unordered_map<ll, ll> ump;

	rep(i, n){
		ll b = a[i];
		rep(j, a[i]){
			if(b%sosu[j]) continue;
			ll cnt = 0;
			while(b%sosu[j] == 0){
				cnt++;
				b /= sosu[j];
			}
			chmax(ump[sosu[j]], cnt);
			if(sosu[j]*sosu[j] > b){
				if(b != 1) chmax(ump[b], 1LL);
				break;
			}
		}
	}

	ll ans = 0;
	rep(i, n){
		ll b = a[i], sum = 1;
		for(P j : ump){
			ll cnt = 0;
			while(b%j.fs == 0){
				cnt++;
				b /= j.fs;
			}
			rep(k, j.sc-cnt){
				sum *= j.fs;
				sum %= MOD;
			}
		}
		ans += sum;
		ans %= MOD;
	}
	co(ans);

	return 0;
}


Compiler output:
a.cc:56:9: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   56 | ll sosu[1e5];
      |         ^~~
a.cc:56:9: error: could not convert '1.0e+5' from 'double' to 'long unsigned int'
   56 | ll sosu[1e5];
      |         ^~~
      |         |
      |         double
a.cc:56:9: error: size of array 'sosu' has non-integral type 'double'
Language: C++



#include <bits/stdc++.h>
#define INF 1000000000
using namespace std;
public static long Gcd(long m, long n)
{
	long temp;
	while (m % n != 0)
	{
		temp = n;
		n = m % n;
		m = temp;
	}
	return n;
}
public static long Lcm(long m, long n)
{
	return m * n / Gcd(m,n); 
}
int main() {

    int64_t N,ans=0,lcm;
    cin >> N;
    vector<int>A(N),B(N);
    for (int i = 0; i < N; i++) { cin >> A.at(i);B[i]=A[i] }
    for (int i = 0; i < N-1; i++) { 
    A[i+1]=Lcm(A[i],A[i+1]);
    }
        for (int i = 0; i < N; i++) { ans+=A[N-1]/B[i]; }

    cout<<ans%1000000007<<endl;
}
    


Compiler output:
a.cc:6:1: error: expected unqualified-id before 'public'
    6 | public static long Gcd(long m, long n)
      | ^~~~~~
a.cc:17:1: error: expected unqualified-id before 'public'
   17 | public static long Lcm(long m, long n)
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:26:59: error: expected ';' before '}' token
   26 |     for (int i = 0; i < N; i++) { cin >> A.at(i);B[i]=A[i] }
      |                                                           ^~
      |                                                           ;
a.cc:28:12: error: 'Lcm' was not declared in this scope; did you mean 'lcm'?
   28 |     A[i+1]=Lcm(A[i],A[i+1]);
      |            ^~~
      |            lcm
Language: C++

#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

int lcm(int a, int b)
{
   return a * b / gcd(a, b);
}
int main() {
  int y=pow(10,9)+7
  int n;
  cin>>n;
  vector<long long>a(n);
  for(int i=0;i<n;i++) cin>>a[i];
  vector<long long>b(n);
  long long x=a[0];
  for(int i=1;i<n;i++){
    x=lcm(x,a[i]);
  }
  for(int i=0;i<n;i++) {
    b[i]=x/a[i];
    b[i]%=y;
  }
  long long ans=0;
  for(int i=0;i<n;i++){
    ans+=b[i];
    ans%=y;
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:3: error: expected ',' or ';' before 'int'
   21 |   int n;
      |   ^~~
a.cc:22:8: error: 'n' was not declared in this scope
   22 |   cin>>n;
      |        ^
Language: C++

#include  <cmath>
#include  <fstream>
#include  <iostream>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include  <sstream>
using namespace std;


int lcm(int a, int b)
{
   return a * b / gcd(a, b);
}

int main()
{
   int N_tmp, b;
   cin >> N_tmp;
   const int N = N_tmp;
   long long int Array[N];
   long long int  value;
   long long int LCM = 1;
   for(int i=0; i< N; i++)
   {
        cin >> Array[i];
        LCM = lcm(LCM, Array[i]);
   }
   long long int Sum = 0;
   for(int i=0; i< N; i++)
   {
        Sum += LCM / Array[i];
   }


   cout << Sum % (pow(10, 9)+7) << endl;
   return 0;
}


Compiler output:
a.cc: In function 'int lcm(int, int)':
a.cc:13:19: error: 'gcd' was not declared in this scope
   13 |    return a * b / gcd(a, b);
      |                   ^~~
a.cc: In function 'int main()':
a.cc:36:16: error: invalid operands of types 'long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   36 |    cout << Sum % (pow(10, 9)+7) << endl;
      |            ~~~ ^ ~~~~~~~~~~~~~~
      |            |                |
      |            long long int    __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <vector>
#include <sstream>
#include <set>
#include <tuple>
#include <algorithm>
#include <memory>
#include <numeric>
#include <queue>
#include <functional>
#include <cmath>
#include <cstring>
#include <map>
#include <unordered_map>
#include <sstream>
#include <iomanip>

using namespace std;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;

const ll INF = 1LL << 60;
const ll MOD = 1000000007;

vector<ll> prime_table(int n)
{
	vector<bool> prime(n + 1, true);
	if (n >= 0) prime[0] = false;
	if (n >= 1) prime[1] = false;
	for (int i = 2; i * i <= n; i++)
	{
		if (!prime[i]) continue;
		for (int j = i + i; j <= n; j += i)
		{
			prime[j] = false;
		}
	}

	vector<ll> ret;
	for (int i = 0; i <= n; ++i)
	{
		if (prime[i]) ret.push_back(i);
	}

	return ret;
}

map< ll, ll > prime_factor(int64_t n) {
	map<ll, ll> ret;
	for (int64_t i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			ret[i]++;
			n /= i;
		}
	}
	if (n != 1) ret[n] = 1;
	return ret;
}

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

	ll N;
	cin >> N;

	vector<ll> A(N);
	for (ll i = 0; i < N; ++i) cin >> A[i];

	//ll Amax = 0;
	//for (ll i = 0; i < N; ++i) Amax = max(Amax, A[i]);

	//const auto& PT = prime_table((int)Amax+1);
	//const auto& PT = prime_table((int)sqrt(Amax) + 1);

	//bool updated = false;

	vector<map<ll, ll>> pfac(N);

	for (ll i = 0; i < N; ++i)
	{
		pfac[i] = prime_factor(A[i]);
	}

	map<ll, ll> pfac_t;

	for (ll i = 0; i < N; ++i)
	{
		const auto& a = pfac[i];

		for (const auto&  e : a)
		{
			pfac_t[e.first] = max(pfac_t[e.first], e.second);
		}
	}

	ll ans = 0;

	for (ll i = 0; i < N; ++i)
	{
		ll a = 1;
		for (auto e : pfac_t)
		{
			ll diff = e.second - pfac[i][e.first];
			ll base = e.first;

			//cout << diff <<" " << base << endl;

			//a *= ((ll)pow(base, diff) % MOD);
			for (ll j = 0; j < diff; ++j)
			{
				a *= base;
				a %= MOD;
			}
		}

		//cout << a << endl;

		ans += a;
		ans %= MOD;
	}

	cout << ans << endl;

	//system("pause");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:9: error: 'cin' was not declared in this scope
   67 |         cin.tie(0);
      |         ^~~
a.cc:16:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   15 | #include <iomanip>
  +++ |+#include <iostream>
   16 | 
a.cc:129:9: error: 'cout' was not declared in this scope
  129 |         cout << ans << endl;
      |         ^~~~
a.cc:129:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

//最小公倍数を求める
#include <iotstream>
using namespace std;
typedef long long ll;
const int MOD = 1000000007;
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

ll culko(ll a,b)
{
 
  ll r, x, tmp;
  x = (a * b)%MOD;
 
  /* 自然数 a > b を確認・入替 */
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
 
  /* ユークリッドの互除法 */
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
  return x * modinv(b, MOD) % MOD;
}
int main(){
  int N;
  ll ko = 0,As[10010],sum=0;
  cin >> N;
  for(int i = 0;i<N;i++){
    cin >> N[i];
  }
  ko = N[0];
  for(int i=0;i<N-1;i++){
    ko = culko(N[i],ko);
  }
  for(int i=0;i<N;i++){
    sum += ko * modinv(N[i], MOD) % MOD;
    sum %= MOD;
  }
  cout << sum;
  return 0;
}

Compiler output:
a.cc:2:10: fatal error: iotstream: No such file or directory
    2 | #include <iotstream>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
#include <list>
#include <stack>
#include <math.h>
#include <map>
#include <unordered_map>
#include <set>

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using boost::multiprecision::cpp_int;
using namespace std;

#define ll long long
#define ull unsigned long long

#define	max	1000000007

int gcd(cpp_int a, int b) {
	if (a < b)
		return gcd(b, (int)a);
	int r;
	while ((r = (int)(a % b)))
	{
		a = b;
		b = r;
	}
	return b;
}

class mod
{
public:
	ll val;

	mod(ll v)
	{
		val = v % max;
	}

	mod()
	{
		val = 0;
	}

	void operator -=(const mod &v)
	{
		val -= v.val;

		if (val < 0)
			val += max;
	}

	void operator +=(const mod &v)
	{
		if (val + v.val >= max)
			val -= max;
		val += v.val;
	}

	void operator +=(ll &v)
	{
		if (val + v >= max)
			val -= max;
		val += v;
	}

	void operator *=(const mod &v)
	{
		val *= v.val;
		val %= max;
	}

	void operator *=(ll &v)
	{
		val *= v;
		val %= max;
	}

	ll modinv(ll a)
	{
		ll b = max, u = 1, v = 0;
		while (b)
		{
			ll t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		u %= max;
		if (u < 0)
			u += max;
		return u;
	}

	void operator /=(const mod &v)
	{
		val *= modinv(v.val);
		val %= max;
	}

	void operator /=(ll &v)
	{
		val *= modinv(v);
		val %= max;
	}
};

int main()
{
	int n;
	cin >> n;
	vector<int> a(n);
	cin >> a[0];
	cpp_int M = a[0];

	for (int i = 1; i < n; i++)
	{
		cin >> a[i];
		int g = gcd(M, a[i]);
		M *= a[i] / g;
	}

	cpp_int r = 0;
	for (int i = 0; i < n; i++)
		r += M / a[i];
	ll rp = r % max;
	printf("%lld", rp);
	return 0;
}


Compiler output:
a.cc:16:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
   16 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<tuple>


#define MOD 1000000007
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back

typedef long long ll;

using namespace std;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

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

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

int main(){
    ll N;
    cin>>N;
    vector<ll> A(N);

    vector<ll> so(1000000);
    rep(i,0,N)cin>>A[i];
    rep(i,0,N){
        
    }

    sort(A.begin(),A.end());
    ll LCM=1;
    rep(i,0,N){
        LCM = lcm(LCM,A[i]);
        LCM %= MOD;
    }
    ll ans=0;
    rep(i,0,N){
        ans += (LCM*ll(pow(A[i],MOD-2)))%MOD;
        ans %= MOD;
    }
    if(ans<0)ans+=MOD;

    cout<<ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:24: error: 'pow' was not declared in this scope
   59 |         ans += (LCM*ll(pow(A[i],MOD-2)))%MOD;
      |                        ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned ll;
using ld = long double;
using pll = pair<ll, ll>;
using pss = pair<string, string>;
using pdd = pair<ld, ld>;
using graph = vector<vector<int>>;

const ll MOD = 1000000007;
const ld EPS = 1e-9;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ex[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const int ey[8] = {0, 1, 1, 1, 0, -1, -1, -1};

template <class T>
void chmin(T &a, T b) { a = min(a, b); }
template <class T>
void chmax(T &a, T b) { a = max(a, b); }

ll intabs(ll a)
{
    if (a >= 0)
        return a;
    else
        return -a;
}

ll intpow(ll a, ll b, ll p = LLONG_MAX)
{
    ll ret = 1;
    while (b != 0)
    {
        if ((b & 1) == 1)
            ret *= a;
        a *= a;
        if (a >= p)
            a %= p;
        if (ret >= p)
            ret %= p;
        b = b >> 1;
    }
    return ret;
}

int digit(ll a, ll b = 10)
{
    int ret = 0;
    while (a != 0)
    {
        a /= b;
        ret++;
    }
    return ret;
}

ll gcd(ll x, ll y)
{
    while (y != 0)
    {
        ll cnt = x % y;
        x = y;
        y = cnt;
    }
    return x;
}

ll modinv(ll a, ll m = MOD)
{
    ll b = m, u = 1, v = 0;
    while (b)
    {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0)
        u += m;
    return u;
}

class UnionFind
{
    vector<int> par, sz;

public:
    UnionFind(int n) : par(n), sz(n)
    {
        for (int i = 0; i < n; i++)
        {
            par[i] = i;
            sz[i] = 1;
        }
    }
    int root(int x)
    {
        if (par[x] == x)
            return x;
        return par[x] = root(par[x]);
    }
    void unite(int x, int y)
    {
        int rx = root(x);
        int ry = root(y);
        if (rx == ry)
            return;
        par[rx] = ry;
        sz[ry] += sz[rx];
    }
    bool same(int x, int y)
    {
        return root(x) == root(y);
    }
    int size(int x)
    {
        return sz[root(x)];
    }
};

#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;

mp::cpp_int gcd(mp::cpp_int x, mp::cpp_int y)
{
    mp::cpp_int cnt;
    while (y != 0)
    {
        cnt = x % y;
        x = y;
        y = cnt;
    }
    return x;
}

int main()
{
    int i, j, k, cnt;
    int n;
    cin >> n;
    mp::cpp_int s = 1, t = 0;
    for (i = 0; i < n; i++)
    {
        cin >> a;
        s *= a;
    }
    for (i = 0; i < n; i++)
    {
        t += s / a[i];
    }
    cout << t / gcd(s, t) % MOD << endl;
}


Compiler output:
a.cc:125:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
  125 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.