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

/*..........AAKASH GOYAL............*/
/*............DAIICT................*/
 
 
#include <bits/stdc++.h>
#include <boost/math/common_factor.hpp> 
using namespace std;
 
#define    int                      unsigned long long int
 
#define    f(i,j,n)                 for(int i = j; i <= n; i++)
#define    r(i,n,j)                 for(int i = n; i >= j; i--)
#define    mod                      1110111110111
#define    speed                    ios_base::sync_with_stdio(false);
#define    upp                      cin.tie(NULL);
#define    pb                       push_back
#define    mp                       make_pair
#define    T                        int tt; cin >> tt; while(tt--)
#define    ff                       first
#define    ss                       second
#define    all(container)           container.begin() , container.end()
#define    sz(container)            (int)container.size()
#define    pii                      pair <int , int>
#define    pll                      pair <long long int , long long int>
#define    ppl                      pair <long long int , pll>              //pair of ll and pair ll 
#define    sp(x)                    setprecision(x)
 
 
int32_t main()
{
    speed upp
    int n,m,x=1,z=1;
    cin>>n>>m;
    int a[n+1];
    f(i,1,n)
    {
        cin>>a[i];
        int o=__gcd(x,a[i]);  
        x=(x*a[i])/o;
        a[i]/=2;
        int p=__gcd(z,a[i]);  
        z=(z*a[i])/p;
    }
    if(z>m)
        cout<<"0";
    else
    {
        f(i,1,n)
        {
            if(z/a[i] % ==0)
            {
                cout<<"0";
                exit(0);
            }
        }
        int ans=(m-z)/x;
        cout<<ans+1;
    }
    
}

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

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

int bi(int n){
    int num=0;
    while(n%2==0){
        if(n%2==0){
            n /= 2;
            num++;
        }
    }
    return num;
}

int main(){
 int N;
 int M;
 cin >> N >> M;
 int a[N];
 int i;
 int aaa = 0;
 for(i=0;i<N;++i){
   cin >> a[i];}
 int check = bi(a[0]);
  for(i=1;i<N;++i){
   if(check!=bi(a[i]){
       aaa++;
       break;
   }}
   if(aaa>0)cout << 0 << endl;
 else{
   long long int obj = a[0]/2;
     for(int j=1;j<N;j++){
        obj = lcm(obj,a[j]/2);
        if(obj>M)break;
     }
 cout << M/obj << endl;
 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:22: error: expected ')' before '{' token
   26 |    if(check!=bi(a[i]){
      |      ~               ^
      |                      )
a.cc:29:5: error: expected primary-expression before '}' token
   29 |    }}
      |     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
ll gcd(ll a,ll b){
  if(b==0) return a;
  return gcd(b,a%b);
}
ll lcm(ll a,ll b){
  return a*b/gcd(a,b);
}

int main() {
    ll n,m;
    cin >>n >>m;
    rep(i.n)cin>>a[i];
    ll c=0;
    ll d=a[0];
    while(d%2==0)c++;
    bbl result=true;
    rep1(i,n-1){
        ll cc=0;
        ll a[i];
        while(b%2==0){
            b=b/2;
            cc++;
        }
        if(c!=cc){
            result=false;
            break;
        }
    }
    ll g=1;
    rep(i,n)g=lcm(g,a[i]/2);
    if(resul){
        ll ans=m/g;
        ans=(ans+1)/2;
        cout << ans;
    }
    else{
        cout << 0 ;
    }
}

Compiler output:
a.cc:17:12: error: macro "rep" requires 2 arguments, but only 1 given
   17 |     rep(i.n)cin>>a[i];
      |            ^
a.cc:4:9: note: macro "rep" defined here
    4 | #define rep(i,n) for(int i=0;i<n;++i)
      |         ^~~
a.cc: In function 'int main()':
a.cc:17:5: error: 'rep' was not declared in this scope
   17 |     rep(i.n)cin>>a[i];
      |     ^~~
a.cc:19:10: error: 'a' was not declared in this scope
   19 |     ll d=a[0];
      |          ^
a.cc:21:5: error: 'bbl' was not declared in this scope
   21 |     bbl result=true;
      |     ^~~
a.cc:25:15: error: 'b' was not declared in this scope
   25 |         while(b%2==0){
      |               ^
a.cc:30:13: error: 'result' was not declared in this scope
   30 |             result=false;
      |             ^~~~~~
a.cc:36:8: error: 'resul' was not declared in this scope
   36 |     if(resul){
      |        ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <boost/math/common_factor_rt.hpp>
using namespace std;
using uint = unsigned int;
using ull = unsigned long long;

int main() {
	uint N, M;
	cin >> N >> M;
	
	vector<uint> A(N);
	for(uint i=0; i<N; i++) {
		uint a;
		cin >> a;
		if(a & 1) {
			cout << 0;
			return 0;
		}
		A[i] = a / 2;
	}
	
	uint t = 1;
	uint a = A[0];
	while(a % 2 == 0) {
		t *= 2;
		a /= 2;
	}
	
	ull lcmA = 1;
	for(uint i=0; i<N; i++) {
		if(A[i] % t != 0) {
			cout << 0;
			return 0;
		} else if(lcmA > M) {
			cout << 0;
			return 0;
		} else {
			lcmA = boost::math::lcm(lcmA, A[i]);
		}
	}
	
	ull ans = (M / lcmA) - (M / (2 * lcmA));
	cout << ans;
	
	return 0;
}


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

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

int bi(int n){
    int num=0;
    while(n%2==0){
        if(n%2==0){
            n /= 2;
            num++;
        }
    }
    return num;
}

int main(){
 int N;
 int M;
 cin >> N >> M;
 int a[N];
 int i;
 for(i=0;i<N;++i){
   cin >> a[i];}
sort(a,a+N);
int count = 0;
int check = a[N-1]/2;
 while(obj>M){
     int bii = bi(obj);
     for(int j=0;j<N-1;j++){
        if(obj%(a[j]/2) != 0)break;
        if(bii != bi(a[j]))break;
        if(j==N-2)count++;
     }
    obj += check;
  }
 cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:8: error: 'obj' was not declared in this scope
   26 |  while(obj>M){
      |        ^~~
Language: C++

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

int bi(int n){
    int num=0;
    while(n%2==0){
        if(n%2==0){
            n /= 2;
            num++;
        }
    }
    return num;
}

int main(){
 int N;
 int M;
 cin >> N >> M;
 int a[N];
 int i;
 for(i=0;i<N;++i){
   cin >> a[i];}
sort(a,a+N);
int count = 0;
int check = a[N-1]/2;
int obj = check;
int a;
 while(obj>M){
     a = 0;
     int bii = bi(obj);
     for(int j=0;j<N-1;j++){
        if(obj%(a[j]/2) != 0)break;
        if(bii != bi(a[j]))break;
        if(j==N-2)count++;
     }
    obj += check;
  }
 cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:5: error: conflicting declaration 'int a'
   27 | int a;
      |     ^
a.cc:19:6: note: previous declaration as 'int a [N]'
   19 |  int a[N];
      |      ^
a.cc:29:8: error: incompatible types in assignment of 'int' to 'int [N]'
   29 |      a = 0;
      |      ~~^~~
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	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;
}
ll ok(ll n){
  ll cu=0;
  while(n%2==0){
    n/=2;
    cu++;
  }
  return cu;
}
int main(){
  ll n,m;
  vll a(n);
  rep(i,n){
    cin>>a[i];
  }
  rep8i,n){
    a[i]/=2;
  }
  ll k=ok(a[0]);
  
  rep(i,n){
    if(ok(a[i])!=k){
      COUT(0);
      return 0;
    }
    a[i]>>=k;
  }
  m>>=k;
  ll j=1;
  rep(i,n){
    j=lcm(j,a[i]);
    if(j>m){
      cout<<0<<endl;
      return 0;
    }
  }
  m/=j;
  COUT((m+1)/2);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:3: error: 'rep8i' was not declared in this scope; did you mean 'rep'?
   62 |   rep8i,n){
      |   ^~~~~
      |   rep
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	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;
}
ll ok(ll n){
  ll cu=0;
  while(n%2==0){
    n/=2;
    cu++;
  }
  return cu;
}
int main(){
  ll n,m;
  vll a(n);
  rep(i,n){
    cin>>a[i];
  }
  ll k=ok(a[0]);
  b[0]>>=k;
  for(int i=1;i<n;i++){
    if(ok(a[i])!=k){
      COUT(0);
      return 0;
    }
    a[i]>>=k;
  }
  k/=2;
  m>>=k;
  ll j=1;
  rep(i,n){
    j=lcm(j,a[i]);
    if(j>m){
      cout<<0<<endl;
      return 0;
    }
  }
  m/=j;
  COUT((m+1)/2);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:3: error: 'b' was not declared in this scope
   63 |   b[0]>>=k;
      |   ^
Language: C++

#include<algorithm>
#include<bitset>
#include<cassert>
#include<cfloat>
#include<climits>
#include<cmath>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)

using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;


template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}


#define ARRAY_MAX 100005
const int INF = INT32_MAX / 3;
const ll MOD = 1e9 + 7;

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


/******************************************************************************************/



//ユークリッド互除法
template<typename T>
T gcd(T x, T y) {

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

/*最小公倍数*/
template<typename T>
T lcm(T x, T y) {
	T tmp = gcd(x, y);

	return x * / tmp * y;
}


int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(10);


	ll n, m;
	cin >> n >> m;
	ll ans = 0;
	vector<ll> a(n);

	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
		//hoge = lcm(hoge,a[i]/2);
	}
	ll hoge = a[0] / 2;

	for (int i = 0; i < n; i++)
	{
		//cin >> a[i];
		hoge = lcm(hoge, a[i] / 2LL);
	}
	// cout << hoge << endl;

	if (hoge > m) {
		cout << "0" << endl;
	}
	else {
		cout << (m / hoge+1) / 2  << endl;
	}









	return 0;
}



Compiler output:
a.cc:54:17: error: 'INT32_MAX' was not declared in this scope
   54 | const int INF = INT32_MAX / 3;
      |                 ^~~~~~~~~
a.cc:19:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
   18 | #include<utility>
  +++ |+#include <cstdint>
   19 | #include<vector>
a.cc: In function 'T lcm(T, T)':
a.cc:82:20: error: expected primary-expression before '/' token
   82 |         return x * / tmp * y;
      |                    ^
Language: C++


#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <string>
#include <limits>
#include <map>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <deque>
#include <stack>
#include <cstring>

typedef long long li;
using namespace std;

li max(li a, li b) {
    return a > b ? a : b;
}

li max(li a, li b, li c) {
    return max(a, max(b, c));
}

li max(li a, li b, li c, li d) {
    return max(a, max(b, max(c, d)));
}

li max(li a, li b, li c, li d, li e) {
    return max(a, max(b, max(c, max(d, e))));
}


li pow_mod(li n, li e, li mod)
{
    li r = 1;
    
    while(e > 0)
    {
        if(e & 1)
            r *= n;
            r %= mod;
        
        n *= n;
        n %= mod;
        e >>= 1;
    }
    
    return r;
}


int main() {
    // ifstream fin("read.txt");
    li n, m, num;
    vector<li> v;
    cin >> n >> m;
    
    for (int i = 0; i < n; i++) {
        cin >> num;
        v.push_back(num);
    }
    
    int twos = 0;
    
    num = v[0];
    
    while(num > 0 && num % 2 ==0) {
        num /= 2;
        twos++;
    }
    
    for (int i = 1; i < v.size(); i++) {
        num = v[i];
        int t = 0;
        
        while(num > 0 && num % 2 ==0) {
            num /= 2;
            t++;
        }
        
        if (t != twos) {
            cout << 0 << endl;
            return 0;
        }
    }
    
    
    
    
    li lcm = 1;
    
    unordered_map<li, li>::iterator it;

	for (it = mp.begin(); it != mp.end(); ++it) {
        lcm *= pow(it->first, it->second);
        if (lcm > 2 * m) {
            cout << 0 << endl;
            return 0;
        }
    }    
    lcm /= 2;
        
    li ans = m / lcm;
    ans = ans % 2 + ans / 2;
    
    cout << ans << endl;

    
    return 0;
}








Compiler output:
a.cc: In function 'int main()':
a.cc:97:19: error: 'mp' was not declared in this scope; did you mean 'm'?
   97 |         for (it = mp.begin(); it != mp.end(); ++it) {
      |                   ^~
      |                   m
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using uint = unsigned int;
using ull = unsigned long long;
 
bool compare(const pair<uint, uint>& p0, const pair<uint, uint>& p1) {
	if(p0.second == p1.second) {
		return p0.first > p1.first;
	} else {
		return p1.second < p0.second;
	}
}

int main() {
	uint N;
	double T;
	cin >> N >> T;
	
	T -= 0.5;
	
	vector<pair<uint, uint>> ab(N);

	for(uint i=0; i<N; i++) {
		uint A, B;
		cin >> A >> B;
		ab[i] = make_pair(A, B);
	}
	
	sort(ab.begin(), ab.end(), compare);
	
	uint maxB = ab[0].second;
	//cout << "maxB:" << maxB << " T:" << T << endl;
	ab.erase(ab.begin());
	
	vector<pair<double, pair<uint, uint>>> eab(N-1);
	for(uint i=0; i<N-1; i++) {
		uint A = ab[i].first;
		uint B = ab[i].second;
		double E = double(B) / double(A);
		eab[i] = make_pair(E, ab[i]);
	}
	
	sort(eab.begin(), eab.end(), greater<pair<double, pair<uint, uint>>>());
	
	ull t = 0;
	ull ans = 0;
	uint lastA = INT_MAX;
	uint last B = 0;
	for(uint i=0; i<N-1; i++) {
		double E = eab[i].first;
		auto AB = eab[i].second;
		uint A = AB.first;
		uint B = AB.second;
		//cout << E << " " << A << " " << B << " " << t << " " << ans << endl;
		
		if (t + A < T) {
			ans += B;
			t += A;
			lastB = B;
			lastA = A;
		} else if(t - lastA + A < T) {
		
		
		}
	}
	
	cout << ans + maxB;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:22: error: 'INT_MAX' was not declared in this scope
   49 |         uint lastA = INT_MAX;
      |                      ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <algorithm>
  +++ |+#include <climits>
    4 | using namespace std;
a.cc:50:19: error: expected initializer before 'B'
   50 |         uint last B = 0;
      |                   ^
a.cc:61:25: error: 'lastB' was not declared in this scope; did you mean 'lastA'?
   61 |                         lastB = B;
      |                         ^~~~~
      |                         lastA
Language: C++

#include <iostream>
#include <vector>
#include <boost/math/common_factor_rt.hpp>
using namespace std;
using ull = unsigned int;
using ull = unsigned long long;

int main() {
	ull N, M;
	cin >> N >> M;
	
	vector<ull> A(N);
	for(ull i=0; i<N; i++) {
		ull a;
		cin >> a;
		A[i] = a / 2;
	}
	
	ull t = 1;
	ull a = A[0];
	while(a % 2 == 0) {
		t *= 2;
		a /= 2;
	}
	
	ull lcmA = 1;
	for(ull i=0; i<N; i++) {
		if(A[i] % t != 0) {
			cout << 0;
			return 0;
		} else {
			lcmA = boost::math::lcm(lcmA, ull(A[i] / t));
		}
	}
	
	ull ans = ((M / t / lcmA) + 1 )/ 2;

	cout << ans;
	return 0;
}


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


#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <string>
#include <limits>
#include <map>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <deque>
#include <stack>
#include <cstring>

typedef long long li;
using namespace std;

li max(li a, li b) {
    return a > b ? a : b;
}

li max(li a, li b, li c) {
    return max(a, max(b, c));
}

li max(li a, li b, li c, li d) {
    return max(a, max(b, max(c, d)));
}

li max(li a, li b, li c, li d, li e) {
    return max(a, max(b, max(c, max(d, e))));
}


li pow_mod(li n, li e, li mod)
{
    li r = 1;
    
    while(e > 0)
    {
        if(e & 1)
            r *= n;
            r %= mod;
        
        n *= n;
        n %= mod;
        e >>= 1;
    }
    
    return r;
}


int main() {
    // ifstream fin("read.txt");
    int n, m, num;
    vector<int> v;
    cin >> n >> m;
    unordered_map<int, int> mp;
    
    for (int i = 0; i < n; i++) {
        cin >> num;
        v.push_back(num);
    }
    
    int twos = 0;
    
    num = v[0];
    
    while(num > 0 && num % 2 ==0) {
        num /= 2;
        twos++;
    }
    
    for (int i = 1; i < v.size(); i++) {
        num = v[i];
        int t = 0;
        
        while(num > 0 && num % 2 ==0) {
            num /= 2;
            t++;
        }
        
        if (t != twos) {
            cout << 0 << endl;
            return 0;
        }
    }
    
    
    for (int i = 0; i< v.size(); i++) {
        for (int j = 2; j * j <= v[i]; j++) {
            int cnt = 0;
            while(v[i] > 0 && v[i] % j == 0) {
                v[i] /= j;
                cnt++;
            }
            
            if (cnt > 0) mp[j] = max(mp[j], cnt);
            if (v[i] > 0) mp[v[i]] = max(mp[v[i]], 1);
        }
    }
    
    int lcm = 1;
    
	for (it = mp.begin(); it != mp.end(); ++it) {
        lcm *= pow(it->first, it->second);
        if (lcm > 2 * m) {
            cout << 0 << endl;
            return 0;
        }
    }    lcm /= 2;
    
    cout << lcm << endl;
    
    int ans = m / lcm;
    ans = ans % 2 + ans / 2;
    
    cout << ans << endl;

    
    return 0;
}








Compiler output:
a.cc: In function 'int main()':
a.cc:107:14: error: 'it' was not declared in this scope; did you mean 'int'?
  107 |         for (it = mp.begin(); it != mp.end(); ++it) {
      |              ^~
      |              int
Language: C++

#include <iostream>
#include <vector>
#include <boost/math/common_factor_rt.hpp>
using namespace std;
using uint = unsigned int;
using ull = unsigned long long;

int main() {
	uint N, M;
	cin >> N >> M;
	
	vector<uint> A(N);
	for(uint i=0; i<N; i++) {
		uint a;
		cin >> a;
		A[i] = a / 2;
	}
	
	uint t = 1;
	uint a = A[0];
	while(a % 2 == 0) {
		t *= 2;
		a /= 2;
	}
	
	ull lcmA = 1;
	for(uint i=0; i<N; i++) {
		if(A[i] % t != 0) {
			cout << 0;
			return 0;
		} else {
			lcmA = boost::math::lcm(lcmA, A[i] / t);
		}
	}
	
	ull X = lcmA * t;
	ull ans = ((M / X) + 1 )/ 2;

	cout << ans;
	return 0;
}


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


#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <string>
#include <limits>
#include <map>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <deque>
#include <stack>
#include <cstring>

typedef long long li;
using namespace std;

li max(li a, li b) {
    return a > b ? a : b;
}

li max(li a, li b, li c) {
    return max(a, max(b, c));
}

li max(li a, li b, li c, li d) {
    return max(a, max(b, max(c, d)));
}

li max(li a, li b, li c, li d, li e) {
    return max(a, max(b, max(c, max(d, e))));
}


li pow_mod(li n, li e, li mod)
{
    li r = 1;
    
    while(e > 0)
    {
        if(e & 1)
            r *= n;
            r %= mod;
        
        n *= n;
        n %= mod;
        e >>= 1;
    }
    
    return r;
}
void dfs(int n, string & s, vector<int> visited, int & cnt, unordered_map<string, int> & m) {
    if (s.length() == n) {
        m[s] = cnt++;
        return;
    }
    
    for (int i = 1; i <= n; i++) {
        if (visited[i] == 0) {
            visited[i] = 1;
            s += (i + '0');
            dfs(n, s, visited, cnt, m);
            s.pop_back();
            visited[i] = 0;
        }
    }
}

int main() {
    // ifstream fin("read.txt");
    int n, m, num;
    vector<int> v;
    cin >> n >> m;
    unordered_map<int, int> mp;
    
    for (int i = 0; i < n; i++) {
        cin >> num;
        v.push_back(num);
    }
    
    int twos = 0;
    
    num = v[0];
    
    while(num > 0 && num % 2 ==0) {
        num /= 2;
        twos++;
    }
    
    for (int i = 1; i < v.size(); i++) {
        num = v[i];
        int t = 0;
        
        while(num > 0 && num % 2 ==0) {
            num /= 2;
            t++;
        }
        
        if (t != twos) {
            cout << 0 << endl;
            return 0;
        }
    }
    
    
    for (int i = 0; i< v.size(); i++) {
        for (int j = 2; j * j <= v[i]; j++) {
            int cnt = 0;
            while(v[i] > 0 && v[i] % j == 0) {
                v[i] /= j;
                cnt++;
            }
            
            if (cnt > 0) mp[j] = max(mp[j], cnt);
            if (v[i] > 0) mp[v[i]] = max(mp[v[i]], 1);
        }
    }
    
    int lcm = 1;
    
    for (it = mp.begin(); it != mp.end(); ++it) lcm *= pow(it->first, it->second);
    lcm /= 2;
    
    cout << lcm << endl;
    
    int ans = m / lcm;
    ans = ans % 2 + ans / 2;
    
    cout << ans << endl;

    
    return 0;
}








Compiler output:
a.cc: In function 'int main()':
a.cc:122:10: error: 'it' was not declared in this scope; did you mean 'int'?
  122 |     for (it = mp.begin(); it != mp.end(); ++it) lcm *= pow(it->first, it->second);
      |          ^~
      |          int
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using edge = struct
{
    int to;
    ll cost;
};

#define mod 1000000007
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(a) (a).begin(), (a).end()
#define INF (1 << 29)

//long C(long n, long r);
long long gcd(long long a, long long b);
long long lcm(long long a, long long b);

int how2div(ll a)
{
    int ans = 0;
    while (a % 2ll == 0)
    {
        ans++;
        a /= 2ll;
    }
    return ans;
}

void solve()
{
    int n;
    ll m;
    cin >> n >> m;
    vector<ll> a(n);
    REP(i, n)
    {
        cin >> a[i];
    }
    int tow0 = how2div(a[0]);
    REP(i, n)
    {
        if (tow0 != how2div(a[i]))
        {
            cout << 0 << "\n";
            return;
        }
    }
    ll T = 1ll;
    REP(i, n)
    {
        T = lcm(T, a[i] / 2ll);
    }
    //cout << T << "\n";
    ll ans = (ll)((m / T + 1) / 2ll);
    cout << ans << "\n";
}

int main()
{
    solve();
    return 0;
}

Compiler output:
/usr/bin/ld: /tmp/cc21zhjS.o: in function `solve()':
a.cc:(.text+0x1ad): undefined reference to `lcm(long long, long long)'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
#include <cmath>
#include <numeric>
using namespace std;
#define rep(i,a,b) for(int64_t i=(a); i<(b); ++i) // a ≦ i < b 
#define Rrep(i,a,b) for(int64_t i=(a);i>=(b);--i) // reverse repeat. a から b まで減少．
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend() //逆イテレータ
#define INF 10000000000000
#define MOD 1000000007LL
#define RANGE(a,b,c) (a).begin()+(b),(a).begin()+(c) // [b,c) イテレータ
using PII = pair<int64_t, int64_t>;
using VI = vector<int64_t>;
using VVI = vector<VI>;
using VS = vector<string>;
using VP = vector<PII>;
using i64 = int64_t;
template<typename T> void invec(vector<T> &A){for(T& a : A) cin >> a;} // input vector
#include <boost/integer/common_factor_rt.hpp> // gcd, lcm


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

int N, M; cin >> N >> M;
VI a(N); invec(a);

VI ah = a; for(i64 &i: ah) i /= 2;
i64 l = boost::integer::lcm_range(ALL(ah)).first;

for (i64 i: ah) 
    if (l / i % 2 == 0) {
        cout << "0\n";
        return 0;
    }  

cout << (M / l + 1) / 2  <<  "\n";
}
// 書いて考える．場合分け．情報整理．
// 境界，出力文字列 チェック．行末にスペース入れない．
// 可読性優先．高速化次点．
// まずは全探索，次にDP
// 制限を見る．境界に注意．求めたい量の変域．動かせる量．
// 偶奇，逆から，ソート，出現回数，出現位置，DP， 余事象，包除
// データ構造． 問題の特徴量．単調性，二分探索
// 存在判定：構成方法，入力の特徴
// gcd, lcm ,素因数分解．
// 例外を十分に含む一般化．想像力の限界
// 小さい系から例示
// 代数的処理．前処理によるクエリ高速化．
// 始めは過剰に例示・場合分けしてもいい．各場合を確実に対処．
// 自明な例から処理，除外．
// 小数のときは，精度の設定する．doubel 変数に数値を入力するときは 123. とする．
// テストケース作成は数表あり
// 実行エラー：vector添え字超え．0割り．



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

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

int64_t gcd(int64_t a, int64_t b){
    if (b > a) return gcd(b, a);

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

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

int pow_of_2(int n){
  int res = 0;
  while(n % 2 == 0){
    n /= 2; res++;
  }
  return res;
}

int main(){
  int64_t N, M;
  vector<int64_t> a(100010);
 
  cin >> N >> M;
  for(int i=0; i<N; i++){
    int tmp; cin >> tmp;
    a[i] = tmp/2;
  }
 
  int64_t t = pow_of_2(a[0]);
  for(int i=0; i<N; i++){
    if(pow_of_2(a[i]) = t){
      cout << 0 << endl; return 0;
    }
    a[i] >>= t;
  }
  M >>= t;

  int64_t l = 1;
  for(int i=0; i<N; i++){
    l = lcm(l, a[i]);
    if(l > M){
      cout << 0 << endl; return 0;
    } 
  }
 
  cout << (M+l)/(2*l) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:16: error: lvalue required as left operand of assignment
   38 |     if(pow_of_2(a[i]) = t){
      |        ~~~~~~~~^~~~~~
Language: C++

include <cstdio>
#include <cstring>

#define MAX_N 100001
#define INF (0x7fffffff)

/* -----------------------------------------------------------------------------
	型とクラス定義
----------------------------------------------------------------------------- */

/* -----------------------------------------------------------------------------
	大域データ
----------------------------------------------------------------------------- */

int N;					// 数列のサイズ
int M;					// 上限
int A[MAX_N];			// 数列

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

int lcm(int a, int b) {
	long long c;

	if(a == INF || b == INF) return INF;
	c = a * b / gcd(a, b);
	if(c > M) return INF;
	else return c;
}


int main () {

	int L;

	// 長さの読込み
	scanf("%d %d", &N, &M);

	// 配列の読込み
	for(int i = 0; i < N; i++) scanf("%d", A + i);

	L = A[0]/2;
	for(int i = 1; i < N; i++) L = lcm(L, A[i]/2);

	printf("%d\n", (M/L+1)/2);

	return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <cstdio>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:38:9: error: 'scanf' was not declared in this scope
   38 |         scanf("%d %d", &N, &M);
      |         ^~~~~
a.cc:46:9: error: 'printf' was not declared in this scope
   46 |         printf("%d\n", (M/L+1)/2);
      |         ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include <cstring>
  +++ |+#include <cstdio>
    3 |
Language: C++

#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define INF LLONG_MAX - 100
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
#define int long long
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
#define lowb lower_bound
#define upb upper_bound
typedef long long ll;
typedef pair<int, int> P;
typedef priority_queue<int> pque;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
int month[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};



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

	int n, m;
	int a, LCM, t = -1;
	rep(i, n) {
		cin >> a;
		int now = a, cnt = 0;
		while(now % 2 == 0) {
			now /= 2;
			cnt++;
		}
		if(t == -1) t = cnt;
		else if(c != cnt) {
			cout << 0 << endl;
			return 0;
		}
		LCM = lcm(LCM, a);
	}

	if(LCM % 2 == 1) {
		cout << 0 << endl;
	} else {
		int ans = (m - LCM / 2 + LCM) / LCM;
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:25: error: 'c' was not declared in this scope
   44 |                 else if(c != cnt) {
      |                         ^
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
const int MOD = 1e9 + 7;
 
 
signed main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
 
  int N, M;
  cin >> N >> M;
  int A[N];
  rep(i,N) cin >> A[i];
  rep(i,N) A[i] = A[i]/2;
 
  int ans = 1;
  rep(i,N){
    ans = ans * A[i] / __gcd(ans,A[i]);
    if(ans > M){
      cout << 0 << endl;
      return 0;
    }
  }
  for(int i=0;i<N;i++){
    if((ans/A[i]) % 2 == 0){
      cout << 0 << endl;
      return 0;
    }
  }
 
  cout << ((M/ans)+1)/2 << endl;
}
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
const int MOD = 1e9 + 7;


signed main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);

  int N, M;
  cin >> N >> M;
  int A[N];
  rep(i,N) cin >> A[i];
  rep(i,N) A[i] = A[i]/2;

  int ans = 1;
  rep(i,N){
    ans = ans * A[i] / __gcd(ans,A[i]);
    if(ans > M){
      cout << 0 << endl;
      return 0;
    }
  }
  for(int i=0;i<N;i++){
    if((ans/A[i]) % 2 == 0){
      cout << 0 << endl;
      return 0;
    }
  }

  cout << ((M/ans)+1)/2 << endl;
}


Compiler output:
a.cc:39:11: error: redefinition of 'const long long int MOD'
   39 | const int MOD = 1e9 + 7;
      |           ^~~
a.cc:5:11: note: 'const long long int MOD' previously defined here
    5 | const int MOD = 1e9 + 7;
      |           ^~~
a.cc:42:8: error: redefinition of 'int main()'
   42 | signed main(){
      |        ^~~~
a.cc:8:8: note: 'int main()' previously defined here
    8 | signed main(){
      |        ^~~~
Language: C++

// https://atcoder.jp/contests/abc150/tasks/abc150_d
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#define DIV(a, b) ((a - 1) / b + 1)
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int c, int d) { return c / gcd(c, d) * d; }

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N, M;
    cin >> N >> M;
    unordered_set<int> st;
    int ans = 1;
    REP(i, N) {
        uint64_t t;
        cin >> t;
        st.insert(__builtin_ctzll(t));
        if (st.size() >= 2) {
            cout << "0\n";
            return 0;
        }
        ans = lcm(ans, t / 2);
    }
    res = M / ans;
    cout << (res + 1) / 2 << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: 'res' was not declared in this scope
   31 |     res = M / ans;
      |     ^~~
Language: C++

int main() {
  int n, m, l, b;
  vector<int> a;
  vector<int> x;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> l;
    a.push_back(l);
  }
  sort(a.begin(), a.end(), greater<int>());
  a.erase(unique(a.begin(), a.end()), a.end());
  n=a.size();
  //最大の数で割った数=存在しうる数(0.5倍も含むため+1)。
  b = ((m - (a[0] / 2)) / a[0]) + 1;
  //cout << a[0] << "," << b << endl;
  for (int i = 0; i < b; i++) {
    x.push_back(i * a[0] + a[0] / 2);
  }
  for (int i = 1; i < n; i++) {
    if (a[0] % a[i] != 0) {
      for (long long unsigned int j = 0; j < x.size(); j++) {
        if ((x[j] - (a[i] / 2)) % a[i] != 0) {
          x.erase(x.begin() + j);
          j--;
        }
      }
    }
  }
  cout << x.size();
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'vector' was not declared in this scope
    3 |   vector<int> a;
      |   ^~~~~~
a.cc:3:10: error: expected primary-expression before 'int'
    3 |   vector<int> a;
      |          ^~~
a.cc:4:10: error: expected primary-expression before 'int'
    4 |   vector<int> x;
      |          ^~~
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> n >> m;
      |   ^~~
a.cc:8:5: error: 'a' was not declared in this scope
    8 |     a.push_back(l);
      |     ^
a.cc:10:8: error: 'a' was not declared in this scope
   10 |   sort(a.begin(), a.end(), greater<int>());
      |        ^
a.cc:10:28: error: 'greater' was not declared in this scope
   10 |   sort(a.begin(), a.end(), greater<int>());
      |                            ^~~~~~~
a.cc:10:36: error: expected primary-expression before 'int'
   10 |   sort(a.begin(), a.end(), greater<int>());
      |                                    ^~~
a.cc:10:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |   sort(a.begin(), a.end(), greater<int>());
      |   ^~~~
      |   short
a.cc:11:11: error: 'unique' was not declared in this scope
   11 |   a.erase(unique(a.begin(), a.end()), a.end());
      |           ^~~~~~
a.cc:17:5: error: 'x' was not declared in this scope
   17 |     x.push_back(i * a[0] + a[0] / 2);
      |     ^
a.cc:21:46: error: 'x' was not declared in this scope
   21 |       for (long long unsigned int j = 0; j < x.size(); j++) {
      |                                              ^
a.cc:29:3: error: 'cout' was not declared in this scope
   29 |   cout << x.size();
      |   ^~~~
a.cc:29:11: error: 'x' was not declared in this scope
   29 |   cout << x.size();
      |           ^
Language: C++

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

bool valid(vector<int> a)
{
    const int init = -1;
    int power_of_two = init;
    for (int aa : a)
    {
        int tmp = 0;
        while (aa % 2 == 0)
        {
            tmp++;
            aa >>= 1;
        }
        if (power_of_two == init)
        {
            power_of_two = tmp;
        }
        else
        {
            if (tmp != power_of_two)
            {
                return false;
            }
        }
    }
    return true;
}

template <typename T>
T calc_gcd(T x, T y)
{
    if (x < y)
    {
        swap(x, y);
    }
    T remain = x % y;
    while (remain != 0)
    {
        x = y;
        y = remain;
        remain = x % y;
    }
    return y;
}

template <typename T>
T calc_multi_gcd(vector<T> x)
{
    if (x.size() < 2)
    {
        if (x.size() == 1)
        {
            return x[0];
        }
        else
        {
            return -1;
        }
    }

    T gcd = calc_gcd(x[0], x[1]);
    for (long long i = 2; i < x.size(); i++)
    {
        gcd = calc_gcd(gcd, x[i]);
    }
    return gcd;
}

template <typename T>
T calc_lcm(T x, T y)
{
    if (x < y)
    {
        swap(x, y);
    }
    T ret = x / calc_gcd(x, y);
    return ret * y;
}

template <typename T>
T calc_multi_lcm(vector<T> x)
{
    if (x.size() < 2)
    {
        if (x.size() == 1)
        {
            return x[0];
        }
        else
        {
            return -1;
        }
    }

    T lcm = calc_lcm(x[0], x[1]);
    for (long long i = 2; i < x.size(); i++)
    {
        lcm = calc_lcm(lcm, x[i]);
    }
    return lcm;
}

template <typename T, typename U>
T power(T x, U y)
{
    T ret;
    ret = 1;
    while (y > 0)
    {
        if ((y & 1) > 0)
        {
            ret *= x;
        }
        x *= x;
        y >>= 1;
    }
    return ret;
}

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

    vector<long long> a(N);
    for (long long &aa : a)
    {
        cin >> aa;
        aa /= 2;
    }

    if (!valid(a))
    {
        cout << 0 << endl;
        return 0;
    }

    long long ans = ((M / calc_multi_lcm(a)) + 1) / 2;
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:134:16: error: could not convert 'a' from 'vector<long long int>' to 'vector<int>'
  134 |     if (!valid(a))
      |                ^
      |                |
      |                vector<long long int>
Language: C++

#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
//#include<bits/stdc++.h>
#include<cstdio>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

//あー結局わからない

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

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


	int N = getint(), M = getint();

	ll lcm = getint();

	bool dame = 0;
	ll a, g, bai;

	rep1(i, N - 1) {
		a = getint();
		g = __gcd(lcm, a);
		bai = a / g;
		if (lcm > 2e9 || !(bai & lcm / g & 1)) {
			dame = 1;
			break;
		}
		lcm = lcm * bai;
	}

	if (dame) printf("0\n");
	else {
		ll kotae = (lcm / 2 + M) / lcm;
		printf("%lld\n", kotae);
	}

	Would you please return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:21: error: '__gcd' was not declared in this scope; did you mean '__gid_t'?
   50 |                 g = __gcd(lcm, a);
      |                     ^~~~~
      |                     __gid_t
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define ll long long
using namespace std;
int main()
{
    int n,m;
    cin >> n >> m;
    vector<int> a(n);
    rep(i,n){
        cin >> a[i];
        a[i] = k/2;
    }
    int l = 0;
    while(a[0]%2==0){
        l++;
        a[0] /= 2;
    }
    rep(i,n-1){
        int x=0;
        while (a[i+1] % 2 == 0)
        {
            x++;
            a[i+1] /= 2;
        }
        if (x!= l)
        {
            cout << 0 << endl;
            return 0;
        }
    }
    ll g = a[0];
    rep(i,n-1){
        int r = __gcd(g, (ll)a[i + 1]);
        g = g * a[i + 1] / r;
    }
    int ans = 0;
    ans = (m / g + 1) / 2;
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 'k' was not declared in this scope
   12 |         a[i] = k/2;
      |                ^
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	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(){
  ll n,m;
  cin>>n>>m;
  vll a(n);
  vll b(n);
  ll ans=0;
  rep(i,n){
    cin>>a[i];
    b[i]=a[i]/2;
  }
  ll cu=0;
  while(b[0]%2==0){
    if(b[0]%2==0){
      cu++;
      b[0]/=2;
    }
  }
  rep(i,n){
    ll ccu=0;
    while(b[i]%2==0){
      if(b[i]%2==0){
        ccu++;
        b[i]/=2;
      }
    }
    if(cu!=ccu){
      COUT(0);
      return 0;
    }
  } 
  m>>=ccu;
    ll j=b[0];
    for(int i=1;i<n;i++){
      j=lcm(j,b[i]);
    }
    if(j>m) COUT(0);
    else{
      ll c=(m-j)/(2*j)+1;
      COUT(c);
    }
   
    
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:78:7: error: 'ccu' was not declared in this scope; did you mean 'cu'?
   78 |   m>>=ccu;
      |       ^~~
      |       cu
Language: C++

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

int64_t lcm(int64_t a, int64_t b){
  int64_t c = max(a, b), d = min(a, b), g;
  for(int i = 1; i <= pow(d, 0.5); ++i){
    if(d % i == 0 && c % (d / i) == 0){
      g = d / i;
      break;
    }
  }
  return c / g * d;
}

int64_t div2(int64_t n){
  int64_t c = 0;
  while(n % 2 == 0){
    ++c;
    n /= 2;
  }
  return c;
}

int main() {
  int64_t n, m, d = 1;
  cin >> n >> m;
  bool b = 1;
  vector<int64_t> v(n);
  for(int i = 0; i < n; ++i){
    cin >> v[i];
    v[i] /= 2;
    //if(div2(v[i]) != div2(v[0])){
      //b = 0;
      //break;
    }
    d = lcm(d, v[i]);
    if(d > m) break;
  }
  if(b) cout << ((m / d) + 1) / 2 << endl;
  else cout << 0 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:18: error: 'i' was not declared in this scope
   37 |     d = lcm(d, v[i]);
      |                  ^
a.cc:38:15: error: break statement not within loop or switch
   38 |     if(d > m) break;
      |               ^~~~~
a.cc: At global scope:
a.cc:40:3: error: expected unqualified-id before 'if'
   40 |   if(b) cout << ((m / d) + 1) / 2 << endl;
      |   ^~
a.cc:41:3: error: expected unqualified-id before 'else'
   41 |   else cout << 0 << endl;
      |   ^~~~
a.cc:42:1: error: expected declaration before '}' token
   42 | }
      | ^
Language: C++

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

ll gcd(ll a, ll b) {
    ll = c;
    if (a<b) {
        c = b;
        b = a;
        a = c;
    }

    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(void) {
    ll N, M;
    cin >> N >> M;

    vector<ll> A(N);
    ll a;
    for(int i=0;i<N;i++) {
        cin >> a;
        A.at(i)=a/2;
    }

    ll L=A.at(0);
    for(int i=1;i<N;i++) {
        L = lcm(L, A.at(i));
    }
    
    ll now = L, ans = 0;
    while(now<=M) {
        ans++;
        now += 2*L;
    }

    cout << ans << endl;

    return (0);
}


Compiler output:
a.cc: In function 'll gcd(ll, ll)':
a.cc:6:8: error: expected unqualified-id before '=' token
    6 |     ll = c;
      |        ^
a.cc:8:9: error: 'c' was not declared in this scope
    8 |         c = b;
      |         ^
Language: C++

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

int lcm(int64_t a, int64_t b){
  int64_t c = max(a, b), d = min(a, b), g;
  for(int i = 1; i < pow(d, 0.5); ++i){
    if(d % i == 0){
      if(c % (d / i) == 0){
        g = d / i;
        break;
      }
    }
  }
  return c / g * d;
}

int div2(int64_t n){
  int c = 0;
  while(n % 2 == 0){
    ++c;
    n /= 2;
  }
  return c;
}

int main() {
  int64_t n, m, d = 1;
  cin >> n >> m;
  bool b = 1;
  vector<int64_t> v(n);
  for(int i = 0; i < n; ++i){
    cin >> v[i];
    v[i] /= 2;
    if((div2(v[i]) != div2(v[0])){
      b = 0;
      break;
    }
    d = lcm(d, v[i]);
    if(d > m) break;
  }
  if(b) cout << ((m / d) + 1) / 2 << endl;
  else cout << 0 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:34: error: expected ';' before '{' token
   35 |     if((div2(v[i]) != div2(v[0])){
      |                                  ^
      |                                  ;
a.cc:39:21: error: expected ')' before ';' token
   39 |     d = lcm(d, v[i]);
      |                     ^
      |                     )
a.cc:35:7: note: to match this '('
   35 |     if((div2(v[i]) != div2(v[0])){
      |       ^
Language: C++

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

int lcm(int64_t a, int64_t b){
  int64_t c = max(a, b), d = min(a, b), g;
  for(int i = 1; i < pow(d, 0.5); ++i){
    if(d % i == 0){
      if(c % (d / i) == 0){
        g = d / i;
        break;
      }
    }
  }
  return c / g * d;
}

int div2(int64_t n){
  c = 0;
  while(n % 2 == 0){
    ++c;
    n /= 2;
  }
  return c;
}

int main() {
  int64_t n, m, d = 1;
  cin >> n >> m;
  bool b = 1;
  vector<int64_t> v(n);
  for(int i = 0; i < n; ++i){
    cin >> v[i];
    v[i] /= 2;
    if((div2(v[i]) != div2(v[0])){
      b = 0;
      break;
    }
    d = lcm(d, v[i]);
    if(d > m) break;
  }
  if(b) cout << ((m / d) + 1) / 2 << endl;
  else cout << 0 << endl;
}

Compiler output:
a.cc: In function 'int div2(int64_t)':
a.cc:19:3: error: 'c' was not declared in this scope
   19 |   c = 0;
      |   ^
a.cc: In function 'int main()':
a.cc:35:34: error: expected ';' before '{' token
   35 |     if((div2(v[i]) != div2(v[0])){
      |                                  ^
      |                                  ;
a.cc:39:21: error: expected ')' before ';' token
   39 |     d = lcm(d, v[i]);
      |                     ^
      |                     )
a.cc:35:7: note: to match this '('
   35 |     if((div2(v[i]) != div2(v[0])){
      |       ^