criyle/codenet-compile-errors huggingface dataset:
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 = 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*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:21: error: 'pow' was not declared in this scope
   59 |         ans += (LCM*pow(A[i],MOD-2))%MOD;
      |                     ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

using ll = long long int;

ll N;
std::vector<ll> A;

ll gcd(ll a, ll b) {
  while (a && b) {
    if (a >= b) a %= b;
    else b %= a;
  }
  return a + b;
}
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b;}u

int main(){
    cin >> N;
    for(ll i=0;i<N;i++){
        ll tmp;
        cin >> tmp;
        A.push_back(tmp);
    }

    if(N == 1){
        cout << "1" << endl;
        return 0;
    }

    ll lcm_value = lcm(A[0], A[1]);

    for(int i=2;i<N;i++){
        lcm_value = lcm(lcm_value, A[i]);
    }

    ll ans = 0;
    for(int i=0;i<N;i++){
        ans = (ans + lcm_value / A[i]) % 1000000007;
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc:19:50: error: 'u' does not name a type
   19 | ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b;}u
      |                                                  ^
Language: Java

//****** @mdazmat9 **********
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define UB upper_bound
#define LB lower_bound
#define BS binary_search
#define EB emplace_back
#define endl "\n"
#define MOD 1000000007
#define F first
#define S second
#define ALL(a) (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
int fast_pow(int x, int y, int p);

void solve() {
    int n;cin>>n;
    int a[n];
    int lcm=1;
    for(int i=0;i<n;i++){
        cin>>a[i];
        int gc=__gcd(lcm,a[i]);
        gc=(lcm*a[i])/gc;
        lcm=gc;
    }
   int ans=0;
    for(int i=0;i<n;i++){
        int num=lcm/a[i];
        ans+=num;
        ans%=MOD;
    }
    cout<<ans<<endl;

}
int32_t main() {
    IOS;
    int test = 1;
    //cin >> test;
    while (test--) {
        solve();
    }
    return 0;
}
int fast_pow(int x, int y, int p) {
    int res = 1;
    x = x % p;
    while (y > 0) {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}

Compiler output:
Main.java:2: error: illegal character: '#'
#include<bits/stdc++.h>
^
Main.java:2: error: class, interface, enum, or record expected
#include<bits/stdc++.h>
        ^
Main.java:4: error: illegal character: '#'
#define int long long
^
Main.java:4: error: class, interface, enum, or record expected
#define int long long
        ^
Main.java:5: error: illegal character: '#'
#define UB upper_bound
^
Main.java:6: error: illegal character: '#'
#define LB lower_bound
^
Main.java:7: error: illegal character: '#'
#define BS binary_search
^
Main.java:8: error: illegal character: '#'
#define EB emplace_back
^
Main.java:9: error: illegal character: '#'
#define endl "\n"
^
Main.java:10: error: illegal character: '#'
#define MOD 1000000007
^
Main.java:11: error: illegal character: '#'
#define F first
^
Main.java:12: error: illegal character: '#'
#define S second
^
Main.java:13: error: illegal character: '#'
#define ALL(a) (a).begin(),(a).end()
^
Main.java:14: error: illegal character: '#'
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
^
Main.java:14: error: class, interface, enum, or record expected
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
                                     ^
Main.java:14: error: class, interface, enum, or record expected
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
                                                 ^
Main.java:18: error: not a statement
    int n;cin>>n;
             ^
Main.java:19: error: not a statement
    int a[n];
          ^
Main.java:22: error: not a statement
        cin>>a[i];
           ^
Main.java:33: error: not a statement
    cout<<ans<<endl;
             ^
Main.java:17: error: unnamed classes are a preview feature and are disabled by default.
void solve() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:19: error: ';' expected
    int a[n];
           ^
Main.java:37: error: not a statement
    IOS;
    ^
23 errors
Language: C++

#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
using namespace std;
namespace mp = boost::multiprecision;
typedef long long ll;
using Bint = mp::cpp_int;
using Real = mp::number<mp::cpp_dec_float<100>>;


ll gcd(ll x,ll y){
  if(x<y) swap(x,y);
  //xの方が常に大きい
  while(y>0){
    ll r=x%y;
    x=y;
    y=r;
  }
  return x;
}

ll lcm(ll x,ll y){
  return ll(x*y/gcd(x,y));
}

//n個の場合のlcmも2個で比べて順に適用していくだけ
signed main(){
  ll inf=pow(10,9)+7;
  ll n;cin >> n;
  vector<ll> a(n);for(ll i=0;i<n;i++){cin >> a[i];}
  Bint ans1=lcm(a[0],a[1]);
  for(ll i=1;i<n;i++){
    ans=lcm(ans,a[i]);
  }
  //cout << ans << endl;
  Bint cnt=0;
  for(ll i=0;i<n;i++){
    cnt+=ll(ans/a[i]);
    cnt%=inf;
  }
  cout << cnt << endl;
}


Compiler output:
a.cc:1:10: fatal error: boost/multiprecision/cpp_dec_float.hpp: No such file or directory
    1 | #include <boost/multiprecision/cpp_dec_float.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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, a);
	cpp_int r;
	while ((r = 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 <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 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, a);
	cpp_int r;
	while ((r = 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++

n = int(input())
nums = [int(x) for x in input().split(" ")]
def gcd(a, b):
  if b == 0:
    return a
  else: return gcd(b, a%b)

lcm = 1
for i in nums:
  lcm = (lcm * i // gcd(lcm, i)) % (1000000007*1000000007)

res = 0
for i in nums:
  res += (lcm // i) % 1000000007
print(res % 1000000007)


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

#include<bits/stdc++.h>
#define itn int
#define lli unsigned long long int
#define REP(a,n) for(int i=a;i < n;i++)
#define REP2(a,n) for(int j = a;j<n;j++)
#define scanf scanf_s
using namespace std;
lli gcd(lli m, lli n) {
	if (n > m) {
		lli temp = n;
		n = m;
		m = temp;
	}
	for (;;) {
		if (n == 0) {
			break;
		}
		lli temp = m % n;
		m = n;
		n = temp;
	}
	return m;
}
lli lcm(lli m, lli n) {
	lli g = gcd(m, n);
	m = m / g;
	n = n / g;
	return m * n*g;
}
int main(void) {
	vector<lli> A;
	int N;
	lli B = 1;
	scanf("%d", &N);
	lli prev= 0;
	lli temp = 1;
	scanf("%lld", &prev);
	A.push_back(prev);
	for (int i = 1; i < N; i++) {
		scanf("%lld", &temp);
		A.push_back(temp);
		lli lc = lcm(temp, prev);
		B *= lc / prev;
		B %= 1000000007;
		B += lc / temp;
		B %= 1000000007;
		prev = lc;
	}
	printf("%lld\n", B);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    6 | #define scanf scanf_s
      |               ^~~~~~~
a.cc:34:9: note: in expansion of macro 'scanf'
   34 |         scanf("%d", &N);
      |         ^~~~~
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 n;
  cin>>n;
  
      int arr[n];
  for(int i=0;i<n;i++)
  {
  cin>>arr[i];}
    unsigned long long int lcmm=findlcm(arr, n);
  unsigned long long int res=o;
  for(int i=0;i<n;i++)
  {
    res+=lcm/arr[i];
  }
  cout<<res;
    return 0; 
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:40:30: error: 'o' was not declared in this scope
   40 |   unsigned long long int res=o;
      |                              ^
a.cc:43:13: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator/'
   43 |     res+=lcm/arr[i];
      |          ~~~^~~~~~~
Language: Java

import java.util.*;
import java.lang.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		long[] A = new long[N];
		long ans = 1;
		long Mod = 1000000007L;
		for( int i=0; i<N; i++ ){
			A[i] = sc.nextLong();
			ans = ( (ans%Mod)*(A[i]%Mod) )%Mod;
		}
		Arrays.sort(A);
		int a = 0;
		for( int i=0; i<N; i++ ){
			if( A[i]%A[0]!=0 ){
				a = 1;
				break;
			}
		}
		int Least = 0;
		if( a==0 ){
			Least = A[0];
		}else{
			for( int i=1; i*i<=A[0]; i++ ){
				if( A[0]%i==0 ){
					for( int k=0; k<N; k++ ){
						if( A[k]%i!=0 ){
							break;
						}
						if( k==N-1 ){
							Least = i;
						}
					}
				}
			}
		}
		ans = (ans/Least)%Mod;
		long answer = 0;
		for( int i=0; i<N; i++ ){
			answer += (ans/A[i])%Mod;
			answer = answer%Mod;
		}
		System.out.println(answer);
	}
}


Compiler output:
Main.java:25: error: incompatible types: possible lossy conversion from long to int
			Least = A[0];
			         ^
1 error
Language: C

#include <stdio.h>
#include <stdlib.h>
#include<algorithm>
using namespace std;
/* 欧几里得算法求 数字 a b 的最大公约数 */
int gcd(int x, int y)
{
    while(y^=x^=y^=x%=y);
    return x;
}
/* 数字 a b 的最小公约数 */
int lcm(int a,int b) {
	return a*b/__gcd(a,b);
}

int main(int argc, char *argv[]) {
	int n,i;
	long long int sum=0,r;
	int *data=NULL;
	scanf("%d",&n);
 
// 动态申请数字空间
		data = (int*)malloc(n*sizeof(n));
		for(i=0; i<n; i++) {
			scanf("%d",&data[i]);
		}
// 特殊处理只有一个数字的情况
		if(n==1) {
			r = data[0];
		} else {
// 先求前两个数字的最小公倍数
			r = lcm(data[0],data[1]);
// 求第 i 个数字和前面所有数字的最小公倍数
			for(i=2; i<n; i++) {
				r = lcm(r,data[i]);
			}
		}
		for(i=0; i<n; i++) {
			sum+=r/data[i];
			if(sum>=1000000007)
				sum-=1000000007;
		}

		printf("%d\n",sum);

	
	return 0;
}

Compiler output:
main.c:3:9: fatal error: algorithm: No such file or directory
    3 | #include<algorithm>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <numeric>
using namespace std;

long long lcm(long long x, long long y){
  return (x * y) / __gcd(x, y);
}

int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  for(int i = 0; i < N; ++i){
    cin >> A[i];
  }
  long long x = A[0];
  long long mod = 1000000007;
  for(int i=0; i<N; ++i){
    x = lcm(x, A[i]);
  }
  long long ret = 0;
  for(int i=0; i<N; ++i){
    ret += x / A[i];
    ret %= mod;
  }
  cout << ret << endl;
  return 0;
}

Compiler output:
a.cc: In function 'long long int lcm(long long int, long long int)':
a.cc:7:20: error: '__gcd' was not declared in this scope; did you mean 'std::__detail::__gcd'?
    7 |   return (x * y) / __gcd(x, y);
      |                    ^~~~~
      |                    std::__detail::__gcd
In file included from a.cc:3:
/usr/include/c++/14/numeric:134:5: note: 'std::__detail::__gcd' declared here
  134 |     __gcd(_Tp __m, _Tp __n)
      |     ^~~~~
Language: C++

#pragma gcc optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V)) //小さい方からソート
#define REV(V) reverse(ALL(V)) //リバース
#define RSORT(V) SORT(V);REV(V) //大きい方からソート
#define NPN(V) next_permutation(ALL(V)) //順列
#define pb(n) push_back(n)
#define endl '\n'
#define Endl '\n'
#define DUMP(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define Yay(n) cout << ((n) ? "Yay!": ":(") << endl
#define RAPID cin.tie(0);ios::sync_with_stdio(false)
#define VSUM(V) accumulate(ALL(V), 0)
#define MID(a,b,c) (a) < (b) && (b) < (c)
#define MIDe(a,b,c) (a) <= (b) && (b) <= (c)
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c 
#define IN4(a,b,c,d) cin >> a >> b >> c >> d
#define VIN(V) for(int i = 0; i < (V).size(); i++) {cin >> (V).at(i);}
#define OUT(n) cout << n << endl
#define VOUT(V) REP(i, (V).size()) {cout << (V)[i] << endl;}
#define VOUT2(V) REP(i, (V).size()) {cout << (V)[i] << " ";} cout<<endl;

// 型マクロ定義
#define int long long
#define P pair<ll,ll>
#define Vi vector<ll>
#define Vd vector<double>
#define Vs vector<string>
#define Vc vector<char>
#define M map<ll,ll>
#define S set<ll>
#define PQ priority_queue<ll>
#define PQG priority_queue<ll,V,greater<ll>
//

const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int gcd(int a,int b){return b != 0 ? gcd(b, a % b) : a;} //最大公約数
int lcm(int a, int b){return a * b / gcd(a, b);}
string toStrUp(string str){char diff = 'A'-'a';REP(i,str.size()) str[i] += diff;return str;}
string gCh(string str, int key){return str.substr(key,1);}

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

signed main() {
  RAPID;
  // デフォルト変数定義
  int n=0,m=0,a=0,b=0,c=0,d=0,x=0,y=0,z=0;
  string s="",t="";
  //

  // ここから
  IN(n);
  Vi A(n);
  VIN(A)
  SORT(A);
  int tmp = A[0];
  int tmp2 = A[0];
  FOR(i,1,n){
    tmp = lcm(tmp,A[i]);
    tmp2 = gcd(tmp2,A[i]);
  }
  if(gcd==1){
    int t_lcm = 1;
    FOR(i,1,n){
      tmp2 *= (A[i]%MOD);
    }
    REP(i,n){
      x += (tmp / A[i]);
    }
  } else {
    REP(i,n){
      x += (tmp / A[i])%MOD;
    }
  }
  
  OUT(x);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:87:9: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator=='
   87 |   if(gcd==1){
      |      ~~~^~~
Language: C++

#include <algorithm>
#include <boost/optional.hpp>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits>
#include <list>
#include <numeric>
#include <queue>
#include <sstream>
#include <string>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>

#define REP(i, n) for(int i = 0, i##_MACRO = (n); i < i##_MACRO; i++)
#define RANGE(i, a, b) for(int i = (a), i##_MACRO = (b); i < i##_MACRO; i++)
#define EACH(e, a) for(auto&& e : a)
#define ALL(a) (a).begin(), (a).end()
#define AALL(a, n) (a), ((a) + (n))
#define FILL(a, n) memset((a), n, sizeof(a))
#define FILLZ(a) FILL(a, 0)
#define INT(x) (static_cast<int>(x))
#define MODNUM (INT(1e9 + 7))
#define MOD(x) ((x) % MODNUM)

using namespace std;

using ll = long long;
using VI = vector<int>;
using VI2D = vector<vector<int>>;

const int INF = 2e9;
const double EPS = 1e-10;
const double PI = acos(-1.0);

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

template <typename T>
int sign(T x) {
	return x < 0 ? -1 : x > 0 ? 1 : 0;
}

template <>
int sign(double x) {
	return x < -EPS ? -1 : x > EPS ? 1 : 0;
}

template <typename T>
void chmax(T& m, T x) {
	m = max(m, x);
}

template <typename T>
void chmin(T& m, T x) {
	m = min(m, x);
}

template <typename T>
T square(T x) {
	return x * x;
}

inline int toInt(string s) {
	int v;
	istringstream sin(s);
	sin >> v;
	return v;
}

// 最大公約数を返す
template <typename T>
T gcd(T a, T b) {
	if(a < b) {
		std::swap(a, b);
	}

	T r = a % b;
	while(r != 0) {
		a = b;
		b = r;
		r = a % b;
	}

	return b;
}

// 最小公倍数を返す
template <typename T>
T lcm(T a, T b) {
	return a / gcd(a, b) * b;
}

long long mod_pow(long long a, long long n, long long mod) {
	long long ret = 1;
	while(n != 0) {
		if(n % 2) {
			ret = (ret * a) % mod;
		}
		a = (a * a) % mod, n /= 2;
	}
	return ret;
}

// modの逆元
long long mod_inv(long long n, long long mod) {
	return mod_pow(n, mod - 2, mod);
}

int main() {
	int n;
	scanf("%d", &n);
	VI a(n);
	REP(i, n) { scanf("%d", &a[i]); }
	ll lcmall = 1;
	REP(i, n) { lcmall = lcm(lcmall, a[i]); }
	lcmall = MOD(lcmall);
	// printf("lcmall: %lld\n", lcmall);
	ll result = 0;
	REP(i, n) { result = MOD(result + lcmall * mod_inv(a[i], MODNUM)); }
	printf("%d\n", result);
	return 0;
}

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

#include <bits/stdc++.h>


#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int MD = (int)1e9 + 7; typedef vector<ll> VL;
void dbg(){ cerr << "\n"; }  template <class T, class ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }
template <class T> void amax(T& a,T b){ if(a>b) a=b;}

#include <boost/multiprecision/cpp_int.hpp>
typedef boost::multiprecision::cpp_int bint;

	bint gcd(bint x, bint y){ return y? gcd(y, x%y): x; }
	bint lcm(bint x, bint y){ return (x  / gcd(x, y) * y ) %MD; }

int main(){
	cin.tie(0); ios_base::sync_with_stdio(false);
	int n;
	cin >>n;
	VL a(n);
	rep(i, n) cin >>a[i];
	
	//bint z=a[0];
	rep(i, n){
		z = lcm(z, a[i]);
	}
	//vector<bint> b(n);
	//rep(i, n) b[i] = z / a[i];
	
	bint ans=0;
	rep(i,n){
		ans += z /a[i];
		ans%=MD;
	}
	cout <<ans <<"\n";
	return 0;
}


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

#include <iostream>
#include <string>
#include <cstdlib>
#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;
}

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]);

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

	//bool updated = false;

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

	for (ll i = 0; i < N; ++i)
	{
		if (A[i] == 1)
		{
			continue;
		}

		for (const auto p : PT)
		{
			while (true)
			{
				if (A[i] % p != 0) break;

				pfac[i][p]++;
				A[i] /= p;
			}
		}
	}

	map<ll, ll> pfac_t;

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

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

	for (ll i = 0; i < N; ++i)
	{
		//cout << i << endl;

		auto a = pfac[i];

		for (auto e : a)
		{
			//cout << e.first << " " << e.second << endl;
		}
	}

	//cout << " " << endl;

	for (auto e : pfac_t)
	{
		//cout << e.first << " " << e.second << endl;
	}

	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:69:31: error: cannot bind non-const lvalue reference of type 'std::vector<long long int>&' to an rvalue of type 'std::vector<long long int>'
   69 |         auto& PT = prime_table((int)Amax+1);
      |                    ~~~~~~~~~~~^~~~~~~~~~~~~
Language: C++

#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using INT=mp::cpp_int;
using namespace std;
using ll=long long;
using vec=vector<ll>;
using vect=vector<double>;
using Graph = vector<vector<ll>>;
#define loop(i,n) for(ll i=0;i<n;i++)
#define Loop(i, m, n) for(ll i = m;i < n;i++)
#define pool(i,n) for(ll i=n;i>=0;i--)
#define Pool(i, m, n) for(ll i=n;i>=m;i--)
#define MAX 99999999999ll
#define MIN -99999999999ll
#define setbit bitset<8>
#define flagcount __builtin_popcount
#define flag(x) (1<<x)
#define flagadd(bit,x) bit|=flag(x)
#define flagpop(bit,x) bit&=~flag(x) 
#define flagon(bit,i) bit&flag(i)
#define flagoff(bit,i) !(bit & (1<<i))
#define all(v) v.begin(),v.end()
#define low2way(v,x) lower_bound(all(v),x)
#define high2way(v,x) upper_bound(all(v),x)
#define count2way(v,x) high2way(v,x)-low2way(v,x)
#define lower(v,x) low2way(v,x)-v.begin() //1番左が0、もし見つから無いならｎを出力
#define higher(v,x) high2way(v,x)-v.begin()-1 //1番左が0、もし見つからないならn-1を出力（注意）
#define putout(a) cout<<a<<endl
#define putout2(a,b) putout(a);putout(b)
#define putout3(a,b,c) putout(a);putout(b);putout(c)
#define putout4(a,b,c,d) putout(a);putout(b);putout(c);putout(d)
#define putout5(a,b,c,d,e) putout(a);putout(b);putout(c);putout(d);putout(e)
#define Gput(a,b) G[a].push_back(b)
#define cin1(a) cin>>a
#define cin2(a,b) cin>>a>>b
#define cin3(a,b,c) cin>>a>>b>>c
#define cin4(a,b,c,d) cin>>a>>b>>c>>d
#define cin5(a,b,c,d,e) cin>>a>>b>>c>>d>>e
#define sum(v) accumulate(all(v), 0ll)
#define gcd(x,y) __gcd(x,y)
ll ctoi(char c){
	if(c>='0'&&c<='9'){
		return c-'0';
	}
	return 0;
}
ll lcm(ll x,ll y){
  ll z=gcd(x,y);
  return x*y/z;
}
INT LCM(INT x,INT y){
  INT z=gcd(x,y);
  return x*y/z;
}
ll primejudge(ll n){
  if(n<2)return 0;
  else if(n==2)return 1;
  else if(n%2==0)return 0;
  double sqrtn=sqrt(n);
  Loop(i,3,sqrtn+1){
     if(n%i==0){
        return 0;
     }
     i++;
  }
  return 1;
}
int main() {
  cout << fixed << setprecision(30);
  ll n;
  cin>>n;
  vector<INT> a(n);
  loop(i,n)cin>>a[i];
  INT exa=1;
  loop(i,n)exa=LCM(exa,a[i]);
  INT ans=0;
  INT d=exa/a[i];
  loop(i,n){
    ans+=d%1000000007;
  }
  putout(ans%1000000007);
}


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

import java.util.Scanner;

public class E {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] a = new int[n];
        for(int i = 0;i < n;i++) {
            a[i] = in.nextInt();
        }
        long b = 1;
        for(int i = 0;i < n;i++) {
            b = lcm(a[i], b);
        }
        long ans = 0, mod = (long)1e9 + 7;
        for(int i = 0;i < n;i++) {
            ans = (ans + b / a[i]) % mod;
        }
        System.out.println(ans);
    }

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

    private static long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a % b);
    }
}


Compiler output:
Main.java:3: error: class E is public, should be declared in a file named E.java
public class E {
       ^
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) {
		
		Scanner in = new Scanner(System.in);
				
		//int T = in.nextInt();
		//for(int t = 1; t <= T; ++t) {
			int n = in.nextInt();
			BigInteger a[] = new BigInteger[n];

			//System.out.print("Case " + t + ": ");
			BigInteger ans = in.nextBigInteger();
			a[0] = ans;
			for(int i = 1; i < n; ++i) {
				BigInteger x = in.nextBigInteger();
				a[i] = x;
				//BigInteger g = ans.gcd(x);
				ans = ans.multiply(x).divide(ans.gcd(x));
			}
			BigInteger res=0;
			for(int i=0;i<n;i++){
				res = res.add(ans.divide(a[i]));
				res=res.mod((BigInteger)1000000007);
			}
			System.out.println(res);
			System.gc();
	//	}
		
	}
	
}

Compiler output:
Main.java:29: error: incompatible types: int cannot be converted to BigInteger
			BigInteger res=0;
			               ^
Main.java:32: error: incompatible types: int cannot be converted to BigInteger
				res=res.mod((BigInteger)1000000007);
				                        ^
2 errors
Language: C++

#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
const int MOD = 1000000007;

int GCD(int a, int b){
    if (b == 0){
        return a;
    } else {
        int bigger = a > b ? a : b;
        int smaller = a > b ? b : a;
        return GCD(smaller, bigger % smaller);
    }
}

int LCM(int a, int b) {
    return a * b / __gcd(a, b);
}

int main() {
    int N;
    cin >> N;

    // input
    vector<int> v(N);
    for (size_t i = 0; i < N; i++)
    {
        int a;
        cin >> a;
        v[i] = a;
    }

    // calc lcm
    int lcm = 1;
    for (size_t i = 0; i < N; i++)
    {
        lcm = LCM(lcm, v[i]);
    }

    ll result = 0;
    for (size_t i = 0; i < N; i++)
    {
        result += lcm / v[i];
    }
    cout << result % MOD << endl;
}

Compiler output:
a.cc: In function 'int LCM(int, int)':
a.cc:18:20: error: '__gcd' was not declared in this scope
   18 |     return a * b / __gcd(a, b);
      |                    ^~~~~
Language: Java

 package program;
// by lxk
 
 
import java.util.*;
import java.math.*;
import java.io.*;
 
public class Main {
	
	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
				
		//int T = in.nextInt();
		//for(int t = 1; t <= T; ++t) {
			int n = in.nextInt();
			BigInteger a[] = new BigInteger[n];

			//System.out.print("Case " + t + ": ");
			BigInteger ans = in.nextBigInteger();
			a[0] = ans;
			for(int i = 1; i < n; ++i) {
				BigInteger x = in.nextBigInteger();
				a[i] = x;
				//BigInteger g = ans.gcd(x);
				ans = ans.multiply(x).divide(ans.gcd(x));
			}
			BigInteger res=0;
			for(int i=0;i<n;i++){
				res = res + ans.divide(a[i]);
				res%=1000000007;
			}
			System.out.println(res);
			System.gc();
	//	}
		
	}
	
}

Compiler output:
Main.java:29: error: incompatible types: int cannot be converted to BigInteger
			BigInteger res=0;
			               ^
Main.java:31: error: bad operand types for binary operator '+'
				res = res + ans.divide(a[i]);
				          ^
  first type:  BigInteger
  second type: BigInteger
Main.java:32: error: bad operand types for binary operator '%'
				res%=1000000007;
				   ^
  first type:  BigInteger
  second type: int
3 errors
Language: C++

#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)((x).size())
#define mp make_pair

using namespace std;

typedef long long ll;
typedef pair<int,int> ii;

template<class U,class T>ostream& operator<<(ostream& out, pair<U,T> & P){
    return out << "[" << P.first << ", " << P.second << "]";
}
template<class T>ostream& operator<<(ostream& out, vector<T> & V){
    if(!V.empty())out << "[";
    for(int i = 0; i < sz(V); i++)out << V[i] << (i+1==sz(V)?"]":", ");
    return out;
}

vector<ll> V;
ll mod = 1e9+7;

ll __pow(ll a, ll p){
    ll res = 1;
    for(;p;p>>=1, (a*=a)%=mod)
        if(p&1)(res*=a)%=mod;
    return res;
}

ll inverse(ll a){
    return __pow(a,mod-2);
}

int primes[1000001];

vector<ll> p;

void init(){
    bool used[1000001] {};
    for(int i = 2; i < 1000001; i++){
        if(!used[i]) p.push_back(i);
        for(int j = i*2; j < 1000001; j+=i)used[j] = 1;
    }
}

void factor(ll a){
    int i = 0, br = 0;
    while(a>1) {
        if(a%p[i]==0){
            a/=p[i];
            br++;
        }
        else {
            primes[p[i]] = max(primes[p[i]], br);
            i++;
            br = 0;
        }
    }
    primes[p[i]] = max(primes[p[i]], br);
}

int main(){
    ios_base::sync_with_stdio(false);
    int N;
    cin >> N;
    init();
    V.resize(N);
    for(auto& i: V)cin >> i, factor(i);


    ll lcm = 1, res = 0;
    for(int i = 2; i < 1000001; i++){
        if(primes[i])
            lcm *= __pow(i, primes[i]), lcm%=mod;
    }
    for(int i = 0; i < N; i++){
        res += (lcm * inverse(V[i]))%mod;
        res%=mod;
    }
    cout << res << endl;

    // ll mult = 1;
    // ll nom = 0;
    // for(int i = 0; i < N; i++)(mult*=V[i])%=mod;
    // for(int i = 0; i < N; i++)(nom += (mult*inverse(V[i]))%mod)%=mod;
    // //cout << nom << endl;
    // ll den = 1;
    // for(int i = 1; i < N; i++){
    //     ll temp = V[i], res = 1;
    //     for(int j = 0; j < i; j++){
    //         ll g = __gcd(temp,V[j]);
    //         temp/=g;
    //         res*=g;
    //         res%=mod;
    //     }
    //     den*=res;
    //     den%=mod;
    // }
    
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:25: error: call of overloaded '__pow(int&, int&)' is ambiguous
   74 |             lcm *= __pow(i, primes[i]), lcm%=mod;
      |                    ~~~~~^~~~~~~~~~~~~~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: candidate: 'double __pow(double, double)'
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
a.cc:23:4: note: candidate: 'll __pow(ll, ll)'
   23 | ll __pow(ll a, ll p){
      |    ^~~~~
Language: Java

 package program;
// by lxk
 
 
import java.util.*;
import java.math.*;
import java.io.*;
 
public class Main {
	
	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
				
		//int T = in.nextInt();
		//for(int t = 1; t <= T; ++t) {
			int n = in.nextInt();
			int a[] = new int[n];

			//System.out.print("Case " + t + ": ");
			BigInteger ans = in.nextBigInteger();
			a[0] = ans;
			for(int i = 1; i < n; ++i) {
				BigInteger x = in.nextBigInteger();
				a[i] = x;
				//BigInteger g = ans.gcd(x);
				ans = ans.multiply(x).divide(ans.gcd(x));
			}
			long res=0;
			for(int i=0;i<n;i++){
				res += ans/a[i];
				res%=1000000007;
			}
			System.out.println(res);
			System.gc();
	//	}
		
	}
	
}

Compiler output:
Main.java:22: error: incompatible types: BigInteger cannot be converted to int
			a[0] = ans;
			       ^
Main.java:25: error: incompatible types: BigInteger cannot be converted to int
				a[i] = x;
				       ^
Main.java:31: error: bad operand types for binary operator '/'
				res += ans/a[i];
				          ^
  first type:  BigInteger
  second type: int
3 errors
Language: C++

#include<iostream>
using namespace std;
int main()
{
    // 整数の入力
    long long long a;
    cin >> a;

    long long long list[a];
    long long long sublist[a];


    for (long long long i = 0; i < a; i++)
    {
        cin >> list[i];
    }

    for (long long long i = 0; i < a; i++)
    {
        sublist[i] = list[i];
    }


    long long long b, r, x, tmp;
    b = list[0];


    for (long long long i = 0; i < a-1 ; i++)
    {
        x = b * list[i+1];

        /* 自然数 a > b を確認・入替 */
        if(b<list[i+1]){
            tmp = b;
            b = list[i+1];
            list[i+1] = tmp;
        }
        /* ユークリッドの互除法 */
        r = b % list[i+1];
        while(r!=0){
            b = list[i+1];
            list[i+1] = r;
            r = b % list[i+1];
        }
        b = x/list[i+1];
    }

    long long long ans = 0;

    for (long long long i = 0; i < a; i++)
    {
        ans = ans + b/sublist[i];
    }

    ans = ans % (1000000000 + 7);

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: 'long long long' is too long for GCC
    6 |     long long long a;
      |               ^~~~
a.cc:9:15: error: 'long long long' is too long for GCC
    9 |     long long long list[a];
      |               ^~~~
a.cc:10:15: error: 'long long long' is too long for GCC
   10 |     long long long sublist[a];
      |               ^~~~
a.cc:13:20: error: 'long long long' is too long for GCC
   13 |     for (long long long i = 0; i < a; i++)
      |                    ^~~~
a.cc:18:20: error: 'long long long' is too long for GCC
   18 |     for (long long long i = 0; i < a; i++)
      |                    ^~~~
a.cc:24:15: error: 'long long long' is too long for GCC
   24 |     long long long b, r, x, tmp;
      |               ^~~~
a.cc:28:20: error: 'long long long' is too long for GCC
   28 |     for (long long long i = 0; i < a-1 ; i++)
      |                    ^~~~
a.cc:48:15: error: 'long long long' is too long for GCC
   48 |     long long long ans = 0;
      |               ^~~~
a.cc:50:20: error: 'long long long' is too long for GCC
   50 |     for (long long long i = 0; i < a; i++)
      |                    ^~~~
Language: Java

 package program;
// by lxk
 
 
import java.util.*;
import java.math.*;
import java.io.*;
 
public class Main {
	
	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
				
		//int T = in.nextInt();
		//for(int t = 1; t <= T; ++t) {
			int n = in.nextInt();
			int a[1000000];
			a[0] = n;
			//System.out.print("Case " + t + ": ");
			BigInteger ans = in.nextBigInteger();
			for(int i = 1; i < n; ++i) {
				BigInteger x = in.nextBigInteger();
				a[i] = x;
				//BigInteger g = ans.gcd(x);
				ans = ans.multiply(x).divide(ans.gcd(x));
			}
			long long res=0;
			for(int i=0;i<n;i++){
				res += ans/a[i];
				res%=1000000007;
			}
			System.out.println(res);
			System.gc();
	//	}
		
	}
	
}

Compiler output:
Main.java:18: error: ']' expected
			int a[1000000];
			      ^
Main.java:28: error: not a statement
			long long res=0;
			^
Main.java:28: error: ';' expected
			long long res=0;
			    ^
3 errors
Language: C++

#include <bits/stdc++.h>

using namespace  std;

int gcd(int a, int b)
{
    if(a % b == 0){
        return b
    }
    return gcd(b, a % b)
}

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

int main(){
    int n;
    cin >> n ;
    vector<int> a(n);
    for(auto&e :a) cin >>e;

    int mod = 1000000007;

    int l = 1;
    for (int i = 0; i < n; i++){
        l = lcm(l, a[i]);
    }
    int ans = 0;
    for (int i = 0; i < n; i++){
        ans += l / a[i];
        ans %= mod;
    }
    cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:8:17: error: expected ';' before '}' token
    8 |         return b
      |                 ^
      |                 ;
    9 |     }
      |     ~            
a.cc:10:25: error: expected ';' before '}' token
   10 |     return gcd(b, a % b)
      |                         ^
      |                         ;
   11 | }
      | ~
Language: C++


#include <stdio.h>
#include <iostream>
#include <string.h>
#include <limits.h>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>

typedef unsigned long long ULLONG;
typedef long long LLONG;

template <class _T> static _T tp_abs(const _T& a) {
	return ((a < 0) ? (a * -1) : a);
}
template <class _T> static _T tp_min(_T a, _T b) {
	return a < b ? a : b;
}
template <class _T> static _T tp_max(_T a, _T b) {
	return a > b ? a : b;
}
template<class _T> static void get1int(_T& a) {
	const char* fmt = " %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld";
	}

	if (scanf(fmt, &a) < 0) {
		printf("g1int Error\n");
	}
}
template<class _T> static void get2int(_T& a, _T& b) {
	const char* fmt = " %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld";
	}

	if (scanf(fmt, &a, &b) < 0) {
		printf("g2int Error\n");
	}
}
template<class _T> static void get3int(_T& a, _T& b, _T& c) {
	const char* fmt = " %d %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld %lld";
	}

	if (scanf(fmt, &a, &b, &c) < 0) {
		printf("g3int Error\n");
	}
}
static void getstring(char* buff) {
	if (scanf(" %s", buff) < 0) {
		printf("getstr error!\n");
	}
}
template <class _T> static _T tp_pow(int base, int exp)
{
	_T ans = 1;

	for (int i = 0; i < exp; i++) {
		ans *= base;
	}
	return ans;
}
template <class _T> static _T tp_lcm(_T first, _T second) {
	_T gcd = tp_gcd<_T>(first, second);
	return first * second / gcd;
}

static const long long MOD_NUM = 1000000007LL;

static void E_task();

int main()
{
	E_task();
	fflush(stdout);
	return 0;
}

static void E_task()
{
	int N;
	get1int(N);

	std::vector<LLONG> sa(N, 0);
	LLONG lcm = 0;
	for (int i = 0; i < N; i++) {
		int tmp; get1int(tmp);
		sa[i] = tmp;
		
		if (i > 0) {
			lcm = tp_lcm<LLONG>(lcm, sa[i]);
		}
		else {
			lcm = sa[0];
		}
	}

	LLONG ans = 0;
	for (int i = 0; i < N; i++) {
		ans += lcm / sa[i];
		ans %= MOD_NUM;
	}
	printf("%lld\n", ans);
}


Compiler output:
a.cc: In function '_T tp_lcm(_T, _T)':
a.cc:69:18: error: 'tp_gcd' was not declared in this scope; did you mean 'tp_lcm'?
   69 |         _T gcd = tp_gcd<_T>(first, second);
      |                  ^~~~~~
      |                  tp_lcm
a.cc:69:27: error: expected primary-expression before '>' token
   69 |         _T gcd = tp_gcd<_T>(first, second);
      |                           ^
Language: Java

import java.math.*;
import java.util.*;

public class solve {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		BigInteger val, ans = BigInteger.valueOf(0), x, y, res, MOD = BigInteger.valueOf(1000000007), arr[] = new BigInteger[10005] ;
		int n ;
		n = sc.nextInt() ;
		for(int i = 0; i < n; i++) {
			val = sc.nextBigInteger() ;
			arr[i] = val ;
		}
		res = arr[0] ;
		for(int i = 1; i < n; i++) {
			x = res.multiply(arr[i]) ;
			y = res.gcd(arr[i]) ;
			res = x.divide(y) ;
		}
		
		for(int i = 0; i < n; i++ ) {
			x = res.divide(arr[i]) ;
			ans = ans.add(x) ;
			ans = ans.mod(MOD) ;
		}
		System.out.println(ans) ;
	}
}


Compiler output:
Main.java:4: error: class solve is public, should be declared in a file named solve.java
public class solve {
       ^
1 error
Language: C++


#include <stdio.h>
#include <iostream>
#include <string.h>
#include <limits.h>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>

typedef unsigned long long ULLONG;
typedef long long LLONG;

template <class _T> static _T tp_abs(const _T& a) {
	return ((a < 0) ? (a * -1) : a);
}
template <class _T> static _T tp_min(_T a, _T b) {
	return a < b ? a : b;
}
template <class _T> static _T tp_max(_T a, _T b) {
	return a > b ? a : b;
}
template<class _T> static void get1int(_T& a) {
	const char* fmt = " %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld";
	}

	if (scanf(fmt, &a) < 0) {
		printf("g1int Error\n");
	}
}
template<class _T> static void get2int(_T& a, _T& b) {
	const char* fmt = " %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld";
	}

	if (scanf(fmt, &a, &b) < 0) {
		printf("g2int Error\n");
	}
}
template<class _T> static void get3int(_T& a, _T& b, _T& c) {
	const char* fmt = " %d %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld %lld";
	}

	if (scanf(fmt, &a, &b, &c) < 0) {
		printf("g3int Error\n");
	}
}
static void getstring(char* buff) {
	if (scanf(" %s", buff) < 0) {
		printf("getstr error!\n");
	}
}
template <class _T> static _T tp_pow(int base, int exp)
{
	_T ans = 1;

	for (int i = 0; i < exp; i++) {
		ans *= base;
	}
	return ans;
}

static const long long MOD_NUM = 1000000007LL;

static void E_task();

int main()
{
	E_task();
	fflush(stdout);
	return 0;
}

static void E_task()
{
	int N;
	get1int(N);

	std::vector<LLONG> sa(N, 0);
	LLONG lcm = 0;
	for (int i = 0; i < N; i++) {
		int tmp; get1int(tmp);
		sa[i] = tmp;
		
		if (i > 0) {
			lcm = tp_lcm<LLONG>(lcm, sa[i]);
		}
		else {
			lcm = sa[0];
		}
	}

	LLONG ans = 0;
	for (int i = 0; i < N; i++) {
		ans += lcm / sa[i];
		ans %= MOD_NUM;
	}
	printf("%lld\n", ans);
}


Compiler output:
a.cc: In function 'void E_task()':
a.cc:92:31: error: 'tp_lcm' was not declared in this scope
   92 |                         lcm = tp_lcm<LLONG>(lcm, sa[i]);
      |                               ^~~~~~
a.cc:92:43: error: expected primary-expression before '>' token
   92 |                         lcm = tp_lcm<LLONG>(lcm, sa[i]);
      |                                           ^
Language: C++

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

using ll =long long;


int main() {
for(int i=0;i<N;){
cout<<0;
}
  cout<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: 'N' was not declared in this scope
    8 | for(int i=0;i<N;){
      |               ^
Language: C++

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

buf=[]
mul=1

n=int(input())
i=0;
for x in input().split():
    
    buf.append(int(x))  
    mul=mul*(buf[i]/gcd(mul,buf[i]))
    i+=1
sum=0
for i in range(n):
    buf[i]=mul/buf[i]
    sum+=buf[i]
    sum%=1000000007
print(int(sum))


Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def gcd(a,b):
      | ^~~
a.cc:11:1: error: expected unqualified-id before 'for'
   11 | for x in input().split():
      | ^~~
Language: C++

def find_lcm(num1, num2): 
    if(num1>num2): 
        num = num1 
        den = num2 
    else: 
        num = num2 
        den = num1 
    rem = num % den 
    while(rem != 0): 
        num = den 
        den = rem 
        rem = num % den 
    gcd = den 
    lcm = (num1 * num2)/int(gcd) 
    return lcm
 
n = int(input())
l = list(map(int, input().split()))
lcm = 1 
  
for i in range(0, len(l)): 
    lcm = find_lcm(lcm, l[i])
 
ans = 0
 
for i in range(0, len(l)):
  ans += lcm / l[i]
 
print(int(ans % 1000000007))

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def find_lcm(num1, num2):
      | ^~~