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

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
typedef long double ld;
ll GCD(ll a,ll b){
    if(b==0) return a;
    return GCD(b,a%b);
}
int main() {
    int n;
    cin>>n;
    vector<ll> a(n);
    ll lcm,gcd;
    rep(i,n){
        cin>>a[i];
        if(i==0) r=a[i],lcm=a[i];
        else{
            gcd=GCD(lcm,a[i]);
            lcm=(lcm/gcd)*a[i];
        }
    }
    cout<<lcm;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: 'r' was not declared in this scope
   21 |         if(i==0) r=a[i],lcm=a[i];
      |                  ^
Language: C++

#include <iostream>
using namespace std;

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:24:3: error: 'll' was not declared in this scope
   24 |   ll ans = 1;
      |   ^~
a.cc:26:7: error: expected ';' before 'num'
   26 |     ll num;
      |       ^~~~
      |       ;
a.cc:27:12: error: 'num' was not declared in this scope; did you mean 'enum'?
   27 |     cin >> num;
      |            ^~~
      |            enum
a.cc:28:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |     ans = lcm(ans, num);
      |     ^~~
      |     abs
a.cc:30:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   30 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ll; 
int n;
ll a[n];
ll findGCD(ll a, ll b){
    if(b==0)
          return a;
    return findGCD(b,a%b);
}

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

Compiler output:
a.cc:5:6: error: size of array 'a' is not an integral constant-expression
    5 | ll a[n];
      |      ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
using ull = unsigned long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

template<class T>
bool ChangeMax(T&a,const T&b){
  if(a >= b) return false;
  a = b;    return true;
}

template<class T>
bool ChangeMin(T&a,const T&b){
  if(a <= b) return false;
  a = b;    return true;  
}

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

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


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

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


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

// C++ program to find LCM of two numbers  
#include <iostream>
#include <vector>
#include <numeric>

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPONE(i, n) for(int i = 1; i < n; i++)
#define ld long double
#define ll long long

using namespace std; 

// Driver program to test above function  
int main()  
{  
    int n; cin >> n;
    vector<ll> time;
    ll t;
    REP(i, n) {
        cin >> t;
        time.push_back(t);
    }

    ll ans = time[0];
    ld tmp;

    REPONE(i, n) {
        tmp = ((ld)ans * (ld)time[i]) 
        ans = tmp/ gcd((ll)ans, (ll)time[i]);
        // ans = lcm(ans, time[i]);
    }

    cout << (ll)ans << endl;

    return 0;  
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:28:38: error: expected ';' before 'ans'
   28 |         tmp = ((ld)ans * (ld)time[i])
      |                                      ^
      |                                      ;
   29 |         ans = tmp/ gcd((ll)ans, (ll)time[i]);
      |         ~~~
Language: C++

// C++ program to find LCM of two numbers  
#include <iostream>
#include <vector>
#include <numeric>

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPONE(i, n) for(int i = 1; i < n; i++)
#define ld long double
#define ll long long

using namespace std; 

// Driver program to test above function  
int main()  
{  
    int n; cin >> n;
    vector<ll> time;
    ll t;
    REP(i, n) {
        cin >> t;
        time.push_back(t);
    }

    ll ans = time[0];

    REPONE(i, n) {
        tmp = ((ld)ans * (ld)time[i]) 
        ans = tmp/ gcd((ll)ans, (ll)time[i]);
        // ans = lcm(ans, time[i]);
    }

    cout << (ll)ans << endl;

    return 0;  
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   27 |         tmp = ((ld)ans * (ld)time[i])
      |         ^~~
      |         tm
Language: Java

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
	
	public class Main {
	
		public static void main(String[] args) {
			execute18_1();
		}
		
		private static void execute18_1() {
			try 
			(Scanner sc = new Scanner(System.in)) {
				int n = sc.nextInt();
				long[] t= new long[n];
				
				for(int i=0;i<n;i++) {
					t[i] = sc.nextLong();
				}
				
				long ans=t[0];
				
				for(int i=1;i<n;i++) {
					ans=lcm2(ans, t[i]);
				}
				
			System.out.println(ans);
			}
		}
		
		private static long gcd2(long a, long b) {
	        if (b == 0) return a;
	        return gcd(b, a % b);
	    }
		
		private static long lcm2(long m, long n) {
	        return m / gcd2(m, n) * n;
	    }
    }

Compiler output:
Main.java:42: error: cannot find symbol
	        return gcd(b, a % b);
	               ^
  symbol:   method gcd(long,long)
  location: class Main
1 error
Language: Java

public class Main {
	
		public static void main(String[] args) {
			execute18_1();
		}
		
		private static void execute18_1() {
			try 
			(Scanner sc = new Scanner(System.in)) {
				int n = sc.nextInt();
				long[] t= new long[n];
				
				for(int i=0;i<n;i++) {
					t[i] = sc.nextLong();
				}
				
				long ans=t[0];
				
				for(int i=1;i<n;i++) {
					ans=k(ans, t[i]);
				}
				
			System.out.println(ans);
			}
		}
		
		private static long k(long x, long y) {
			long min = Math.min(x, y);
	        long max =Math.max(x, y);
	        if(max%y==0) return max;
	        long temp;
	        while ((temp = max % min) != 0) {
	            min = max;
	            max = temp;
	        }
	        return x*y/min;
		}
}

Compiler output:
Main.java:9: error: cannot find symbol
			(Scanner sc = new Scanner(System.in)) {
			 ^
  symbol:   class Scanner
  location: class Main
Main.java:9: error: cannot find symbol
			(Scanner sc = new Scanner(System.in)) {
			                  ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++


            ll lcm=v[0];
            fo1(i,n-1)
            {

                lcm/=(__gcd(lcm,v[i]));
                lcm*=v[i];
            }
            cout<<lcm;
//         if(vfun())
//            cout<<"YES\n";
//         else
//            cout<<"NO\n";
    }
}
///before sub
/// check for value of zero and single input in array
///loop vars,1LL in mult, equal, one, bounds, int v ll, endl, finish taking inputs
/// check whether test cases are given or not





Compiler output:
a.cc:2:13: error: 'll' does not name a type
    2 |             ll lcm=v[0];
      |             ^~
a.cc:3:16: error: expected constructor, destructor, or type conversion before '(' token
    3 |             fo1(i,n-1)
      |                ^
a.cc:9:13: error: 'cout' does not name a type
    9 |             cout<<lcm;
      |             ^~~~
a.cc:14:5: error: expected declaration before '}' token
   14 |     }
      |     ^
a.cc:15:1: error: expected declaration before '}' token
   15 | }
      | ^
Language: C++

def gcd(a, b):
    if(a == 0):
        return b
    return gcd(b % a, a)
def lcm(a, b):
    return a/ gcd(a, b) * b 
t = int(input())
ans = 1
while(t != 0):
    t -= 1
    n = int(input())
    ans = lcm(ans, n)
print(int(ans))


Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def gcd(a, b):
      | ^~~
Language: C++

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
n = (input())
res = (input())
while n > 1:
	x = (input())
	res = (res * x) // gcd(res, x);
	n -= 1
print(res)

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def gcd(a, b):
      | ^~~
Language: C++

import math

n = int(input())
t = []
for i in range(n):
    p = int(input())
    t.append(p)

ans = t[0]

for i in range(1,n):
    ans = (ans*t[i]) // math.gcd(ans,t[i])

print(ans)

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++

import math
N = int(input())
T = [int(input()) for _ in range(N)]

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

ans = 1

for i in range(N):
    ans = lcm(ans,T[i])

print(ans)

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++

//要はT[i]の最小公倍数lcmの求め方。
#include<bits/stdc++.h>
using namespace std;

int main(){
 int N,T;
 int T[100];
 cin >> N >> T;
 
 for(int i=0;i<N:i++){
   cin >>T[i];
 }
 
  
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: conflicting declaration 'int T [100]'
    7 |  int T[100];
      |      ^
a.cc:6:8: note: previous declaration as 'int T'
    6 |  int N,T;
      |        ^
a.cc:10:14: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   10 |  for(int i=0;i<N:i++){
      |              ^
a.cc:10:17: error: found ':' in nested-name-specifier, expected '::'
   10 |  for(int i=0;i<N:i++){
      |                 ^
      |                 ::
a.cc:10:16: error: 'N' is not a class, namespace, or enumeration
   10 |  for(int i=0;i<N:i++){
      |                ^
a.cc:15:1: error: expected primary-expression before 'return'
   15 | return 0;
      | ^~~~~~
a.cc:12:3: error: expected ';' before 'return'
   12 |  }
      |   ^
      |   ;
......
   15 | return 0;
      | ~~~~~~
a.cc:15:1: error: expected primary-expression before 'return'
   15 | return 0;
      | ^~~~~~
a.cc:12:3: error: expected ')' before 'return'
   12 |  }
      |   ^
      |   )
......
   15 | return 0;
      | ~~~~~~
a.cc:10:5: note: to match this '('
   10 |  for(int i=0;i<N:i++){
      |     ^
Language: C++

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

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

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

ll main(){
    ll n;
    cin>>n;
    vector<ll>t(n);
    rep(i,n)cin>>t[i];
    sort(t.begin(),t.end());
    ll ans=1;
    rep(i,n){
       ans=lcm(ans,t[i]);
        
    }
    cout<<ans<<endl;

}

Compiler output:
a.cc:15:1: error: '::main' must return 'int'
   15 | ll main(){
      | ^~
Language: C++

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

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

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

int main()
{
        ll N;
        cin >> N;
        vector<ll> T(N, 0);
        for (int i = 0; i < N; ++i) {
                cin >> T[i];
        }

        ll ans = 0;
        for (int i = 0; i < N; ++i) {
                asn = lcm(ans, T[i]);
        }
        cout << ans << endl;

}


Compiler output:
a.cc: In function 'll lcm(ll, ll)':
a.cc:14:9: error: 'reurn' was not declared in this scope
   14 |         reurn a / gcd(a, b) * b;
      |         ^~~~~
a.cc:15:1: warning: no return statement in function returning non-void [-Wreturn-type]
   15 | }
      | ^
a.cc: In function 'int main()':
a.cc:28:17: error: 'asn' was not declared in this scope; did you mean 'ans'?
   28 |                 asn = lcm(ans, T[i]);
      |                 ^~~
      |                 ans
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = (l); i < (r); i++)
#define ALL(x) (x).begin(), (x).end()     //昇順
#define RALL(x) (x).rbegin(), (x).rend()  // 降順
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
const long long mod = 1e9 + 7;
typedef long long ll;
typedef priority_queue<int> PQ;
typedef vector<long long> VL;
typedef vector<bool> VB;
typedef vector<int> VI;  // VI a(n);
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<VS> VSS;
typedef vector<VC> VCC;
typedef vector<VI> VII;  // VII a(n,VI(m)) n * m
typedef vector<VL> VLL;
typedef pair<int, int> PII;
typedef map<int, int> MP;  // MP a;
typedef vector<pair<ll, ll>> PS;

template <class T, class U>
bool chmax(T &a, U b) {
  if (a <= b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T, class U>
bool chmin(T &a, U b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); }
  os << "}";
  return os;
}

// g++ -std=c++11 prac.cpp
// operator << (cout,a);
// chmin(min,a)
    
template<typename T>
T gcd(T a, T b){
	return b != 0 ? gcd(b, a % b) : a;
}    

template<typename T>
T lcm(T a, T b){
    return a/gcd(a,b)*b;
}    


int main() {
  ll n,k,m,x=0, y=0 , z = 0, h,w, ans=0,sum = 1, Max = -1, Min = 3e9+1;
  string u;
  bool ok=true;
  cin >> n;
  VL a(n); rep(i,n) cin >> a[i];
  sort(ALL(a));
  if(n==1){
    pri(a[i]);
    return 0;
  }
  else{
    x = lcm(a[0],a[1]);
    for(int i=2; i<n; i++){
      x = lcm(a[i],x);
    }
    pri(x);
    return 0;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:11: error: 'i' was not declared in this scope
   74 |     pri(a[i]);
      |           ^
a.cc:7:25: note: in definition of macro 'pri'
    7 | #define pri(x) cout << (x) << "\n"
      |                         ^
Language: C

#include<stdio.h>

int main()
{
  int i,j,N,max;
  max = 0;
  scanf("%d",&N);
  long long T[N]:
  long long ans=0;
  for(i=0;i<N;i++){
    scanf("%ld",&T[i]);
  }
  for(i=1;i<N;i++){
    if(T[max]<T[i]){
      max = i;
    }
  }
  i=1;
 while(i>0){
    for(j=0;j<N;j++){
      if((T[max]*(i))%T[j]!=0){
        break;
      }else{
        ans = (T[max]*(i));
        printf("%ld",ans);
        return 0;
       }
	 }
      i++;         
	}
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
    8 |   long long T[N]:
      |                 ^
main.c:8:17: error: expected expression before ':' token
main.c:11:18: error: 'T' undeclared (first use in this function)
   11 |     scanf("%ld",&T[i]);
      |                  ^
main.c:11:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:24:9: error: 'ans' undeclared (first use in this function)
   24 |         ans = (T[max]*(i));
      |         ^~~
Language: C++

#include<bits/stdc++.h>
#define ll long long 
#define P pair<ll ,ll>
using namespace std;

ll gcd(ll a,ll b){
    if(a<b)return gcd(b,a);
    if(a%b==0)return b;
    return gcd(b ,a%b);
}
int main(){
    ll n;cin >> n;
    vector<ll>t(n);
    for(int i=0;i<n;i++) cin >> t[i];

    ll lcm = t[0];
    for(int i=1;i<n;i++) lcm = a[i]*lcm/gcd(a[i] ,lcm);
    cout << lcm << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:32: error: 'a' was not declared in this scope
   17 |     for(int i=1;i<n;i++) lcm = a[i]*lcm/gcd(a[i] ,lcm);
      |                                ^
Language: C++

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

using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)


int main()
{
    lint n;cin >> n;
    lint ans=1;
    REP(i,n){
        lint t;
        cin >> t;
        ans =__detail::__lcm(ans, t);
    }
    cout << ans << "\n";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:24: error: '__lcm' is not a member of 'std::__detail'
   23 |         ans =__detail::__lcm(ans, t);
      |                        ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
//min(x,y)が0以下の場合はmax(x,y)が返される
//ユークリッドの互除法を元に実装
ll gcd(ll x,ll y){
    if(x<y) swap(x,y);
    //xの方が常に大きい
    ll r;
    while(y>0){
        r=x%y;
        x=y;
        y=r;
    }
    return x;
}

//オーバフローしないようにかける順番を気を付ける
ll lcm(ll x,ll y){
    return ll(x/gcd(x,y))*y;
}
int main(){
  int N;
  cin>>N;
  long long T[N],ans=1;
  for(int i=0;i<N;i++){
    cin>>T[i];
    ans=gcd(ans,T[i]);
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc:5:1: error: 'll' does not name a type
    5 | ll gcd(ll x,ll y){
      | ^~
a.cc:18:1: error: 'll' does not name a type
   18 | ll lcm(ll x,ll y){
      | ^~
Language: C++

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:20:20: error: expected primary-expression before 'unsigned'
   20 |     ans = lcm(ans, unsigned long long(T));
      |                    ^~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main (void) {
    int N;
    cin >> N;
    vector<long long> T(N);
    for ( int i=0; i<N; i++ ) {
        cin >> T.at(i);
    }

    sort(T.begin(), T.end(), greater<long long>());

    bool ans_not_found = true;
    long long ans = T.at(0);
    while ( ans_not_found ) {
        ans_not_found = false;
        for ( int i=1; i<N; i++ ) {
            if ( ans % T.at(i) != 0 ) {
                ans_not_found = true;
                ans += T.as(0);
                break;
            }
        }
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:26: error: 'class std::vector<long long int>' has no member named 'as'; did you mean 'at'?
   22 |                 ans += T.as(0);
      |                          ^~
      |                          at
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;

void solve() {
	int n;
	cin >> n;
	__int128 ans = 1;
	for (int i = 0; i < n; i++) {
		ll t;
		cin >> t;
		ans = (t * ans) / __gcd(t, ans);
	}
	ll x = ans;
	cout << x;
}

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
	int T = 1; 
    //cin >> T;
    while(T--) solve();
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:13:40: error: no matching function for call to '__gcd(ll&, __int128&)'
   13 |                 ans = (t * ans) / __gcd(t, ans);
      |                                   ~~~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: candidate: 'template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:1137:5: note:   template argument deduction/substitution failed:
a.cc:13:40: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('long long int' and '__int128')
   13 |                 ans = (t * ans) / __gcd(t, ans);
      |                                   ~~~~~^~~~~~~~
Language: C++

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

int main(){
  int n;
  cin>>n;
  vector<int> t(n);
  int ans=0;
  for (int i=0;i<n;i++){
    cin >> t[i];
    ans=__lcm(__lcm(t[i],t[i+1]),t[i+2]);
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: '__lcm' was not declared in this scope
   11 |     ans=__lcm(__lcm(t[i],t[i+1]),t[i+2]);
      |               ^~~~~
a.cc:11:9: error: '__lcm' was not declared in this scope
   11 |     ans=__lcm(__lcm(t[i],t[i+1]),t[i+2]);
      |         ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const double PI=3.14159265358979;
const ll INF= pow(10,18);
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

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

int main() {
  ll n;
  cin >> n;
  vl a(n);
  rep(i,n){
    cin >> a[i];
  }
  if(n==1){
    cout << a[0] << endl;
  }
  else{
    ll G=gcd(a[0],a[1]);
    ans=a[0]*a[1]/G;
    FOR(i,2,n){
      G=gcd(G,a[i]);
      ans=a[i]*/G*ans;
    }
    cout << G << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   36 |     ans=a[0]*a[1]/G;
      |     ^~~
      |     abs
a.cc:39:16: error: expected primary-expression before '/' token
   39 |       ans=a[i]*/G*ans;
      |                ^
Language: C++

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

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

    vector<int64_t> t(n);
    int64_t max_time = 1;
    for (auto i = 0; i < n; i++) {
        cin >> t[i];
        max_time = __detail::__lcm(max_time, t[i]);
    }

    cout << max_time << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:30: error: '__lcm' is not a member of 'std::__detail'
   12 |         max_time = __detail::__lcm(max_time, t[i]);
      |                              ^~~~~
Language: C

#include<stdio.h>

int main(void) {
	int N,i;
	int T[100];
    scanf("%d",&N);
	for(i = 0; i < N; i++) {
		scanf("%d", &T[i]);
	}
	long long ans = T[0];
	for (i = 1; i < N; i++) {
		ans = ans * T[i] * gcd(ans, T[i]);
	}
	printf("%lld", ans);

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


Compiler output:
main.c: In function 'main':
main.c:12:36: error: implicit declaration of function 'gcd' [-Wimplicit-function-declaration]
   12 |                 ans = ans * T[i] * gcd(ans, T[i]);
      |                                    ^~~
main.c: At top level:
main.c:18:11: error: conflicting types for 'gcd'; have 'long long int(long long int,  int)'
   18 | long long gcd(long long a, int b) {
      |           ^~~
main.c:12:36: note: previous implicit declaration of 'gcd' with type 'int()'
   12 |                 ans = ans * T[i] * gcd(ans, T[i]);
      |                                    ^~~
Language: C

int main(void) {
	int N,i;
	int T[100];
    scanf("%d",&N);
	for(i = 0; i < N; i++) {
		scanf("%d", &T[i]);
	}
	long long ans = T[0];
	for (i = 1; i < N; i++) {
		ans = ans * T[i] * gcd(ans, T[i]);
	}
	printf("%lld", ans);

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

Compiler output:
main.c: In function 'main':
main.c:4:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |     scanf("%d",&N);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void) {
main.c:4:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |     scanf("%d",&N);
      |     ^~~~~
main.c:4:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:36: error: implicit declaration of function 'gcd' [-Wimplicit-function-declaration]
   10 |                 ans = ans * T[i] * gcd(ans, T[i]);
      |                                    ^~~
main.c:12:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   12 |         printf("%lld", ans);
      |         ^~~~~~
main.c:12:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:12:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:12:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: At top level:
main.c:16:11: error: conflicting types for 'gcd'; have 'long long int(long long int,  int)'
   16 | long long gcd(long long a, int b) {
      |           ^~~
main.c:10:36: note: previous implicit declaration of 'gcd' with type 'int()'
   10 |                 ans = ans * T[i] * gcd(ans, T[i]);
      |                                    ^~~
Language: C++

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

int main(){
  int n; long long s = 1; scanf("%d", &n);
  vector<long long> v(n);
  rep(i, n){
    long long a;
    scanf("%ld", &a);
    v[i] = a;
  }
  rep(i, n) s = __gcd(s, v[i]) * (v[i] / __gcd(s, v[i]) * (s / __gcd(s, v[i]));
  printf("%ld\n", s);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:79: error: expected ')' before ';' token
   13 |   rep(i, n) s = __gcd(s, v[i]) * (v[i] / __gcd(s, v[i]) * (s / __gcd(s, v[i]));
      |                                  ~                                            ^
      |                                                                               )
Language: C++

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

int main(){
  int n; long long s = 1; scanf("%d", &n);
  vector<long long> v(n);{
    long long a;
    rep(i, n) scanf("%ld", &a);
    v[i] = a;
  }
  rep(i, n) s = __gcd(s, v[i]) * (v[i] / __gcd(s, v[i]) * (s / __gcd(s, v[i]));
  printf("%ld\n", s);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'i' was not declared in this scope
   10 |     v[i] = a;
      |       ^
a.cc:12:79: error: expected ')' before ';' token
   12 |   rep(i, n) s = __gcd(s, v[i]) * (v[i] / __gcd(s, v[i]) * (s / __gcd(s, v[i]));
      |                                  ~                                            ^
      |                                                                               )
Language: C++

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

int main(){
  int n; long long s = 1; scanf("%d", &n);
  vector<long long> v(n); rep(i, n) scanf("%ld", &v[i]);
  rep(i, n) s = __gcd(s, v[i]) * (v[i] / __gcd(s, v[i]) * (s / __gcd(s, v[i]));
  printf("%ld\n", s);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:79: error: expected ')' before ';' token
    8 |   rep(i, n) s = __gcd(s, v[i]) * (v[i] / __gcd(s, v[i]) * (s / __gcd(s, v[i]));
      |                                  ~                                            ^
      |                                                                               )
Language: C++

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

int main(){
  int n; lint s = 1; scanf("%d", &n);
  vector<lint> v(n); rep(i, n) scanf("%ld", &v[i]);
  rep(i, n) s = __gcd(s, v[i]) * (v[i] / __gcd(s, v[i]) * (s / __gcd(s, v[i]));
  printf("%ld\n", s);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:79: error: expected ')' before ';' token
    9 |   rep(i, n) s = __gcd(s, v[i]) * (v[i] / __gcd(s, v[i]) * (s / __gcd(s, v[i]));
      |                                  ~                                            ^
      |                                                                               )
Language: C++

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

int main(){
  int n; lint s = 1; scanf("%d", &n);
  vector<int> v(n); rep(i, n) scanf("%d", &v[i]);
  map<lint, int> m;
  rep(i, n){
    lint a = v[i];
    for(int j = 2; j <= pow(v[i], 0.5); ++j){
      lint b = 0;
      while(a % j == 0){
        a /= j;
        ++b;
      }
      if(b != 0) m[j] = max(m[j], b);
      if(a == 1) break;
    }
    if(a != 1 && !m.count(a)) m[a] = 1;
  }
  for(auto p: m) rep(i, p.second) s *= p.first;
  printf("%ld\n", s);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:28: error: no matching function for call to 'max(std::map<long long int, int>::mapped_type&, lint&)'
   18 |       if(b != 0) m[j] = max(m[j], b);
      |                         ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:18:28: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'lint' {aka 'long long int'})
   18 |       if(b != 0) m[j] = max(m[j], b);
      |                         ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:18:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   18 |       if(b != 0) m[j] = max(m[j], b);
      |                         ~~~^~~~~~~~~
Language: C++

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

int main(){
  int n; lint s = 1; scanf("%d", &n);
  vector<int> v(n); rep(i, n) scanf("%d", v[i]);
  map<lint, int> m;
  rep(i, n){
    lint a = v[i];
    for(int j = 2; j <= pow(v[i], 0.5); ++j){
      lint b = 0;
      while(a % j == 0){
        a /= j;
        ++b;
      }
      if(b != 0) m[j] = max(m[j], b);
      if(a == 1) break;
    }
    if(a != 1 && !m.count(a)) m[a] = 1;
  }
  for(auto p: m) rep(i, p.second) s *= p.first;
  printf("%ld\n", s);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:28: error: no matching function for call to 'max(std::map<long long int, int>::mapped_type&, lint&)'
   18 |       if(b != 0) m[j] = max(m[j], b);
      |                         ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:18:28: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'lint' {aka 'long long int'})
   18 |       if(b != 0) m[j] = max(m[j], b);
      |                         ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:18:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   18 |       if(b != 0) m[j] = max(m[j], b);
      |                         ~~~^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#include <boost/integer/common_factor_rt.hpp> // gcd, lcm
using namespace std;
using ll=long long int;
using ld=long double;
using VI=vector<ll>;
using VD=vector<ld>;
using VVI=vector<VI>;
using VC=vector<char>;
using VVC=vector<VC>;
using VS=vector<string>;
using PLL =pair<ll,ll>;
using PLD=pair<ld,ld>;
using VPLL=vector<PLL>;
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element((x).begin(),(x).end())
#define MIN(x) *min_element((x).begin(),(x).end())
#define SORTR(x) sort((x).rbegin(),(x).rend())
#define SORT(x) sort((x).begin(),(x).end())
#define SUM(x) accumulate((x).begin(),(x).end(), 0)
#define FILL(x,a) fill(x.begin(),x.end(),a)
#define EACH(i,x) for(typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i)

const int INF  = 1<<30;
const ld EPS   = 1e-10;
const int MOD  = int(1e9)+7;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template <class BidirectionalIterator>
bool next_partial_permutation(BidirectionalIterator first, BidirectionalIterator middle,BidirectionalIterator last){reverse(middle, last); return next_permutation(first , last);}
#define COUT(x) cout<<x<<"\n"


void Main()
{
	ll N;
	ll result=0;
	string S;
	cin>>N;
	VI T(N);
	REP(i, N) cin >> T[i];
	result= boost::integer::lcm_range(ALL(T)).first;
	cout << result << "\n";
	return;
}

int main()
{
	std::cin.tie(0);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}


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

#include <bits/stdc++.h>
#include <boost/integer/common_factor_rt.hpp> // gcd, lcm
using namespace std;
using ll=long long int;
using ld=long double;
using VI=vector<ll>;
using VD=vector<ld>;
using VVI=vector<VI>;
using VC=vector<char>;
using VVC=vector<VC>;
using VS=vector<string>;
using PLL =pair<ll,ll>;
using PLD=pair<ld,ld>;
using VPLL=vector<PLL>;
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element((x).begin(),(x).end())
#define MIN(x) *min_element((x).begin(),(x).end())
#define SORTR(x) sort((x).rbegin(),(x).rend())
#define SORT(x) sort((x).begin(),(x).end())
#define SUM(x) accumulate((x).begin(),(x).end(), 0)
#define FILL(x,a) fill(x.begin(),x.end(),a)
#define EACH(i,x) for(typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i)

const int INF  = 1<<30;
const ld EPS   = 1e-10;
const int MOD  = int(1e9)+7;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template <class BidirectionalIterator>
bool next_partial_permutation(BidirectionalIterator first, BidirectionalIterator middle,BidirectionalIterator last){reverse(middle, last); return next_permutation(first , last);}
#define COUT(x) cout<<x<<"\n"
ll LCM(VI x){ ll ret = x[0];	for(ll i = 1; i < x.size(); ++i) ret = lcm(ret, x[i]); return ret;}
ll GCD(VI x){ ll ret = x[0];	for(ll i = 1; i < x.size(); ++i) ret = gcd(ret, x[i]); return ret;}


void Main()
{
	ll N;
	ll result=0;
	string S;
	cin>>N;
	VI T(N);
	REP(i, N) cin >> T[i];
	result=LCM(T);
	cout << result << "\n";
	return;
}

int main()
{
	std::cin.tie(0);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}


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

#include "bits/stdc++.h"
#define int long long
#define For(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(obj) begin(obj), end(obj)
#define Max(x) *max_element(ALL(x))
#define Min(x) *min_element(ALL(x))
#define Lower_bound(A, key) distance(A.begin(), lower_bound(ALL(A), key))
#define Upper_bound(A, key) distance(A.begin(), upper_bound(ALL(A), key))

using namespace std;
using ll = long long;
const int MOD = (int)(1e9 + 7);
const int INF = (int)(1e13 + 7);

int bpm(int x, int y) {
  if (x == 0)
    return 0;
  else if (y == 0) {
    return 1;
  }
  int ans = 1;
  x %= MOD;
  int digit = (int)((log((double)y) / log((double)2) / 1 + 1));
  for (int i = 0; i < digit; i++) {
    if (((y >> i) & 1u) == 1) {
      ans *= x;
      ans %= MOD;
    }
    x = x * x;
    x %= MOD;
  }
  return ans;
}

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

int Lcm(int a, int b) {
  if (!(a % gcd(a, b))) {
    return (a / gcd(a, b) * b);
  } else if (!(b % gcd(a, b))) {
    return (b / gcd(a, b) * a);
  } else {
    return a * b / gcd(a, b);
  }
}
class CMultipleClocks {
public:
  void solve(std::istream &cin, std::ostream &cout) {
    int N;
    cin >> N;
    int ans = 1;
    rep(i, N) {
      int temp;
      cin >> temp;
      ans = Lcm(temp, ans);
    }
    cout << ans << endl;
  }
};


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: Java



public class Main {
	//static boolean f;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		/* 入力の受け取り
		 * String s = sc.next();
		 * int a = sc.nextInt();
		 * long a = sc.nextLong();
		 */
		
		// 文字列(String)を文字(char)に分解
		// char[] s_char = s.toCharArray();
		
		int n = sc.nextInt();
		long t[] = new long[n];
		for(int i=0;i<n;i++)
			t[i] = sc.nextLong();
		
		long time = t[0];
		
		if(n != 1) {
			for(int i=1;i<n;i++)
				time = lcm(time,t[i]);
		}
		
		System.out.println(time);
		
		/*
		 * if(f)
		 *	System.out.println("Yes");
		 * else
		 * 	System.out.println("No");
		 */
	}
	
	// ユークリッドの互除法(最大公約数を求める)
	static long gcd(long x, long y) {
		return x%y==0? y : gcd(y,x%y);
	}
		
	// 最小公倍数を求める
	static long lcm(long x, long y) {
		return x / gcd(x, y) * y;
	}
		
}


Compiler output:
Main.java:7: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define NIL -1
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
typedef string str;
using Graph = vector<vector<int>>;
typedef vector<int> vint;
typedef vector<double> vdou ;
typedef vector<ll> vll;
typedef vector<vint> vvint;
typedef vector<str> vstr;
typedef pair<int, int> pii;
typedef vector<pii> vpii ;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数

//-------------------------------------------------
// 
void yes(){
  cout <<"Yes"<<endl ;
}
void no(){
  cout <<"No"<<endl ;
}


//-------------------------------------------------
// メモ
/*






*/
//-------------------------------------------------


int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n ;
  cin >> n ;
  vll num(n) ;
  REP(i,n){
    cin >>> num[i] ;
  }
  ll ans = num[0] ;
  REP(i,n-1){
    ans = lcm(ans,num[i+1]) ;
  }
  cout << ans <<endl ;
  
  
  
  return 0 ;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:67:11: error: expected primary-expression before '>' token
   67 |     cin >>> num[i] ;
      |           ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <utility>

using namespace std;

long long GetGCD(long long a, long long b) 
{
	if (a < b) {
		swap(a, b);
	}

	while(true) 
	{
		long long mod = a % b;
		if (mod == 0) {
			return b;
		}
		a = b;
		b = mod;
	}

	return -1;
}
long long GetLCM(long long a, long long b)// 最小公倍数
{
	long long gcd = GetGCD(a, b);
	long long pA = a / gcd;

	return pA * b;
}

int Work4()
{
	int N = 0;
	cin >> N;
	vector<long long> T(N, 0);

	for (int i = 0; i < N; ++i) {
		cin >> T[i];
	}
	// sort(T.rbegin(), T.rend());

	// 端から最小公倍数を求めてゆく。
	long long res = T[0];
	for (int i = 0; i < N; ++i) {
		long long cur0 = T[i];
		res = GetLCM(res, T[i]);
	}

	cout << res << endl;

	return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define ocut cout
#define ouct cout
#define itn int
ll gcd(ll a, ll b){
   if (a%b == 0){
       return(b);
   }
   else{
       return(gcd(b, a%b));
   }
}

ll lcm(ll a, ll b){
   return a * b / gcd(a, b);
}
int main(){
  ll n;
  cin >> n;
  ll t[n];
  rep(i,n){
    cin >> t[i];
  }
  ll to=t[0],m;
  rep(i,n-1){
    m=to;
    m=lcm(to,t[i+1]);
    to=m;
  }
  cout << to;
}


Compiler output:
a.cc:9:3: error: expected ';' before 'gcd'
    9 | ll gcd(ll a, ll b){
      |   ^~~~
      |   ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define ocut cout
#define ouct cout
#define itn int
ll gcd(ll a, ll b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

ll lcm(ll a, ll b)
{
   return a * b / gcd(a, b);
}
int main(){
  ll n;
  cin >> n;
  ll t[n];
  rep(i,n){
    cin >> t[i];
  }
  ll to=t[0],m;
  rep(i,n-1){
    m=to;
    m=lcm(to,t[i+1]);
    to=m;
  }
  cout << to;
}


Compiler output:
a.cc:9:3: error: expected ';' before 'gcd'
    9 | ll gcd(ll a, ll b)
      |   ^~~~
      |   ;
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <cmath>

using namespace std;

int Work4()
{
	int N = 0;
	cin >> N;
	vector<long long> T(N, 0);

	for (int i = 0; i < N; ++i) {
		cin >> T[i];
	}
	sort(T.rbegin(), T.rend());

	// 端から最小公倍数を求めてゆく。
	long long res = T[0];

	for (int i = 0; i < N; ++i){
		const long long cur0 = T[i];
		long long cur = cur0;
		if (res % cur != 0){
			while ((cur % res) != 0){
				cur += cur0;
			}
			res = cur;
		}
	}

	cout << res << endl;

	return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
long long gcd(long long a, long long b) {
  while(a) {
    a %= b;
    long long t = a;
    a = b;
    b = t;
  }
  return b;
}
long long lcm(long long a, long long b) {
  long long gc = gcd(a, b);
  return a * b / gc;
}
int main () {
  int N;
  long long ans = 1;
  for (int i = 0; i < N; i ++) {
    long long T;
    cin >> T;
    ans = lcm(ans, T);
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   20 |     cin >> T;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:23:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   23 |   cout << ans << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:23:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   23 |   cout << ans << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~