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

#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

using namespace std;

using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;

constexpr char newl = '\n';
constexpr double eps = 1e-10;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = ((b)-1); i >=(a); i--)
#define RF0(i,b) RFO(i,0,b)
//#define fi first
//#define se second
#define debug(x) cout << #x << ": " << x << '\n';
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()

template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
template<class T> void Print(vector<T> v) {
  F0R(i, v.size()) {
    cout << v[i] << ' ';
  }
  cout << newl;
}

#if 1

#include "ImprovedEratosthenes.h"
#include "PrimeFactorization.h"

// INSERT ABOVE HERE
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  // 整数列 A を全て 2 で割った整数列 B = b1, b2,...,bN
  // bk * (2p + 1) = X
  // つまりどの数にも奇数をかけて得られる最小公倍数がX
  // B に偶数が含まれていた場合、個数は 0 個
  // そうでない場合、最初の最小公倍数を m とすると、m, 3m, 5m, 7m... が答えになるのでそれを数える
  
  int N, M;
  cin >> N >> M;

  map<int, int> mlcm;

  F0R(i, N) {
    int a; cin >> a;
    auto pf = countAllElements(doPrimeFactorization(a/2));
    for (auto p : pf) {
      chmax(mlcm[p.first], p.second);
    }
  }

  i64 result = 0;
  if (mlcm[2] > 0) {
    result = 0;
  }
  else {
    i64 lcm = 1;
    for (auto p : mlcm) {
      lcm *= pow<i64>(p.first, p.second);
    }

    result = (M / lcm + 1) / 2;
  }

  cout << result;
}
#endif


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

#include <bits/stdc++.h>
using namespace std;
int main(){
long long H,W,c=0; cin>>H>>W;
long long counter=0;
long long a[H];
long long aco=0;
long long bco=0;
cin>>a[0];
long long counter1=counter;
long long counter2;
long long answer=0;
while(a[0]%2==0){
aco++;
a[0]/=2;}
for(long long i=1;i<H;i++){
cin>>a[i];
while(a[i]%2==0){
bco++;
a[i]/=2;}
if(aco!=bco){
c=1;
goto asd;
bco=0;}
for(long long i=0;i<H;i++){
cin>>counter;
counter2=__gcd(counter1,counter);
answer=counter*counter1/counter2;
counter1=answer;}
asd:
if(c==1)
cout<<0<<endl;
else
cout<<(W+answer/2)/answer<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:34: error: expected '}' at end of input
   34 | cout<<(W+answer/2)/answer<<endl;}
      |                                  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
long long H,W,c=0; cin>>H>>W;
long long counter=0;
long long a[H];
long long aco=0;
long long bco=0;
cin>>a[0];
while(a[0]%2==0){
aco++;
a[0]/=2;}
for(long long i=1;i<H;i++){
cin>>a[i];
while(a[i]%2==0){
bco++;
a[i]/=2;}
if(aco!=bco){
c=1;
goto asd;}
bco=0;}
long long counter1=counter;
long long counter2;
long long answer=0;
for(long long i=0;i<H;i++){
cin>>counter;
counter2=__gcd(counter1,counter);
answer=counter*counter1/counter2;
counter1=answer;}
asd:
if(c==1)
cout<<0<<endl;
else
cout<<(W+answer/2)/answer<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:1: error: jump to label 'asd'
   30 | asd:
      | ^~~
a.cc:20:6: note:   from here
   20 | goto asd;}
      |      ^~~
a.cc:24:11: note:   crosses initialization of 'long long int answer'
   24 | long long answer=0;
      |           ^~~~~~
a.cc:22:11: note:   crosses initialization of 'long long int counter1'
   22 | long long counter1=counter;
      |           ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
long long H,W; cin>>H>>W;
long long counter=0;
cin>>counter;
long long counter1=counter;
long long counter2;
long long answer=0;
for(long long i=0;i<H;i++){
cin>>counter;
counter2=_gcd(counter1,counter);
answer=counter*counter1/counter2;
counter1=answer;}
cout<<W/answer<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: '_gcd' was not declared in this scope
   12 | counter2=_gcd(counter1,counter);
      |          ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
long long H,W; cin>>H>>W;
long long counter=0;
cin>>counter;
long long counter1=counter;
long long counter2;
long long answer=0;
for(long long i=0;i<H;i++){
cin>>counter;
counter2=GCD(counter1,counter);
answer=counter*counter1/counter2;
counter1=answer;}
cout<<W/answer<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'GCD' was not declared in this scope
   12 | counter2=GCD(counter1,counter);
      |          ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
long long H,W; cin>>H>>W;
long long counter=0;
cin>>counter;
long long counter1=counter;
long long counter2;
long long answer=0;
for(long long i=0;i<H;i++){
cin>>counter;
counter2=GCD(counter1,counter);
answer=counter*counter1/counter2;
counter1=answer;}
cout<<M/answer<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'GCD' was not declared in this scope
   12 | counter2=GCD(counter1,counter);
      |          ^~~
a.cc:15:7: error: 'M' was not declared in this scope
   15 | cout<<M/answer<<endl;}
      |       ^
Language: C++

#include <iostream>
using namespace std;

int main(){
	int n, m;
  	cin >> n >> m;
  	int a[n];
  	for(int i=0;i<n;i++){
    	cin>>a[n];
    }
  	
  	int x[m]={0};
  	for(double i=1;i<=m;i++){
    	for(int j=0;j<n;j++){
          	int p=0;
          	while(1){
              	int x=a[j]*(p+0.5);
              	int o=(int)i;
              	if(i==x) x[o]=1;
              	else if(i<x) break;
              	else p++;
            }
        }
    }
  	int cnt=0;
  	for(int i=0;i<m;i++){
    	if(x[i]==1) cnt++;
    }
  
  	cout<<cnt<<endl;
  
  	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:27: error: invalid types 'int[int]' for array subscript
   19 |                 if(i==x) x[o]=1;
      |                           ^
Language: C++

#include <iostream>
using namespace std;

int main(){
	int n, m;
  	cin >> n >> m;
  	int a[n];
  	for(int i=0;i<n;i++){
    	cin>>a[n];
    }
  	
  	int x[m]={0};
  	for(double i=1;i<=m;i++){
    	for(int j=0;j<n;j++){
          	int p=0;
          	while(1){
              	int x=a[j]*(p+0.5);
              	if(i==x) x[(int)i-1]=1;
              	else if(i<x) break;
              	else p++;
            }
        }
    }
  	int cnt=0;
  	for(int i=0;i<m;i++){
    	if(x[i]==1) cnt++;
    }
  
  	cout<<cnt<<endl;
  
  	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:27: error: invalid types 'int[int]' for array subscript
   18 |                 if(i==x) x[(int)i-1]=1;
      |                           ^
Language: C++

#include <iostream>
using namespace std;

int main(){
	int n, m;
  	cin >> n >> m;
  	int a[n];
  	for(int i=0;i<n;i++){
    	cin>>a[n];
    }
  	
  	int x[m]={0};
  	for(double i=1;i<=m;i++){
    	for(int j=0;j<n;j++){
          	int p=0;
          	while(1){
              	int x=a[j]*(p+0.5);
              	if(i==x) x[i-1]=1;
              	else if(i<x) break;
              	else p++;
            }
        }
    }
  	int cnt=0;
  	for(int i=0;i<m;i++){
    	if(x[i]==1) cnt++;
    }
  
  	cout<<cnt<<endl;
  
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:27: error: invalid types 'int[double]' for array subscript
   18 |                 if(i==x) x[i-1]=1;
      |                           ^
Language: C++

#include <algorithm>
#include <cstdio>

#define int long long
#define dotimes(i, n) for (int i = 0; i < (n); i++)

using namespace std;

int rint() {
  int n;
  scanf("%lld", &n);
  return n;
}

void wint(int n) {
  printf("%lld\n", n);
}

signed main() {
  int N = rint();
  int M = rint();
  // b_k := a_k / 2
  // a_k * (p + 0.5) = b_k * (2 * p + 1)
  // So semi-cm of b_k
  // - doesn't exist if b_k is even for any k
  // - is the LCM of (b_k) otherwise
  int b[N];
  dotimes(i, N)
    b[i] = rint() / 2;
  dotimes(i, N)
    if (b[i] % 2 == 0) {
      wint(0);
      return 0;
    }
  int p = b[0];
  dotimes(i, N-1) {
    int q = b[i+1];
    p = p / __gcd(p, q) * q
  }
  wint(M / p);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:28: error: expected ';' before '}' token
   38 |     p = p / __gcd(p, q) * q
      |                            ^
      |                            ;
   39 |   }
      |   ~
Language: C++

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

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

int main(){
    ll N,M;
    ll num=1;
    cin >> N >> M;
    vector<ll> a(N);
    ll tmp;
    ll ans=0;
    bool flag=false;

    rep(i,N){
        cin >> tmp;
        a[i]=tmp;
    }

    while(a[0]%2==0){
        rep(i,N){
            if(a[i]%2!=0){
                cout << 0 << endl;
                return 0;
            }
            a[i] /=2;
        }
    }

    rep(i,N){
        if(a[i]%2==0) flag = ture;
    }
    rep(i,N){
        num = lcm(num,a[i]);
        if(num>M){
            flag=true;
        }
    }


    if(flag){
        cout << ans << endl;
        return 0;
    }

    ll cur=num;
    while(cur<=M){
        cur+=(2*num);
        ans++;
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:30: error: 'ture' was not declared in this scope
   34 |         if(a[i]%2==0) flag = ture;
      |                              ^~~~
Language: C++

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

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

int main(){
    ll N,M;
    ll num=1;
    cin >> N >> M;
    vector<ll> a(N);
    ll tmp;
    ll ans=0;
    bool flag=false;

    rep(i,N){
        cin >> tmp;
        a[i]=tmp;
    }

    while(a[0]%2==0){
        rep(i,N){
            if(a[i]%2!=0){
                cout << 0 << endl;
                return 0;
            }
            a[i] /=2;
        }
    }

    rep(i,N) if(a[i]%2==0) flag = ture;
    rep(i,N){
        num = lcm(num,a[i]);
        if(num>M){
            flag=true;
        }
    }


    if(flag){
        cout << ans << endl;
        return 0;
    }

    ll cur=num;
    while(cur<=M){
        cur+=(2*num);
        ans++;
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:35: error: 'ture' was not declared in this scope
   33 |     rep(i,N) if(a[i]%2==0) flag = ture;
      |                                   ^~~~
Language: C++

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

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

int main(){
    ll N,M;
    ll num=1;
    cin >> N >> M;
    vector<ll> a(N);
    ll tmp;
    ll ans=0;

    rep(i,N){
        cin >> tmp;
        a[i]=tmp;
    }

    while(a[0]%2==0){
        rep(i,N){
            if(a[i]%2!=0){
                cout << 0 << endl;
                return 0;
            }
            a[i] /=2;
        }
    }
    rep(i,N){
        num = lcm(num,a[i]);
        if(num>M){
            flag=true;
        }
    }



    if(flag){
        cout << ans << endl;
        return 0;
    }

    ll cur=num;
    while(cur<=M){
        cur+=(2*num);
        ans++;
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:13: error: 'flag' was not declared in this scope
   34 |             flag=true;
      |             ^~~~
a.cc:40:8: error: 'flag' was not declared in this scope
   40 |     if(flag){
      |        ^~~~
Language: C++

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

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

int main(){
    ll N,M;
    ll num=1;
    cin >> N >> M;
    vector<ll> a(N);
    ll tmp;
    ll ans=0;

    rep(i,N){
        cin >> tmp;
        a[i]=tmp;
    }

    while(a[0]%2==0)
        rep(i,N){
            if(a[i]%2!=0){
                cout << 0 << endl;
                return 0;
            }
            a[i] /=2;
        }
}
    rep(i,N){
        num = lcm(num,a[i]);
        if(num>M){
            flag=true;
        }
    }



    if(flag){
        cout << ans << endl;
        return 0;
    }

    ll cur=num;
    while(cur<=M){
        cur+=(2*num);
        ans++;
    }

    cout << ans << endl;
}

Compiler output:
a.cc:4:18: error: expected unqualified-id before 'for'
    4 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
      |                  ^~~
a.cc:31:5: note: in expansion of macro 'rep'
   31 |     rep(i,N){
      |     ^~~
a.cc:31:9: error: 'i' does not name a type
   31 |     rep(i,N){
      |         ^
a.cc:4:30: note: in definition of macro 'rep'
    4 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
      |                              ^
a.cc:31:9: error: 'i' does not name a type
   31 |     rep(i,N){
      |         ^
a.cc:4:41: note: in definition of macro 'rep'
    4 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
      |                                         ^
a.cc:40:5: error: expected unqualified-id before 'if'
   40 |     if(flag){
      |     ^~
a.cc:45:12: error: 'num' was not declared in this scope; did you mean 'enum'?
   45 |     ll cur=num;
      |            ^~~
      |            enum
a.cc:46:5: error: expected unqualified-id before 'while'
   46 |     while(cur<=M){
      |     ^~~~~
a.cc:51:5: error: 'cout' does not name a type
   51 |     cout << ans << endl;
      |     ^~~~
a.cc:52:1: error: expected declaration before '}' token
   52 | }
      | ^
Language: C++

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

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

int main(){
    ll N,M;
    ll num=1;
    cin >> N >> M;
    vector<ll> a(N);
    ll tmp;
    ll ans=0;

    rep(i,N){
        cin >> tmp;
        cnt=0;
        a[i]=tmp;
    }

    while(a[0]%2==0)
        rep(i,N){
            if(a[i]%2!=0){
                cout << 0 << endl;
                return 0;
            }
            a[i] /=2;
        }
}
    rep(i,N){
        num = lcm(num,a[i]);
        if(num>M){
            flag=true;
        }
    }



    if(flag){
        cout << ans << endl;
        return 0;
    }

    ll cur=num;
    while(cur<=M){
        cur+=(2*num);
        ans++;
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   19 |         cnt=0;
      |         ^~~
      |         int
a.cc: At global scope:
a.cc:4:18: error: expected unqualified-id before 'for'
    4 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
      |                  ^~~
a.cc:32:5: note: in expansion of macro 'rep'
   32 |     rep(i,N){
      |     ^~~
a.cc:32:9: error: 'i' does not name a type
   32 |     rep(i,N){
      |         ^
a.cc:4:30: note: in definition of macro 'rep'
    4 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
      |                              ^
a.cc:32:9: error: 'i' does not name a type
   32 |     rep(i,N){
      |         ^
a.cc:4:41: note: in definition of macro 'rep'
    4 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
      |                                         ^
a.cc:41:5: error: expected unqualified-id before 'if'
   41 |     if(flag){
      |     ^~
a.cc:46:12: error: 'num' was not declared in this scope; did you mean 'enum'?
   46 |     ll cur=num;
      |            ^~~
      |            enum
a.cc:47:5: error: expected unqualified-id before 'while'
   47 |     while(cur<=M){
      |     ^~~~~
a.cc:52:5: error: 'cout' does not name a type
   52 |     cout << ans << endl;
      |     ^~~~
a.cc:53:1: error: expected declaration before '}' token
   53 | }
      | ^
Language: C++

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

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

int main(){
    ll N,M;
    ll num=1;
    cin >> N >> M;
    vector<ll> a(N);
    ll tmp;
    ll ans=0;
    int cnt;
    vector<int> cntv(N,0);
    bool flag=false;
    rep(i,N){
        cin >> tmp;
        cnt=0;
        a[i]=tmp;
        while(tmp%2==0){
            tmp/=2;
            cnt++;
        }

        a[i]/=(pow(2,cnt));    
        cntv[i]=cnt;

        if(i>0){
            if(cntv[i-1]!=cntv[i])) flag=true;
        }

        if(!flag){
            num = lcm(num,a[i]);
            if(num>M){
                flag=true;
            }
        }
    }

    if(flag){
        cout << ans << endl;
        return 0;
    }

    ll cur=num;
    while(cur<=M){
        cur+=(2*num);
        ans++;
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:35: error: expected primary-expression before ')' token
   32 |             if(cntv[i-1]!=cntv[i])) flag=true;
      |                                   ^
Language: C++

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

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

int main(){
    ll N,M;
    ll num=1;
    cin >> N >> M;
    vector<ll> a(N);
    ll tmp;
    ll ans=0;
    int cnt;
    vector<int> cntv(N,0);
    bool flag=false;
    rep(i,N){
        cin >> tmp;
        cnt=0;
        a[i]=tmp;
        while(tmp%2=0){
            tmp/=2;
            cnt++;
        }
        a[i]/=cnt;
        cntv[i]=cnt;

        if(i>0&&cntv[i-1]!=cntv[i]) flag=true;

        if(!flag){
            num = lcm(num,a[i]);
            if(num>M){
                flag=true;
            }
        }
    }

    if(flag){
        cout << ans << endl;
        return 0;
    }

    ll cur=num;
    while(cur<=M){
        cur+=(2*num);
        ans++;
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:18: error: lvalue required as left operand of assignment
   23 |         while(tmp%2=0){
      |               ~~~^~
Language: C++

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

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

int main(){
    ll N,M;
    ll num=1;
    cin >> N >> M;
    vector<ll> a(N);
    ll tmp;
    ll ans=0;
    vector<int> cntv(N,0);
    bool flag=false;
    rep(i,N){
        cin >> tmp;
        cnt=0;
        a[i]=tmp;
        while(tmp%2=0){
            tmp/=2;
            cnt++;
        }
        a[i]/=cnt;
        cntv[i]=cnt;

        if(i>0&&cntv[i-1]!=cntv[i]) flag=true;

        if(!flag){
            num = lcm(num,a[i]);
            if(num>M){
                flag=true;
            }
        }
    }

    if(flag){
        cout << ans << endl;
        return 0;
    }

    ll cur=num;
    while(cur<=M){
        cur+=(2*num);
        ans++;
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'cnt' was not declared in this scope; did you mean 'cntv'?
   20 |         cnt=0;
      |         ^~~
      |         cntv
a.cc:22:18: error: lvalue required as left operand of assignment
   22 |         while(tmp%2=0){
      |               ~~~^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int64_t gcd(int64_t x,int64_t y){
if(x==0 || y==0)
  return max(x,y);
  else{
  if(x<y)
    return gcd(x,y%x);
    else if(y<x)
      return gcd(y,x%y);
    else
      return x;
  }

}
int64_t lcm(int64_t x,int64_t y){
return (x*y)/gcd(x,y);
}
int main(){
int64_t N,M;
  cin>>N>>M;
  set<int>S;
  vector<int64_t>A(N);
  for(int64_t i=0;i<N;i++){
  int64_t a;
    cin>>a;
    a/=2;
     A.at(i)=a;
    int64_t s=0;
    for(int i=0; ;i++){
     if(a%2!=0){
        s=i; break;
     }else
         a/2=0;
    }
    S.insert(s);
  }int m=S.size();
  if(m!=1)
    cout<<0<<endl;
  else{
    int64_t l=A.at(0);
    for(int i=1;i<N;i++)
      l=lcm(l,A.at(i));
    int64_t ans=((M/l)+1)/2;
    cout<<ans<<endl;
  
  }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:11: error: lvalue required as left operand of assignment
   34 |          a/2=0;
      |          ~^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int64_t gcd(int64_t x,int64_t y){
if(x==0 || y==0)
  return max(x,y);
  else{
  if(x<y)
    return gcd(x,y%x);
    else if(y<x)
      return gcd(y,x%y);
    else
      return x;
  }

}
int64_t lcm(int64_t x,int64_t y){
return (x*y)/gcd(x,y);
}
int main(){
int64_t N,M;
  cin>>N>>M;
  bool x=true;
  vector<int64_t>A(N);
  for(int64_t i=0;i<N;i++){
  int64_t a;
    cin>>a;
    a/=2;
    if(a%2==1){x=false; break;}
     A.at(i)=a;
  }if(!x)
    cout<<0<<endl;
  else{
    int64_t l=A.at(0);
    for(int i=1;i<N;i++)
      l=lcm(l,A.at(i));
    int64_t ans=((M/lcm)+1)/2;
    cout<<ans<<endl;
  
  }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:20: error: invalid operands of types 'int64_t' {aka 'long int'} and '<unresolved overloaded function type>' to binary 'operator/'
   36 |     int64_t ans=((M/lcm)+1)/2;
      |                   ~^~~~
Language: C

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define dump(x)  cout << #x << " = " << (x) << endl;	//debug
#define SZ(x) ((int)(x).size())
#define REP(i, n) for(ll i = 0; i < (n); i++)
#define REPR(i, n) for (ll i = (n); i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)

ll GCD(ll a, ll b)
{
	if (a < b) {
		a ^= b;
		b ^= a;
		a ^= b;
	}

	return b ? GCD(b, a % b) : a;
}

ll LCM(ll a, ll b)
{
	return a * b / GCD(a, b);
}

int main() {
	ll n,m;
	ll res = 0;
	scanf("%lld", &n);
	scanf("%lld", &m);
	ll lcm_temp = 1;
	FOR(i, 1, n) {
		ll temp;
		scanf("%lld", &temp);
		temp /= 2;
		lcm_temp = LCM(lcm_temp, temp);
	}
	res = m / lcm_temp;
	if (res % 2 == 1) {
		res++;
	}
	res /= 2;
	printf("%lld\n", res);
	return(0);
}

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

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<iomanip>
#define rip(i,n) for(int i=0;i<n;i++)
#define ll long long
#define lb long double
#define vec vector<int>
#define vec2 vector<vector<int>>
#define set setprecision
#define mod 1000000007
#define pi 3.14159265
#include<numeric>
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);
}
ll pow(ll a, ll b) {	ll k = b % 30000, h = b / 30000, s = 1;
	rip(i, 30000)s = (s * a) % mod; ll j = 1;
	if (h != 0)rip(i, h)j = j * s % mod;
	if (k != 0)rip(i, k)j = j * a % mod;
	return(j);}
ll ketasuu(ll n) {for (int i = 1; i < 100; i++)if (pow(10, i - 1) <= n && n < pow(10, i)) {return (i);break;}}
int main() {
	int n, m;
	cin >> n >> m;
	vector<int> a(n);
	rip(i, n)cin >> a[i];
	vector<int> b;
	int gg = a[0] / 2;
	rip(i, n) {
		b[i] = a[i] / 2;
		gg = gcd(lcd, b[i]);
	}
	int k = m / gg;
	cout << ((k-1) / 2) - 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:26: error: 'lcd' was not declared in this scope; did you mean 'lcm'?
   42 |                 gg = gcd(lcd, b[i]);
      |                          ^~~
      |                          lcm
a.cc: In function 'long long int ketasuu(long long int)':
a.cc:32:110: warning: control reaches end of non-void function [-Wreturn-type]
   32 | ll ketasuu(ll n) {for (int i = 1; i < 100; i++)if (pow(10, i - 1) <= n && n < pow(10, i)) {return (i);break;}}
      |                                                                                                              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define all(x) (x).begin(),(x).end()
#define V vector
typedef V<int> vi;
typedef V<vi> vvi;
typedef long long ll;
typedef pair<int, int> P;
constexpr auto INF = INT_MAX / 2;
constexpr auto LINF = 5000000000000000;
constexpr auto MOD = 1000000007;

int gcd(ll i, ll j) {
	if (i < j)swap(i, j);
	if (i % j)return gcd(j, i % j);
	return j;
}

int main() {

	int n, m;
	cin >> n >> m;
	vi a(n);
	ll lcm = 1;
	rep(i, n) {
		cin >> a[i];
		if (lcm <= LINF)lcm = lcm * a[i] / gcd(lcm, a[i]);
	}

	if (lcm >= LINF)cout << 0 << endl;
	else {
		ll k = 2 * m;
		k /= lcm;
		cout << (k + 1) / 2 << endl;
	}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:10: error: expected '}' at end of input
   37 |         }
      |          ^
a.cc:21:12: note: to match this '{'
   21 | int main() {
      |            ^
Language: C++

#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;

//マクロ
#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() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000
#define NCK_MAX 510000
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

int main(int argc, char const *argv[]) {
  ll n,m; std::cin >> n >> m;
  std::vector<;;> a(n,0); REP(i,n) std::cin >> a[i];
  ll _gcd, LeastCommonMultipule;
  // init
  _gcd=__gcd(a[0],a[1]);
  LeastCommonMultipule=a[0]*a[1]/_gcd;
  if (n > 2) {
    FOR(i,2,n-1) {
      _gcd=__gcd(LeastCommonMultipule,a[i]);
      LeastCommonMultipule=LeastCommonMultipule*a[i]/_gcd;
    }
  }

  ll ans;
  ll temp = m-LeastCommonMultipule/2;
  ans = temp/LeastCommonMultipule;
  if (m < LeastCommonMultipule/2) std::cout << 0 << '\n';
  else std::cout << ans+1 << '\n';
  return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:41:14: error: template argument 1 is invalid
   41 |   std::vector<;;> a(n,0); REP(i,n) std::cin >> a[i];
      |              ^
a.cc:41:14: error: template argument 2 is invalid
a.cc:41:17: error: expected primary-expression before '>' token
   41 |   std::vector<;;> a(n,0); REP(i,n) std::cin >> a[i];
      |                 ^
a.cc:41:19: error: 'a' was not declared in this scope
   41 |   std::vector<;;> a(n,0); REP(i,n) std::cin >> a[i];
      |                   ^
Language: C

#include<stdio.h>
int main()
{
long int a,b,c,i,j,f,g;
  g=0;
  scanf("%d %d",&a,&b);
long int d[a],e[a];
for(i=0;i<a;++i)
  {
  scanf("%d",&d[i]);
  e[j]=d[j]/2;}
for(i=0;i<b+1;++i)
  {c=0;
   for(j=0;j<a;++j)
     {
     if(i>=e[j]) {f=i-e[j];
                  if(f%d[j]==0) c=c+1
                 }
     }
   if(c==a) g=g+1;

   }



return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:38: error: expected ';' before '}' token
   17 |                   if(f%d[j]==0) c=c+1
      |                                      ^
      |                                      ;
   18 |                  }
      |                  ~
Language: C++

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

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

void cklcm (long long &x, long long a) {
	x = lcm(x, a);
}

signed main () {
	long long n, m;
	cin >> n >> m;
	vector < long long > a(n);
	long long cur = 1;
	for (long long &x: a) {
		cin >> x;
		cklcm(cur, x / 2);
		if (cur > m) {
			cout << "0\n";
			return 0;
		}
	}
	for (long long &x: a) {
		if (cur % x != (x / 2)) {
			cout << "0\n";
			return 0;
		}
	}
	if (fucked_up)
		cout << "0\n";
	else {
		long long ans = m / (cur * 2);
		if (m % (cur * 2) >= cur)
			++ans;
		cout << ans << '\n';
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:13: error: 'fucked_up' was not declared in this scope
   31 |         if (fucked_up)
      |             ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef long long ll;
typedef pair<ll, ll> pll;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define foro(i, n) for(i=0; i<n; i++)
#define forl(i, n) for(i=1; i<=n; i++)
#define x first
#define y second
constexpr int INF = 1e9 + 1;
constexpr ll LLINF = 1e18 + 1;


int main()
{
	int i, j, k, l, tmp;
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	ll n, m, t;
	ll lc=1;
	cin >> n >> m;
	foro(i, n){
		cin >> t;
		if(!(t&1))
			lc = __lcm(lc, t>>1);
	}
	printf("%lld\n", m / lc - m / (2 * lc));
}



Compiler output:
a.cc: In function 'int main()':
a.cc:31:30: error: '__lcm' was not declared in this scope
   31 |                         lc = __lcm(lc, t>>1);
      |                              ^~~~~
Language: C++

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define int long long
int gcd(int a,int b){
    if(a>b){swap(a,b);}
    if(a==0){return b;}
    else{return gcd(b%a,a);}
}

int ord2(int n){
    int ret =0;
    while(n%2==0){
        n/=2;
        ret++;
    }
    return ret;
}
signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n,m,ans=0,L=1,ord,d;
    cin>>n>>m;
    vector<int>a(n);
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    ord=ord2(a[0]);
    d=(1<<ord);
    for(int i=0;i<n;i++){
        if((a[i]/d)%2==0){cout<<0<<endl;return 0;}
        a[i]/=d;
        int new =(L/gcd(L,a[i]))*a[i];
        if(new<0||L>new){cout<<0<<endl;return 0;}
        else{L = new;}
    }
    L*=d/2;
    if((L>m)||(L<=0)){cout<<0;return 0;}
    cout<<(m+L)/(2*L)<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:13: error: expected unqualified-id before 'new'
   33 |         int new =(L/gcd(L,a[i]))*a[i];
      |             ^~~
a.cc:34:15: error: expected type-specifier before '<' token
   34 |         if(new<0||L>new){cout<<0<<endl;return 0;}
      |               ^
a.cc:34:24: error: expected type-specifier before ')' token
   34 |         if(new<0||L>new){cout<<0<<endl;return 0;}
      |                        ^
a.cc:35:21: error: expected type-specifier before ';' token
   35 |         else{L = new;}
      |                     ^
Language: C++

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;

int ord2(int n){
    int ret =0;
    while(n%2==0){
        n/=2;
        ret++;
    }
    return ret;
}
signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n,m,ans=0,ord,d;
    long long L = 1;
    cin>>n>>m;
    vector<int>a(n);
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    ord=ord2(a[0]);
    d=(1<<ord);
    for(int i=0;i<n;i++){
        if(ord2(a[i])!=ord){cout<<0<<endl;return 0;}
        else{a[i]/=2;}
    }
    for(int i=0;i<n;i++){
        int tmp = __gcd(L,a[i]);
        L=(L/tmp)*a[i];
    }
    if((L>m)||(L<=0)){cout<<0<<endl;return 0;}
    cout<<(m+L)/(2*L)<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:24: error: no matching function for call to '__gcd(long long int&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   30 |         int tmp = __gcd(L,a[i]);
      |                   ~~~~~^~~~~~~~
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:30:24: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('long long int' and 'int')
   30 |         int tmp = __gcd(L,a[i]);
      |                   ~~~~~^~~~~~~~
Language: C++

#include <vector>
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <map>
using namespace std;

long long main() {
  long long n,m;
  std::cin >> n>>m;
  std::vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    long long temp;
    std::cin >> temp;
    a[i]=temp;
  }

  sort(a.begin(), a.end(), std::greater<long long>() );//降順
  a.erase(std::unique(a.begin(), a.end()), a.end());

  std::vector<long long> ans;

  for (long long p = 0; m >= a[0]*p+a[0]/2 ; p++) {
    ans.push_back(a[0]*p+a[0]/2);
    // std::cout <<"push:"<<ans[p] <<" p:"<<p<< '\n';
  }

  bool flag=false;
  long long k=0;
  long long now=0;
  for (long long i = 1; i < a.size(); i++) {

    flag=false;
    k=0;
    long long max= ans[ans.size()-1];

    for (long long p = 0; max >= a[i]*p+a[i]/2 ; p++) {
      // std::cout <<"k:"<<k<< " p:" <<p<< " now:"<<a[i]*p+a[i]/2<<'\n';
      // std::cout <<"ans[k]:"<<ans[k] << '\n';
      now=a[i]*p+a[i]/2;
      if(now==ans[k])
      {
        // std::cout << "Break:" << ans[k] <<'\n';
        k++;
      }
      else if(now>ans[k])
      {
         // cout << "Erase:" <<ans[k]<< '\n';
         ans.erase(ans.begin() + k);
      }
    }

    // std::cout << now<<":"<<ans[ans.size()-1] << '\n';
    while (now<ans[ans.size()-1]) {
      // std::cout << "超過:" <<ans[ans.size()-1]<< '\n';
      ans.erase(ans.begin() + (ans.size()-1));
      // for (long long l = 0; l < ans.size(); l++) {
      //   std::cout << " :"<<ans[l] << '\n';
      // }
      // std::cout  << '\n';
    }

  }

  // for (long long i = 0; i <ans.size(); i++) {
  //   std::cout <<"ans:"<<ans[i] << '\n';
  // }

  std::cout <<ans.size() << '\n';




  return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C

#include <bits/stdc++.h>
using namespace std;
int GCD(int a,int b){if(b==0)return a;else return GCD(b,a%b);}
int LCM(int a,int b){return a*b/GCD(a,b);}
int main()
{
  int A,N,M,x=1,y,count=0;
  cin>>N>>M;
  while(cin>>A){x=LCM(x,A);}
  y=x;x/=2;
  while(x<M){x+=y;count++;}
  cout<<count<<endl;
}

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

#include<iostream>
#include<algorithm>
#include<limits>
#include<numeric>
#include<cstdint>
#include<set>

int main() {
  int N; int64_t M; std::cin >> N >> M;
  int64_t l = 1;
  std::set<int64_t> s;
  for(int i = 0; i < N; ++i) {
    int A; std::cin >> A; A/=2;
    if(s.count(A) > 0) continue;
    (l /= std::__gcd(l, A)) *= A;
    if(l > M) goto ZERO;
    s.insert(A);
  }
  for(auto A: s) if((l/A)%2 == 0) goto ZERO;

  {
    int64_t ans = M/l; ans = (ans+1)/2;
    std::cout << ans << std::endl;
  }
  return 0;
ZERO:
  std::cout << "0" << std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: no matching function for call to '__gcd(int64_t&, int&)'
   15 |     (l /= std::__gcd(l, A)) *= A;
      |           ~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/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:15:21: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('long int' and 'int')
   15 |     (l /= std::__gcd(l, A)) *= A;
      |           ~~~~~~~~~~^~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<limits>
#include<numeric>
#include<cstdint>

int const MAXN = 1e5;

int64_t A[MAXN];

int main() {
  int N; int64_t M; std::cin >> N >> M;
  for(int i = 0; i < N; ++i) { std::cin >> A[i]; A[i]/=2; }
  int r = 0;
  for(int64_t x = A[0]; x%2==0; x/=2) ++r;
  for(int i = 1; i < N; ++i) {
    int t = 0;
    for(int64_t x = A[0]; x%2==0; x/=2) ++t;
    if(t != r) {
      std::cout << "0" << std::endl;
      return 0;
    }
  }
  int64_t l = A[0];
  if(N > 1) {
    for(int i = 1; i < N; ++i) {
      //l = std::lcm(l, A[i]);
      l = l*A[i]/std::gcd(l, A[i])
      if(l > M) {
        std::cout << "0" << std::endl;
        return 0;
      }
    }
  }
  int64_t ans = M/l; ans = (ans+1)/2;
  std::cout << ans << std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:35: error: expected ';' before 'if'
   28 |       l = l*A[i]/std::gcd(l, A[i])
      |                                   ^
      |                                   ;
   29 |       if(l > M) {
      |       ~~
Language: C++

long long skb(int a, int b) {
    int i = a, j = b;
    if (a > b) swap(a, b);
    while(b%a>0){
        b %= a;
        swap(a, b);
    }
    return i * j / a;
}
int main() {
    int n, m, k, a[100000] = {};
    cin >> n >> m ;
    bool f = 1;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        if (a[i] % 2 == 1 || a[i] % 4 == 0) f = 0;
    }
    int ans;
    long long p = skb(a[0], a[1]);
    if (f) {
        for (int i = 2; i < n; i++) {
            p = skb(p, a[i]);
        }
        if (2 * m / p == 0) ans = 0;
        else if (2 * m / p % 2 == 0) ans = 2 * m / p / 2;
        else ans = 2 * m / p / 2 + 1;
    }
    else ans = 0;
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'long long int skb(int, int)':
a.cc:3:16: error: 'swap' was not declared in this scope
    3 |     if (a > b) swap(a, b);
      |                ^~~~
a.cc:6:9: error: 'swap' was not declared in this scope
    6 |         swap(a, b);
      |         ^~~~
a.cc: In function 'int main()':
a.cc:12:5: error: 'cin' was not declared in this scope
   12 |     cin >> n >> m ;
      |     ^~~
a.cc:29:5: error: 'cout' was not declared in this scope
   29 |     cout << ans << endl;
      |     ^~~~
a.cc:29:20: error: 'endl' was not declared in this scope
   29 |     cout << ans << endl;
      |                    ^~~~
Language: C++

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

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;

#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) (x).begin(),(x).end()
constexpr auto INF = 4000000000;
constexpr auto MOD = 1000000007;

ll gcd(ll i, ll j) {
	if (i < j) swap(i, j);
	if (i % j) return gcd(j, i % j);
	return j;
}


int main() {
	ll n, m;
	cin >> n >> m;
	vector<ll> a(n);
	rep(i, n)cin >> a[i];

	ll lcm=1;
	rep(i, n) {
		lcm = lcm * a[i] / gcd(lcm, a[i]);
		if(lcm>4000000000||lcm<0) { cout << "0" << endl; return 0; }
	}

	m -= lcm / 2;

	if (m < 0) { cout << "0" << endl; return 0; }
	cout << (m + lcm - 1) / lcm << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:36:45: error: expected '}' at end of input
   36 |         cout << (m + lcm - 1) / lcm << endl;
      |                                             ^
a.cc:21:12: note: to match this '{'
   21 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define INF 1000000007
#define LINF (1LL << 60)
#define PI 3.14159265358979

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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; }



i64 n, m, a[101010];
i64 lcm(i64 x, i64 y){
	return x / __gcd(x,y) * y;
}
void solve(){
	cin >> n >> m;
	for(int i = 0; i < n; i++){
		cin >> a[i];
	}
	sort(a,a+n);
		i64 cnt = a[0]/2;
	for(int i = 0; i < n; i++){
		i64 c = lcm(cnt, a[i]/2);
		if((c-cnt) % (cnt*2) != 0){
			cout << 0 << endl;
			return 0;
		}
		cnt = c;
		if(cnt > m){
			cout << 0 << endl;
			return 0;
		}
	}
	
	cout << 1 + (m-cnt)/(cnt*2) << endl;
}

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


Compiler output:
a.cc: In function 'void solve()':
a.cc:34:32: error: return-statement with a value, in function returning 'void' [-fpermissive]
   34 |                         return 0;
      |                                ^
a.cc:39:32: error: return-statement with a value, in function returning 'void' [-fpermissive]
   39 |                         return 0;
      |                                ^
Language: C++

n,m=map(int,input().split())
a = list(map(int, input().split()))

def gcd(a,b):
    if(b==0):
        return a
    else:
        return gcd(b,a%b)
def lcm(a,b):
    return a*b//gcd(a,b)
b=[0]*n
for i in range(n):
    b[i]=a[i]//2
flag=False
f=False
for i in range(n):
    if(b[i]%2!=b[0]%2):
        flag=True
x=1
if(b[0]%2==0):
    f=True
for i in range(n):
    x=lcm(x,b[i])

if(f):
    l=0
else:
    res=m//x+1
    res//=2
print(x)
if(flag):
    print(0)
else:
    print(res)


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


n,m=map(int,input().split())
a = list(map(int, input().split()))

def gcd(a,b):
    if(b==0):
        return a
    else:
        return gcd(b,a%b)
def lcm(a,b):
    return a*b//gcd(a,b)
b=[0]*n
for i in range(n):
    b[i]=a[i]//2
flag=False
for i in range(n):
    if(b[i]%2!=b[0]%2):
        flag=True
x=1
for i in range(n):
    x=lcm(x,b[i])
res=m//x+1
res//=2
print(x)
if(flag):
    print(0)
else:
    print(res)


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

import fractions


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


n, m = map(int, input().split())
v = list(map(int, input().split()))
num = 0
while (v[0] % 2 != 0):
    v[0] //= 2
    num += 1
ans = v[0]
for i in range(n - 1):
    if (v[i + 1] % 2 ** num != 0):
        print(0)
        exit(0)
    v[i+1] //= 2**num
    ans = lcm(ans, v[i + 1])
m //= 2**num
print((m+ans-1)//ans)


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

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) debug(x) debug(y);
#define repn(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) for(int i = 0; i < (int)(a); i++)
#define all(v) v.begin(), v.end() 
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sq(x) ((x) * (x))

template<class T> T gcd(T a, T b){ return ((b == 0) ? a : gcd(b, a % b)); }

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
	int n, m;
	cin >> n >> m;
	vector<ll> a(n);
	rep(i, n) cin >> a[i];
	ll lc = 1;
	rep(i, n) lc = lcm(lc, a[i] / 2);
	rep(i, n){
		if((a[i] / 2) % 2 == 0){
			cout << 0 << endl;
			return 0;
		}
	}
	ll l = 1, r = 1.1e9;
	while(l < r){
		ll mid = (l + r + 1) / 2;
		if(((mid * 2 - 1) * lc) <= m) l = mid;
		else r = mid - 1;
	}
	cout << l << endl;
	return 0;
}
/*
Things to look out for:
	- Integer overflows
	- Array bounds
	- Special cases
Be careful!
*/


Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:3:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::_Vector_base<long long int, std::allocator<long long int> >::_Vector_impl::~_Vector_impl()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = long long int]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:132:14: note: called from here
  132 |       struct _Vector_impl
      |              ^~~~~~~~~~~~
Language: C++

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

ll order2(ll n){
  ll ans=0;
  while(1){
    if(n%2!=0){
      break;
    }else{
      n/=2;
      ans++;
    }
  }
  return ans;
}

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

int main(){
  ll m,n,bunki=0,bunki2=0;
  cin>>n>>m;
  ll a[n],b[n];
  cin>>a[0];
  b[0]=order2(a[0]);
  rep1(i,n){
    cin>>a[i];
    a[i]/=2;
    b[i]=order2(a[i]);
    if(b[i]!=b[0]){
      bunki=1;
    }
  }
  if(bunki){
    cout<<0;
  }else{
    ll lcm=a[0];
    rep1(i,n){
      lcm/=gcd(lcm,a[i]);
      lcm*=a[i];
      if(lcm>m){
        bunki2=1;
        break;
      }
    }
    if(bunki2==1){
      cout<<0;
    }else{
      cout<<floor(((double)m+lcm)/2/lcm);
    }
  }
}

Compiler output:
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:31:5: error: 'lo' was not declared in this scope; did you mean 'log'?
   31 |     lo tmp=a; a=b; b=tmp;
      |     ^~
      |     log
a.cc:31:22: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   31 |     lo tmp=a; a=b; b=tmp;
      |                      ^~~
      |                      tm