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

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

int main(){
  int a;
  cin>>a;
  unsigned long long int c,d,e;
  vector<unsigned long long int> b(a);
  vector<unsigned long long int> f=b;
  for(int i=0;i<a;i++)
    cin>>b.at(i);
  for(int i=0;i<a-1;i++){
    c=max(b.at(i),b.at(i+1));
    d=min(b.at(i),b.at(i+1));
    e=c%d;
    if(e==0)
      b.at(i+1)=f.at(i)*f.at(i+1)/e;
    else{
      b.at(i)=d;
      b.at(i+1)=e;
      i--;
    }
  }
  cout<<b.at(a-1)<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:24:25: error: expected '}' at end of input
   24 |   cout<<b.at(a-1)<<endl;
      |                         ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define int long long
#define P pair<long,long>
using namespace std;
 
inline int lcm(int a,int b){
    if(a<b) swap(a,b);
    int n=a,m=b;
    while(a%b!=0){
        int t=b;
        b=a%b;
        a=t;
    }
    return n/b*m;
}
 
signed main(){
  int a;
  vector<int> b(a);
  rep(i,a)
    cin>>b.at(i);
   int c=lcm(b.at(0),b.at(1));
  rep(i,a-1)
    int t;
    t=lcm(c,b.at(i+1));
    c=t;
    cout<<c;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: 't' was not declared in this scope
   26 |     t=lcm(c,b.at(i+1));
      |     ^
a.cc:26:18: error: 'i' was not declared in this scope
   26 |     t=lcm(c,b.at(i+1));
      |                  ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define int long long
#define P pair<long,long>
using namespace std;
 
inline int lcm(int a,int b){
    if(a<b) swap(a,b);
    int n=a,m=b;
    while(a%b!=0){
        int t=b;
        b=a%b;
        a=t;
    }
    return n/b*m;
}
 
signed main(){
  int a;
  vector<int> b(a);
  rep(i,a)
    cin>>b.at(i);
   int c=lcm(b.at(0),b.at(1));
  rep(i,a-1)
    t=lcm(c,b.at(i+1));
    c=t;
    cout<<c;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 't' was not declared in this scope
   25 |     t=lcm(c,b.at(i+1));
      |     ^
a.cc:26:7: error: 't' was not declared in this scope
   26 |     c=t;
      |       ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define int long long
#define P pair<long,long>
using namespace std;
 
inline int lcm(int a,int b){
    if(a<b) swap(a,b);
    int n=a,m=b;
    while(a%b!=0){
        int t=b;
        b=a%b;
        a=t;
    }
    return n/b*m;
}
 
signed main(){
  int a;
  vector<int> b(a);
  rep(i,a)
    cin>>b.at(i);
   int c=lcm(b.at(0),b.at(1));
  rep(i,a-1)
    t=lcm(c,b.at(i+1))
    c=t;
    cout<<c;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 't' was not declared in this scope
   25 |     t=lcm(c,b.at(i+1))
      |     ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define int long long
#define P pair<long,long>
using namespace std;
 
inline int lcm(int a,int b){
    if(a<b) swap(a,b);
    int n=a,m=b;
    while(a%b!=0){
        int t=b;
        b=a%b;
        a=t;
    }
    return n/b*m;
}
 
signed main(){
  int a;
  vector<int> b(a);
  rep(i,a)
    cin>>b.at(i);
  rep(i,a-1)
    lcm(b.at(i),b.at(i+1))=b.at(i+1);
    cout<<b.at(a);
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:24:8: error: lvalue required as left operand of assignment
   24 |     lcm(b.at(i),b.at(i+1))=b.at(i+1);
      |     ~~~^~~~~~~~~~~~~~~~~~~
Language: C

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

/* define */
#define Yes(X) puts ( X ? "Yes" : "No")
#define YES(X) puts ( X ? "YES" : "NO")
#define FOR(i, a, b) for ( int i = a; i < b ; i++)
#define REP(i, n) for ( int i = 0; i < n ; i++)
#define max(a, b) (((a) > (b)) ? (a) : (b))
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define max3(a, b, c) ((max((a), (b)) > (c)) ? max((a), (b)) : (c))
#define min3(a, b, c) ((min((a), (b)) < (c)) ? min((a), (b)) : (c))

/* const */
const int MOD = (int)1e9 + 7;

/* alias */
typedef long long ll;
typedef unsigned  u;

/* function */
int cmp(const void *a, const void *b) {
	return *(int*)a - *(int*)b;
}
int cmp2(const void *a, const void *b) {
	return *(int*)b - *(int*)a;
}
int gcd(int a, int b) {
	if (b != 0)gcd(b, a % b);
	return a;
}
ll gcd(ll a, ll b) {
	if (b == 0) gcd(b, a % b); 
	return a;
}
int lcm(int a, int b) {
	return a / gcd(a, b) * b;
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

/* main */

int main() {
	ll n, t, r = 1;
	scanf("%lld", &n);
	REP(i, n) {
		scanf("%lld", &t);
		r = lcm(t, r);
	}
	printf("%lld", r);
	return 0;
}

Compiler output:
main.c:36:4: error: conflicting types for 'gcd'; have 'll(ll,  ll)' {aka 'long long int(long long int,  long long int)'}
   36 | ll gcd(ll a, ll b) {
      |    ^~~
main.c:32:5: note: previous definition of 'gcd' with type 'int(int,  int)'
   32 | int gcd(int a, int b) {
      |     ^~~
main.c:43:4: error: conflicting types for 'lcm'; have 'll(ll,  ll)' {aka 'long long int(long long int,  long long int)'}
   43 | ll lcm(ll a, ll b) {
      |    ^~~
main.c:40:5: note: previous definition of 'lcm' with type 'int(int,  int)'
   40 | int lcm(int a, int b) {
      |     ^~~
Language: C++

#include <bits/stdc++.h>

#define mod 1000000007

using namespace std;
typedef long long ll; 

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

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

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

	ll ans = 1LL;
	
	for(int i=0; i<N; i++){
		ll T;
		cin >> T;
		ans = lcm(ans, T)
	}
	cout << ans;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:34: error: expected ';' before '}' token
   31 |                 ans = lcm(ans, T)
      |                                  ^
      |                                  ;
   32 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>

#define mod 1000000007

using namespace std;
typedef long long ll;  

int main(void){
	
	int N, count;
	
	cin >> N;

	ll int T[N];
	
	for(int i=0; i<N; i++)
		cin >> T[i];
	
	sort(T, T+N, greater<int>());
	
	for(ll int i=T[0];;i*=T[0]){
		count++;
		for(int j=0; j<N; j++){
			if(i%T[j] == 0)
				count++;
		}
		if(count == N){
			cout << i;
			break;
		}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: two or more data types in declaration of 'T'
   14 |         ll int T[N];
      |         ^~
a.cc:17:24: error: 'T' was not declared in this scope
   17 |                 cin >> T[i];
      |                        ^
a.cc:19:14: error: 'T' was not declared in this scope
   19 |         sort(T, T+N, greater<int>());
      |              ^
a.cc:21:13: error: two or more data types in declaration of 'i'
   21 |         for(ll int i=T[0];;i*=T[0]){
      |             ^~
a.cc:21:28: error: 'i' was not declared in this scope
   21 |         for(ll int i=T[0];;i*=T[0]){
      |                            ^
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

ll gcd(ll x, ll y) {
    if(y == 0) {
        return x;
    }
    else {
        return gcd(y, x%y);
    }
}

ll lcm(ll x, ll y) {
    ll g = gcd(x, y);
    return a / g * b;
}

int main() {
    int N;
    cin >> N;
    ll ans = 1LL;

    rep(i, N) {
        ll T;
        cin >> T;
        ans = lcm(ans, T);
    }

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

Compiler output:
a.cc: In function 'll lcm(ll, ll)':
a.cc:22:12: error: 'a' was not declared in this scope
   22 |     return a / g * b;
      |            ^
a.cc:22:20: error: 'b' was not declared in this scope
   22 |     return a / g * b;
      |                    ^
Language: C++

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

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

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

int main() {
  int N;
  cin >> N;
  
  ll ans = 1ll;
  rep (i,N) {
    ll T;
    cin >> T;
    ans = lcm(ans, T);
  }
  
  cout << ans << endl;
  return 0;
}
    

Compiler output:
a.cc:6:14: error: 'llb' has not been declared
    6 | ll gcd(ll a, llb) {
      |              ^~~
a.cc: In function 'll gcd(ll, int)':
a.cc:7:7: error: 'b' was not declared in this scope
    7 |   if (b == 0) return a;
      |       ^
a.cc:8:14: error: 'b' was not declared in this scope
    8 |   return gcd(b, a%b);
      |              ^
a.cc: In function 'll lcm(ll, ll)':
a.cc:15:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   15 | int main() {
      |         ^~
a.cc:15:9: note: remove parentheses to default-initialize a variable
   15 | int main() {
      |         ^~
      |         --
a.cc:15:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:15:12: error: a function-definition is not allowed here before '{' token
   15 | int main() {
      |            ^
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:11:20: note: to match this '{'
   11 | ll lcm(ll a, ll b) {
      |                    ^
Language: C++

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

using namespace std;

typedef long long int ll;

ll lcm(ll a,ll b){

    ll ans = a * b / gcd(a, b);
    return ans;
}
ll gcd(ll a,ll b){
    if(b==0)
        return a;
    return gcd(b, a % b);
}

int main(){
    int N;
    cin >> N;
    ll T,ans=1LL;
    for (int i = 0; i < N;i++){
        cin >> T;
        ans = lcm(ans, T);
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'll lcm(ll, ll)':
a.cc:11:22: error: 'gcd' was not declared in this scope
   11 |     ll ans = a * b / gcd(a, b);
      |                      ^~~
Language: C++

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

using namespace std;

typedef long long int ll;

ll lcm(ll a,b){

    ll ans = a * b / gcd(a, b);
    return ans;
}
ll gcd(ll a,b){
    if(b==0)
        return a;
    return gcd(b, a % b);
}

int main(){
    int N;
    cin >> N;
    ll T,ans=1LL;
    for (int i = 0; i < N;i++){
        cin >> T;
        ans = lcm(ans, T);
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc:9:13: error: 'b' has not been declared
    9 | ll lcm(ll a,b){
      |             ^
a.cc: In function 'll lcm(ll, int)':
a.cc:11:18: error: 'b' was not declared in this scope
   11 |     ll ans = a * b / gcd(a, b);
      |                  ^
a.cc:11:22: error: 'gcd' was not declared in this scope
   11 |     ll ans = a * b / gcd(a, b);
      |                      ^~~
a.cc: At global scope:
a.cc:14:13: error: 'b' has not been declared
   14 | ll gcd(ll a,b){
      |             ^
a.cc: In function 'll gcd(ll, int)':
a.cc:15:8: error: 'b' was not declared in this scope
   15 |     if(b==0)
      |        ^
a.cc:17:16: error: 'b' was not declared in this scope
   17 |     return gcd(b, a % b);
      |                ^
Language: C++

#include <iostream>
using namespace std;
using ll = long long;
ll gcd(ll a,ll b){
  if(b == 0)
    return a;
  else
    return gcd(b,a % b);
}
ll lcm(ll a,ll b){
  ll g = gcd(a,b);
  return a / g * b;
}

int main(void){
  int N;
  cin >> N;
  
  ll ans = 1LL;
  
  for(int i=0;i<N;i++){
    ll t;
    cin >> t;
    ans = lcm(ans,t)
  }
  
  cout << ans << endl;
  
  return 0;
}

  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: expected ';' before '}' token
   24 |     ans = lcm(ans,t)
      |                     ^
      |                     ;
   25 |   }
      |   ~
Language: C++

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

int main(){
  long n,a,r,x;
  cin >> n;
  vector<long> vec(n);
  for(int i=0;i<n;i++){
    cin >> vc.at(i);
  }
  sort(vec.begin(), vec.end());
  a = vec.at(0);
  for(int i=0;i<n;i++){
    if(vec.at(i)%a == 0){
      a = vec.at(i);
    }
    else {
      x = vec.at(i)*a;
      r=vec.at(i)%a;
      while(r !=0){
        vec.at(i) = a;
        a = r;
        r = vec.at(i)%a;
      }
      a = x/a;
    }
  }
  
  cout << a << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'vc' was not declared in this scope; did you mean 'vec'?
    9 |     cin >> vc.at(i);
      |            ^~
      |            vec
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void){
  int N;
  cin >> N;
  
  vector<long>num(N,0);
  
  for(int i=0;i<N;i++){
    cin >> num[i];
  }
  
  sort(num.begin(),num.end());
  int p = 1;
  long num_max = num[N - 1]
  
  while(1){
    int ans = 0;
    num[N - 1] = num_max * p;
    for(int i=0;i<N-1;i++){
      if(num[N - 1] % num[i] == 0)
        ans++;
    }
    if(ans == N - 1)
        break;
  }
  
  cout << num[N - 1] << endl;
  
  return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: expected ',' or ';' before 'while'
   19 |   while(1){
      |   ^~~~~
Language: C++

#include<iostream>
#include<vector>
#define ll long long
using namespace std;
ll gcd(ll x,ll y)
{
    if(y%x==0) return x;
    else
        return gcd(y%x,x);
}
ll lcm(ll x, ll y)
{
    if(y%x==0) return y;
    return (x*y)/gcd(x,y);
}
int main()
{
    ll n,x;cin>>n;
    vector<ll>v;
    while(n--)
    {
        cin>>x;
        v.push_back(x);
    }
    sort(v.begin(),v.end());
    //for(int i=0;i<v.size();i++) cout<<v[i]<<" ";
    ll big = v[v.size()-1];
    ll small = v[0];
    //cout<<big<<" "<<small<<endl;
    ll ans = lcm(small,big);
    cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   25 |     sort(v.begin(),v.end());
      |     ^~~~
      |     short
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
ll mod=1000000007;
string s;

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

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

int main() {
  int n; cin >> n;
  ll out=1;
  for (int i=0;i<n;++i){
    ll t;
    cin>>t;
    out = lcm(out,t);
  }
  cout << out << endl;
  return 0;
}


Compiler output:
a.cc: In function 'll lcm(ll, ll)':
a.cc:14:15: error: 'gcd' cannot be used as a function
   14 |   ll gcd = gcd(a,b);
      |            ~~~^~~~~
Language: C++

#include <bits/stdc++.h>
#define INF (1<<30)
#define MOD 1000000007
#define l_ength size
using namespace std;

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

int main(){
	int n; cin >> n;
	vector<ll> t(n);
	for( auto &k : t ) cin >> k;
	for( int i = 1; i < n; ++i ){
		t[i] = lcm( t[i-1], t[i] );
	}
	cout << t[n-1] << endl;
	return 0;
}

Compiler output:
a.cc:7:1: error: 'll' does not name a type
    7 | ll lcm( ll x, ll y ){
      | ^~
a.cc: In function 'int main()':
a.cc:13:16: error: 'll' was not declared in this scope
   13 |         vector<ll> t(n);
      |                ^~
a.cc:13:18: error: template argument 1 is invalid
   13 |         vector<ll> t(n);
      |                  ^
a.cc:13:18: error: template argument 2 is invalid
a.cc:14:24: error: 'begin' was not declared in this scope
   14 |         for( auto &k : t ) cin >> k;
      |                        ^
a.cc:14:24: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:14:24: error: 'end' was not declared in this scope
   14 |         for( auto &k : t ) cin >> k;
      |                        ^
a.cc:14:24: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
a.cc:16:18: error: invalid types 'int[int]' for array subscript
   16 |                 t[i] = lcm( t[i-1], t[i] );
      |                  ^
a.cc:16:30: error: invalid types 'int[int]' for array subscript
   16 |                 t[i] = lcm( t[i-1], t[i] );
      |                              ^
a.cc:16:38: error: invalid types 'int[int]' for array subscript
   16 |                 t[i] = lcm( t[i-1], t[i] );
      |                                      ^
a.cc:18:18: error: invalid types 'int[int]' for array subscript
   18 |         cout << t[n-1] << endl;
      |                  ^
Language: C++

#include <iostream>
#include <vector>
#include <stdio.h>
#include <cmath>

using namespace std;

#include "utils.h"
#include "integer.h"

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

  uint64_t t;
  cin >> t;
  uint64_t res = t;

  rep(i, N-1) {
    uint64_t t;
    cin >> t;
    res = lcm (res, t);
  }

  printf("%ld\n", res);

  return 0;
}




Compiler output:
a.cc:8:10: fatal error: utils.h: No such file or directory
    8 | #include "utils.h"
      |          ^~~~~~~~~
compilation terminated.
Language: Java

/*
* @Author Silviase(@silviasetitech)
* For ProCon
*/

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

class Main{

    static int n;
    static long[] times;
    static int m;
    static long ans;
    static int[] rate;
    static int var;
    static int ansmin;
    static int ansmax;
    static int[] w;
    static int[] ww;
    static boolean[] visit;
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        n = sc.nextInt();
        ans = 1;
        times = new long[n];
        for (int i = 0; i < n; i++) {
            times[i] = sc.nextLong();
        }
        for (int i = 0; i < n; i++) {
            ans = lcd(ans , times[i]);
        }
        System.out.println(ans);

        sc.close();
    }

    public static long gcd(long a, long b) {
        
        if (a < b) {
            long tmpp = a;
            a = b;
            b = tmpp;
        }
        if (b == 0) {
            return a;
        }else{
            return gcd(b, a%b);
        }
    }

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

    public static void dfs(int placenow) {
        // if went all -> success! 
        // if not went all -> fail...
        
        /*
         dfs
         Go All Place that there is way to and not having been yet. 

         if island 1 is start point, dfs(1);
         if there is way to island 2 and island 3,
         - island 2 changes non-visited -> visited, and dfs(2).
         - island 3 changes non-visited -> visited, and dfs(3).
         

        */

        visit[placenow] = true;
        boolean success = true;
        for (int i = 0; i < n; i++) {
            if (visit[i] == false) { // not go all place
                success = false;
                break;
            }
        }
        if (success) {
            ans++;
            visit[placenow] = false;
            return;
        }

        for (int i = 0; i < m; i++) {
            if (w[i] == placenow && visit[ww[i]] == false ) {
                dfs(ww[i]);
            }else if(ww[i] == placenow && visit[w[i]] == false){
                dfs(w[i]);
            }else{
                continue;
            }
        }
        visit[placenow] = false;
        return;
    }

}



Compiler output:
Main.java:33: error: cannot find symbol
            ans = lcd(ans , times[i]);
                  ^
  symbol:   method lcd(long,long)
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
using ll=long long;
ll gcd(ll a,ll b){
 if(b == 0) return a;
 return gcd(b,a%b);
 }
int main() {
	int N;
	cin>>N;
	vector<int> vec(N);
	vector<int> sub(N);
	for(int i=0; i<N; i++){
		cin>>vec[i];
		sub[i]=vec[i];
	}
	//入力終わり
	

	//最小公倍数＝a*b/最大公約数
	for(int j=0; j<N-1; j++){
		int k=0;
		k=gcd(vec[j+1],sub[j])
		//最小公倍数
		sub[j+1]=vec[j+1]*sub[j]/k;
	}
	cout<<sub[j+1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:39: error: expected ';' before 'sub'
   24 |                 k=gcd(vec[j+1],sub[j])
      |                                       ^
      |                                       ;
   25 |                 //最小公倍数
   26 |                 sub[j+1]=vec[j+1]*sub[j]/k;
      |                 ~~~                    
a.cc:28:19: error: 'j' was not declared in this scope
   28 |         cout<<sub[j+1]<<endl;
      |                   ^
Language: C++

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
int main() {
	int N;
	cin>>N;
	vector<int> vec(N);
	vector<int> sub(N);
	for(int i=0; i<N; i++){
		cin>>vec[i];
		sub[i]=vec[i];
	}
	//入力終わり
	function gcd($a, $b) {
    if ($b === 0)
        return $a;

    return gcd($b, $a % $b);
	}
	//最小公倍数＝a*b/最大公約数
	for(int j=0; j<N-1; j++){
		int k=0;
		k=gcd(vec[j+1],sub[j])
		//最小公倍数
		sub[j+1]=vec[j+1]*sub[j]/k;
	}
	cout<<sub[j+1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: '$a' was not declared in this scope
   15 |         function gcd($a, $b) {
      |                      ^~
a.cc:15:26: error: '$b' was not declared in this scope
   15 |         function gcd($a, $b) {
      |                          ^~
a.cc:15:30: error: expected ',' or ';' before '{' token
   15 |         function gcd($a, $b) {
      |                              ^
a.cc:28:19: error: 'j' was not declared in this scope
   28 |         cout<<sub[j+1]<<endl;
      |                   ^
Language: C++

#include<iostream>
#include<cmath>
#include<numeric>
#include<string>
#include<algorithm>
#include<vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n;i++)
#define int64 long long
#define yokuwaruprime (10*10*10*10*10*10*10*10*10+7)
using namespace std;

int64 gcd(int64 a,int64 b){
  if(a<b){
   int64 tmp=a; a=b; b=tmp;
  }
  int64 r=a%b;
  while(r!=0){
    a=b;
    b=r;
    r=a%b;
  }
  return b;
}

int main(){
  int64 n;
  cin>>n;
  int64 t[n];
  rep(i,n){
    cin>>t[i];
  }
  int64 ans-t[0];
  rep(i,n){
    ans=ans*t[i]/gcd(ans,t[i]);
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:12: error: expected initializer before '-' token
   33 |   int64 ans-t[0];
      |            ^
a.cc:35:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   35 |     ans=ans*t[i]/gcd(ans,t[i]);
      |     ^~~
      |     abs
a.cc:37:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   37 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include "stdc++.h"
#define FOR(i,a,b) for(int i=(a); i<int(b); ++i)
#define RFOR(i,a,b) for(int i=(b)-1; i>=int(a); --i)
#define rep(i,n) FOR(i,0,n)
#define rep1(i,n) FOR(i,1,int(n)+1)
#define rrep(i, n) RFOR(i, 0, n)
#define rrep1(i, n) RFOR(i, 1, int(n) + 1)
#define all(c) begin(c), end(c)
#define al(d) d.begin(),d.end()
using namespace std;

template <typename T>
void putv(vector<T>& V){
	// cout << "The elements in the vector are: " << endl;
	for(auto x: V)
		cout << x << " ";
	cout << endl;
}
template <class T>
vector<T> getv(int n){
	vector<T> vec;
	rep(i,n){
		T input;
		cin >> input;
		vec.emplace_back(input);
	}
	return vec;
}

unsigned long long gcd(const unsigned long long a, const unsigned long long b);
unsigned long long lcm(const unsigned long long a, const unsigned long long b);
unsigned long long lcmv(vector<long long> vec);
int main(){
	int N;
	cin >> N;
	vector<long long> t = getv<long long>(N);
// putv(t);
	if(N==1) cout << t[0] << endl;
	else cout << lcmv(t) << endl;
}

unsigned long long gcd(const unsigned long long a, const unsigned long long b){
	return (b==0) ? a : gcd(b,a%b);
}
unsigned long long lcm(const unsigned long long a, const unsigned long long b){
	return a*(b/gcd(a,b));
}
unsigned long long lcmv(vector<long long> vec){
	int t = vec.size();
	if(t==2)
		return lcm(vec[0],vec[1]);
	long long v = vec[t-1];
	vec.pop_back();
	return lcm(lcmv(vec),v);
}

Compiler output:
a.cc:1:10: fatal error: stdc++.h: No such file or directory
    1 | #include "stdc++.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include "/Users/krzmknt/Dropbox/Workspace/C++/bits/template.h"
#include "/Users/krzmknt/Dropbox/Workspace/C++/graph/template.h"
unsigned long long gcd(const unsigned long long a, const unsigned long long b);
unsigned long long lcm(const unsigned long long a, const unsigned long long b);
unsigned long long lcmv(vector<long long> vec);
int main(){
	int N;
	cin >> N;
	vector<long long> t = getv<long long>(N);
// putv(t);
	if(N==1) cout << t[0] << endl;
	else cout << lcmv(t) << endl;
}

unsigned long long gcd(const unsigned long long a, const unsigned long long b){
	return (b==0) ? a : gcd(b,a%b);
}
unsigned long long lcm(const unsigned long long a, const unsigned long long b){
	return a*(b/gcd(a,b));
}
unsigned long long lcmv(vector<long long> vec){
	int t = vec.size();
	if(t==2)
		return lcm(vec[0],vec[1]);
	long long v = vec[t-1];
	vec.pop_back();
	return lcm(lcmv(vec),v);
}

Compiler output:
a.cc:1:10: fatal error: /Users/krzmknt/Dropbox/Workspace/C++/bits/template.h: No such file or directory
    1 | #include "/Users/krzmknt/Dropbox/Workspace/C++/bits/template.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

unsigned long long calcGCD(unsigned long long x, unsigned long long y)
{
    if (x < y)
    {
        x, y = y, x;
    }
    unsigned long long remainder = x % y;
    while (remainder != 0)
    {
        x = y;
        y = remainder;
        remainder = x % y;
    }
    return y;
}

unsigned unsigned long long calcMultiGCD(std::vector<unsigned long long> x)
{
    unsigned long long gcd = calcGCD(x[0], x[1]);
    for (unsigned long long i = 2; i < x.size(); i++)
    {
        gcd = calcGCD(gcd, x[i]);
    }
    return gcd;
}

unsigned long long calcLCM(unsigned long long x, unsigned long long y)
{
    return x * y / calcGCD(x, y);
}

unsigned long long calcMultiLCM(std::vector<unsigned long long> x)
{
    unsigned long long lcm = calcLCM(x[0], x[1]);
    for (unsigned long long i = 2; i < x.size(); i++)
    {
        lcm = calcLCM(lcm, x[i]);
    }
    return lcm;
}

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

    vector<unsigned long long> T(N);
    for (int i = 0; i < N; i++)
    {
        cin >> T[i];
    }

    cout << calcMultiLCM(T) << endl;
}


Compiler output:
a.cc:20:10: error: duplicate 'unsigned'
   20 | unsigned unsigned long long calcMultiGCD(std::vector<unsigned long long> x)
      |          ^~~~~~~~
      |          --------
Language: C++

#include <iostream>
using namespace std;
gcd(int i,int j){
	int M=max(i,j);
	int m=min(i,j);
	if(M%m!=0){
		return gcd(m,M%m);
	}else return m;
}
int main() {
	int n;
	cin>>n;
	int c[n];
	int g=c[0];
	for(int i=1;i<n;i++){
		g=gcd(g,c[i]);
	}
	int ans=g;
	for(int i=0;i<n;i++){
		ans*=(c[i]/g);
	}
	coutMMans;

	return 0;
}

Compiler output:
a.cc:3:1: error: ISO C++ forbids declaration of 'gcd' with no type [-fpermissive]
    3 | gcd(int i,int j){
      | ^~~
a.cc: In function 'int main()':
a.cc:22:9: error: 'coutMMans' was not declared in this scope
   22 |         coutMMans;
      |         ^~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

long long int gcd(long long int a, long long int b){
    if(a < b){
        swap(a, b)
    }
    while(a%b == 0){
        b = a%b;
        swap(a,b);
    }
    return a;
}

int main(){
    int n, i;
    long long int t, time = 1;
    cin >> n;
    for (i=0; i<n; i++){
        cin >> t;
        time *= t/gcd(time, t);
    }
    cout << time;
    return 0;
}

Compiler output:
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:6:19: error: expected ';' before '}' token
    6 |         swap(a, b)
      |                   ^
      |                   ;
    7 |     }
      |     ~
Language: C++

#include <iostream>
using namespace std;

long long int gcd(long long int a, long long int b){
    long long int tem, lcm;
    if(a > b){
        tem = a;
        a = b
        b = tem;
    }
    while(a!=b){
        tem = a;
        a = b;
        b = tem%b;
    }
    return a;
}

int main(){
    int n, i;
    long long int t, time = 1;
    cin >> n;
    for (i=0; i<n; i++){
        cin >> t
        time *= t/gcd(time, t)
    }
    cout << time;
    return 0;
}

Compiler output:
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:8:14: error: expected ';' before 'b'
    8 |         a = b
      |              ^
      |              ;
    9 |         b = tem;
      |         ~     
a.cc: In function 'int main()':
a.cc:24:17: error: expected ';' before 'time'
   24 |         cin >> t
      |                 ^
      |                 ;
   25 |         time *= t/gcd(time, t)
      |         ~~~~
Language: C++

#include <iostream>
using namespace std;

typedef long long int ll;

ll gcd(ll n,ll m){
  while(n!=m){
    if(n<m){
     swap(n,m);
    }
    else if(n>m){
      gcd(n,m)=gcd(n-m,m);
    }
    else{
      ll gcd(n,m)=n;
    }
  }
  return n;
}

ll lcm(ll n,ll m){
  return n*m/gcd(n,m);
}

int main(){
  int n;
  cin >> n;
  ll a[n];
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  ll ans=1;
  for(int i=0;i<n;i++){
    ans=lcm(ans,a[i]);
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'll gcd(ll, ll)':
a.cc:12:10: error: lvalue required as left operand of assignment
   12 |       gcd(n,m)=gcd(n-m,m);
      |       ~~~^~~~~
a.cc:15:17: error: expression list treated as compound expression in initializer [-fpermissive]
   15 |       ll gcd(n,m)=n;
      |                 ^
a.cc:15:18: error: expected ',' or ';' before '=' token
   15 |       ll gcd(n,m)=n;
      |                  ^
Language: C++

#include <iostream>
using namespace std;

typedef long long int ll;

ll gcd(ll n,ll m){
  while(n!=m){
    if(n<m){
     swap(n,m);
    }
    else if(n>m){
      gcd(n,m)=gcd(n-m,m);
    }
    else{
      gcd(n,m)=n;
    }
  }
  return n;
}

ll lcm(ll n,ll m){
  return n*m/gcd(n,m);
}

int main(){
  int n;
  cin >> n;
  ll a[n];
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  ll ans=1;
  for(int i=0;i<n;i++){
    ans=lcm(ans,a[i]);
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'll gcd(ll, ll)':
a.cc:12:10: error: lvalue required as left operand of assignment
   12 |       gcd(n,m)=gcd(n-m,m);
      |       ~~~^~~~~
a.cc:15:10: error: lvalue required as left operand of assignment
   15 |       gcd(n,m)=n;
      |       ~~~^~~~~
Language: C++

#include <iostream>
using namespace std;

typedef long long int ll;

ll gcd(ll n,ll m){
  while(n!=m){
    if(n<m){
     swap(n,m);
    }
    else {
      gcd(n,m)=gcd(n-m,m);
    }
  }
  return n;
}

ll lcm(ll n,ll m){
  return n*m/gcd(n,m);
}

int main(){
  int n;
  cin >> n;
  ll a[n];
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  ll ans=1;
  for(int i=0;i<n;i++){
    ans=lcm(ans,a[i]);
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'll gcd(ll, ll)':
a.cc:12:10: error: lvalue required as left operand of assignment
   12 |       gcd(n,m)=gcd(n-m,m);
      |       ~~~^~~~~
Language: C++

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



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

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

int main(){
  int n;
  cin >> n;
  int p[110];
  for (int i = 0; i < n; ++i){
        cin >> p[i];
   }
  
  
  sort(p, p + n, greater<int>()); 
  int gr = a[0];
    
    for (int i = 0; i < n; ++i){
    if (p[i] % p[i + 1] == 0 ){
      gr = gr;
    }
    else{
      gr = lcm(p[i],p[i+1]);
    }


    }
     cout << gr << endl;
    
  }
 

Compiler output:
a.cc: In function 'int main()':
a.cc:26:12: error: 'a' was not declared in this scope
   26 |   int gr = a[0];
      |            ^
Language: C++



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



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

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

int main(){
  int n;
  cin >> n;
  int a[110];
  for (int i = 0; i < n; ++i){
        cin >> a[i];
   }
  
  
  sort(a, a + n, greater<int>()); 
  int gr = a[0];
    
    for (int i = 0; i < n; ++i){
    if (a[i] % a[i + 1] == 0 ){
      gr = gr;
    }
    else{
      gr = lcm(a[i],a[i+1]);
    }


    }
     cout << gr << endl;
    
  }
 

Compiler output:
a.cc:3:9: error: expected unqualified-id before 'return'
    3 |         return m;
      |         ^~~~~~
Language: C++

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

int ggd(int number1,int number2){
	int m = number1;
	int n = number2;

	if(number2 > number1){
		m = number2;
		n = number1;
	}

	while(m != n){
		int temp = n;
		n = m - n;
		m = temp;
	}

	return m;
}

int lcm(int number1,int number2){
	return number1 * number2 / ggd(number1,number2);	
}
 
int main(){
  int n;
  cin >> n;
  int a[110];
  for (int i = 0; i < n; ++i){
        cin >> a[i];
   }
  
  
  sort(a, a + n, greater<int>()); 
  int gr = a[0];
    
    if (a[i] % a[i + 1] == 0 ){
      gr = gr;
    }
    else{
      gr = lcm(a[i],a[i+1]);
    }


    }
     cout << gr << endl;
    
  }
 

Compiler output:
a.cc: In function 'int main()':
a.cc:38:11: error: 'i' was not declared in this scope
   38 |     if (a[i] % a[i + 1] == 0 ){
      |           ^
a.cc: At global scope:
a.cc:47:6: error: 'cout' does not name a type
   47 |      cout << gr << endl;
      |      ^~~~
a.cc:49:3: error: expected declaration before '}' token
   49 |   }
      |   ^
Language: C++

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

int ggd(int number1,int number2){
	int m = number1;
	int n = number2;

	if(number2 > number1){
		m = number2;
		n = number1;
	}

	while(m != n){
		int temp = n;
		n = m - n;
		m = temp;
	}

	return m;
}

int lcm(int number1,int number2){
	return number1 * number2 / ggd(number1,number2);	
}
 
int main(){
  int n;
  cin >> n;
  int a[110];
  for (int i = 0; i < n; ++i){
        cin >> a[i];
   }
  
  int gr = a[i];
  sort(a, a + n, greater<int>());

  for (int i = 0; i < n; ++i){
    
    if (a[i] % a[i + 1] == 0 ){
      gr = gr;
    }
    else{
      gr = lcm(a[i],a[i+1]);
    }


    }
     cout << gr << endl;
    
  }
 

Compiler output:
a.cc: In function 'int main()':
a.cc:34:14: error: 'i' was not declared in this scope
   34 |   int gr = a[i];
      |              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int n;
  cin >> n;
  int a[110];
  for (int i = 0; i < n; ++i){
        cin >> a[i];
   }
  
  int gr, r;
  sort(a, a + n, greater<int>());

  for (int i = 0; i < n; ++i){
    
    if (a[i] % a[i + 1] == 0 ){
      gr = a[i];
    else{
      int x = a[i]*a[i+1];
      r = a[i] % a[i + 1];
      while( r != 0){
        a[i] = a[i+1];
        a[i+1] = r;
        r = a[i] % a[i+1];
      }
      gr = x/a[i+1];
    }


    }

    
  }
 cout << gr << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: expected '}' before 'else'
   19 |     else{
      |     ^~~~
a.cc:17:31: note: to match this '{'
   17 |     if (a[i] % a[i + 1] == 0 ){
      |                               ^
a.cc: At global scope:
a.cc:35:2: error: 'cout' does not name a type
   35 |  cout << gr << endl;
      |  ^~~~
a.cc:37:1: error: expected declaration before '}' token
   37 | }
      | ^
Language: C++

import math

def lcm(a, b):
    return a * b / math.gcd(a, b)

n = int(input())

list = [int(input()) for i in range(n)]

if n == 1:
    print(list[0])
    exit(1)

num = list[0]
for i in range(1, n):
    if (num % list[i] == 0):
        continue
    elif (list[i] % num == 0):
        num = list[i]
        continue
    else:
        num = lcm(num, list[i])

print(int(num))


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

#include <iostream>
#include <algorithm>
typedef long long ll;
using namespace std;

ll gcd(ll x, ll y){
  return x ? gcd(y%x,x) : y;
}

ll lcm(ll x,ll y){
  return x/gcd(x,y)*y;
}
int main(){
  int n,i;
  cin >> n;
  ll ret=1,t;
  for(i=0;i<n;i++){
    cin >> t;
    ret = lcm(ret,t);
  }
  cout << ret << endl;
  return 0;
}


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

#include <iostream>
#include <algorithm>
using namespace std;
typedef ll long long
ll gcd(ll x, ll y){
  return x ? gcd(y%x,x) : y;
}

ll lcm(ll x,ll y){
  x = max(x,y);
  y = min(x,y);
  return x/gcd(x,y)*y;
}
int main(){
  int n,i;
  cin >> n;
  ll ret=1,t;
  for(i=0;i<n;i++){
    cin >> t;
    ret = lcm(ret,t);
  }
  cout << ret << endl;
  return 0;
}


Compiler output:
a.cc:4:9: error: 'll' does not name a type
    4 | typedef ll long long
      |         ^~
a.cc:9:1: error: 'll' does not name a type
    9 | ll lcm(ll x,ll y){
      | ^~
a.cc: In function 'int main()':
a.cc:17:3: error: 'll' was not declared in this scope
   17 |   ll ret=1,t;
      |   ^~
a.cc:19:12: error: 't' was not declared in this scope
   19 |     cin >> t;
      |            ^
a.cc:20:5: error: 'ret' was not declared in this scope
   20 |     ret = lcm(ret,t);
      |     ^~~
a.cc:20:11: error: 'lcm' was not declared in this scope
   20 |     ret = lcm(ret,t);
      |           ^~~
a.cc:22:11: error: 'ret' was not declared in this scope
   22 |   cout << ret << endl;
      |           ^~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
#typedef ll long long
ll gcd(ll x, ll y){
  return x ? gcd(y%x,x) : y;
}

ll lcm(ll x,ll y){
  x = max(x,y);
  y = min(x,y);
  return x/gcd(x,y)*y;
}
int main(){
  int n,i;
  cin >> n;
  ll ret=1,t;
  for(i=0;i<n;i++){
    cin >> t;
    ret = lcm(ret,t);
  }
  cout << ret << endl;
  return 0;
}

Compiler output:
a.cc:4:2: error: invalid preprocessing directive #typedef
    4 | #typedef ll long long
      |  ^~~~~~~
a.cc:5:1: error: 'll' does not name a type
    5 | ll gcd(ll x, ll y){
      | ^~
a.cc:9:1: error: 'll' does not name a type
    9 | ll lcm(ll x,ll y){
      | ^~
a.cc: In function 'int main()':
a.cc:17:3: error: 'll' was not declared in this scope
   17 |   ll ret=1,t;
      |   ^~
a.cc:19:12: error: 't' was not declared in this scope
   19 |     cin >> t;
      |            ^
a.cc:20:5: error: 'ret' was not declared in this scope
   20 |     ret = lcm(ret,t);
      |     ^~~
a.cc:20:11: error: 'lcm' was not declared in this scope
   20 |     ret = lcm(ret,t);
      |           ^~~
a.cc:22:11: error: 'ret' was not declared in this scope
   22 |   cout << ret << endl;
      |           ^~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int sashoba (int a, int b) {
  int res = 1;
  for (int i = 1; i <= min(a, b); i ++) {
    if (a % i == 0 && b % i == 0) res = i;
  }
  int ans = (a * b) / res;
  return ans;
}
int main () {
  int N;
  cin >> N;
  vector<int>a(N);
  for(int i = 0; i < N; i ++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  int ans = a[N];
  for (i = N - 2; i >= 0; i --) {
    if (ans % a[i] != 0) ans = sashoba(ans, a[i]);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |   sort(a.begin(), a.end());
      |   ^~~~
      |   short
a.cc:21:8: error: 'i' was not declared in this scope
   21 |   for (i = N - 2; i >= 0; i --) {
      |        ^
Language: C++

#include <iostream>
#include <numeric>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <math.h>
#include <cmath>
#include <set>   
#include <bitset>
#include <boost/math/common_factor_rt.hpp>

#define ll long long
using namespace std;
ll t[105] = {};
int main()
{
	ll n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> t[i];
	}
	ll ans = t[0];

	for (int i = 1; i < n; i++)
	{
		ans = lcm(ans, t[i]);
	}

	cout << ans << endl;
}

int dsum(ll a) {
	int ans = 0;
	while (a != 0) {
		ans += a % 10;
		a /= 10;
	}
	return ans;
}


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

import java.util.Arrays;
import java.util.Scanner;

class Main{


	public static void main(String[] args) {
		

		Scanner sc = new Scanner(System.in);			//文字の入力
		int n = sc.nextInt();
		long[] T = new long[n];

		long x=1L;
		for(int i = 0;i < n;i++){
			T[i]  = sc.nextLong();
		}
		Arrays.sort(T);

		for(int i = 0;i < n-1;i++){
			x = lcm(T[i], T[i+1]);
		}



		System.out.println(ans);

	}

	static long lcm (long a, long b) {
		
		if(a*b < Math.max(a, b)){
			return Math.max(a, b);
		}
		long temp = 1L;
		long c = (long)a;
		c *= (long)b;
		while((temp = a%b)!=0) {
			a = (long)b;
			b = (long)temp;
		}
		return (long)(c/b);
	}

}

Compiler output:
Main.java:26: error: cannot find symbol
		System.out.println(ans);
		                   ^
  symbol:   variable ans
  location: class Main
1 error
Language: C

#include <stdio.h>
 
int main() {
	int n,i;
	lonf long int p,q,tmp,r;
	long long int t[101];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d\n",&t[i]);
	}
	p=t[0];
	for(i=0;i<n;i++){
		q = p * t[i];
		if(p<t[i]){
    		tmp = p;
			p = t[i];
    		t[i] = tmp;
		}
		r = p % t[i];
		while(r!=0){
    		p = t[i];
    		t[i] = r;
    		r = p % t[i];
		}
		p=q/t[i];
	}
	printf("%d",p);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: 'lonf' undeclared (first use in this function)
    5 |         lonf long int p,q,tmp,r;
      |         ^~~~
main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:13: error: expected ';' before 'long'
    5 |         lonf long int p,q,tmp,r;
      |             ^~~~~
      |             ;
main.c:11:9: error: 'p' undeclared (first use in this function)
   11 |         p=t[0];
      |         ^
main.c:13:17: error: 'q' undeclared (first use in this function)
   13 |                 q = p * t[i];
      |                 ^
main.c:15:17: error: 'tmp' undeclared (first use in this function)
   15 |                 tmp = p;
      |                 ^~~
main.c:19:17: error: 'r' undeclared (first use in this function)
   19 |                 r = p % t[i];
      |                 ^
Language: C

#include <stdio.h>

int main() {
	int n,i,x,y,tmp,r;
	int t[101];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d\n",&t[i]);
	}
	x=t[0];
	for(i=1;i<n;i++){
		y=x;
		if(t[i]<y){
    		tmp=t[i];
    		t[i]=y;
    		y=tmp;
		}
		r=t[i]%y;
		while(r!=0){
    		t[i]=y;
    		y=r;
    		r=t[i]%y;
		}
		x=x/y;
	}
	printf("%d",x)
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:26:23: error: expected ';' before 'return'
   26 |         printf("%d",x)
      |                       ^
      |                       ;
   27 |         return 0;
      |         ~~~~~~
Language: C++

# coding: utf-8

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

n = int(input())
t = []
for i in range(0, n):
    t.append(int(input()))
ans = 1
for i in range(0, n):
    ans = ans * t[i] / gcd(ans, t[i])

print("{}".format(ans))


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:3:1: error: 'def' does not name a type
    3 | def gcd (a, b):
      | ^~~
Language: C++

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


gcd(long long x,long long y){
  long long c=max(x,y),d=min(x,y);
  if(d==0)return c;
  return gcd(d,c%d);
}

long long b(long long p,long long q){
  return p/gcd(p,q)*q;
}

int main(){
  int N;
  cin >> N;
  vector<long long> t(100);
  for(int i=0;i<N;i++){
    cin >> t[i];
  }
  long long current = t[0];
  for(int i=1;i<N;i++){
    current = b(current,t[i]);
  }
  cout << current <<endl;
  return 0;
}

Compiler output:
a.cc:5:1: error: ISO C++ forbids declaration of 'gcd' with no type [-fpermissive]
    5 | gcd(long long x,long long y){
      | ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
template <typename _Ty>
ostream &operator<<(ostream &ostr, const vector<_Ty> &v)
{
  if (v.empty())
  {
    ostr << "{ }";
    return ostr;
  }
  ostr << "{" << v.front();
  for (auto itr = ++v.begin(); itr != v.end(); itr++)
  {
    ostr << ", " << *itr;
  }
  ostr << "}";
  return ostr;
  }

int N;
vector<int> t(100);

int b(int p,int q){
  int a(int x,int y){
    int a=max(x,y),b=min(x,y);
    if(b==0)return a;
    return a(b,a%b)
  }
  return p*q/a(p,q)
}

int main(){
  cin >> N;
  for(int i=0;i<N;i++){
    cin >> t[i];
  }
  int current = t[0];
  for(int i=1;i<N;i++){
    current = b(current,t[i]);
  }
  cout << current <<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int b(int, int)':
a.cc:24:21: error: a function-definition is not allowed here before '{' token
   24 |   int a(int x,int y){
      |                     ^
a.cc:29:14: error: 'a' was not declared in this scope
   29 |   return p*q/a(p,q)
      |              ^
a.cc:29:20: error: expected ';' before '}' token
   29 |   return p*q/a(p,q)
      |                    ^
      |                    ;
   30 | }
      | ~
Language: C

#include<iostream>
using namespace std;
long long gcd(long long a, long long b)
{
    return b==0?a:gcd(b,a%b);
}
int main()
{
    int t;
    long long a,s=1;
    cin >> t;
    while(t--){
        cin>>a;
        s=s/gcd(s,a)*a;
    }
    cout<<s<<endl;
    return 0;
}

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

#include <bits/stdc++.h>

namespace IntegerMath
{
  int64_t sqrt(int64_t x) {
    return static_cast<int64_t>(
      ::floorl( ::sqrtl( 
        static_cast<long double>(x)
      ) )
    );
  }

  int64_t log2(int64_t x) {
    return static_cast<int64_t>(
      ::floorl( ::log2l( 
        static_cast<long double>(x)
      ) )
    );
  }    

  int64_t log10(int64_t x) {
    return static_cast<int64_t>(
      ::floorl( ::log10l( 
        static_cast<long double>(x)
      ) )
    );
  }

  uint64_t gcd(uint64_t a, uint64_t b)
  {
    uint64_t n = std::min(a, b), m = std::max(a, b);
    return (n == 0) ? m : gcd(m % n, n);
  }

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

int main()
{
  uint64_t N;
  std::cin >> N;
  
  uint64_t T;
  std::cin >> T;
  
  for (uint64_t n = 1; n < N; ++n) {
    uint64_t t;
    std::cin >> t;
    
    T = IntegerMath::lcm(t, T);
  }
  
  std::cout << t << std::endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:16: error: 't' was not declared in this scope
   56 |   std::cout << t << std::endl;
      |                ^