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



import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        FastReader s = new FastReader();
        int n = s.nextInt();
        long res=1;
        long flag=0;
        long [] arr = new long[n];
        for(int i=0;i<n;i++){
            arr[i]=s.nextLong();
            if(arr[i]==0){
                System.out.println(0);
                flag=1;
                break;
            }
        }
        if(flag==0){
            for(int i=0;i<n;i++){
                if(res>1000000000000000000L||res <0){
                    System.out.println(-1);
                    flag=1;
                    break;
                }
                res*=arr[i];
            }
        }

        if(flag==0)
            System.out.println(res);

    }

    private static boolean isPrime(int n) {
        if (n == 2)
            return true;
        else if ((n % 2 == 0 && n > 2) || n < 2)
            return false;
        else {
            for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {
                if (n % i == 0)
                    return false;
            }
            return true;
        }


    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}

Compiler output:
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.BufferedReader;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.io.IOException;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
    6 | import java.util.StringTokenizer;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:1: error: expected unqualified-id before 'public'
    8 | public class Main {
      | ^~~~~~
Language: C++

input()
a = list(map(int, input().split()))
ans = 1
flag = False
for i in a:
    ans *= i
if ans<1000000000000000001:
    print(ans)
else:
    print(-1)


Compiler output:
a.cc:2:1: error: expected constructor, destructor, or type conversion before 'a'
    2 | a = list(map(int, input().split()))
      | ^
Language: C++

#include<iostream>
#include<math.h>
using namespace std;
int main()
{ int n,i;
  cin>>n;
long int  m[n];
  long long long int ml=1;
  for (i=0;i<n;i++)
  {
    cin>>m[i];
    ml=ml*m[i];
  }
 
  //cout<<ml;
  if (ml>pow(10,18))
  {
  
  cout<<"-1";
}
else 
{
	cout<<ml;
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'long long long' is too long for GCC
    8 |   long long long int ml=1;
      |             ^~~~
Language: C++

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

using namespace std;
typedef long long ll;

#define REP(i, n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i, n) for(ll i=(ll)(n-1);i>=0;i--)
#define FOR(i, a, b) for(ll i=(ll)(a); i<=(ll)(b); i++)
#define RFOR(i, a, b) for(ll i=(ll)(a);i>=(ll)(b); i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define INF 1000000000000
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

signed main()
{
	int N;
	cin >> N;
	ll ans=1;
	REP(i, N){
		int tmp;
		cin >> tmp;
		ans*=tmp;
		if(ans >= 10e8){
			cout << -1 << endl;
			return;
		}
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:25: error: return-statement with no value, in function returning 'int' [-fpermissive]
   47 |                         return;
      |                         ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long n,a[100005],flag=1;
    scanf("%lld",&n);
    for(int i=0;i<n;i++) scanf("%lld",&a[i]);
    sort(a,a+n);
    for(int i=0;i<n;i++){
      ans*=a[i];
      if(ans>=1000000000000000001 || ans<=-1){
        flag=0;
        break;
      }
    }
    if(flag) printf("%lld",ans);
    else printf("-1");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |       ans*=a[i];
      |       ^~~
      |       abs
a.cc:15:28: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |     if(flag) printf("%lld",ans);
      |                            ^~~
      |                            abs
Language: C++

n = int(raw_input())
lst = list(map(int, raw_input().strip().split()))[:n]
mx = 1000000000000000000
if 0 in lst:
    print(0)
else:
    cur = lst[0]
    for x in lst[1:]:
        cur = cur * x
        if cur > mx:
            cur = -1
            break
    print(cur)


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

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

int main() {
  int64_t sum, now;
  sum = 1;
  now = 1;
  int N;
  vector<int64_t> vec(N);
  cin >> N;
  for(int i = 0; i < N; i++){
    cin >> vec.at(i);
    now = sum;
    sum = sum*A;
    if(sum < now){
      cout <<"-1";
      bool finish = false;
      break;
    }
  }
  if(finish){
  if(sum > 1000000000000000000){
    cout << "-1";
  }
  else{
    cout << sum;
  }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: 'A' was not declared in this scope
   16 |     sum = sum*A;
      |               ^
a.cc:23:6: error: 'finish' was not declared in this scope
   23 |   if(finish){
      |      ^~~~~~
Language: C++

#include<bits/stdc++.h>
#define llu unsigned long long
#define ll long long
#define INF 0x3f3f3f3f
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#include <boost/multiprecision/cpp_int.hpp> 
using namespace boost::multiprecision;

using namespace std;


template <typename T> 
inline void inp(T &any) {
    cin >> any;
}
template <typename T, typename... U> 
inline void inp(T &a, U &...b) {
    cin >> a; inp(b...);
}
// scan vector
template <typename T> 
inline istream &operator>>(istream &in, vector<T> &a) {
    for(auto &x : a) in >> x;
    return in;
}
// scan pair
template <typename T, typename U> 
inline istream &operator>>(istream &in, pair<T,U> &a) {
    in >> a.first >> a.second; 
    return in;
}

int main()	
{
	#ifdef SANS
		freopen("C:\\Users\\ASUS\\Documents\\Sublime\\input_output\\inputf.txt","r",stdin);
		freopen("C:\\Users\\ASUS\\Documents\\Sublime\\input_output\\outputf.txt","w",stdout);
	#endif
	fast
	int t=1;
	// cin>>t;
	while(t--)
	{
		int n;
		cin>>n;
		int256_t ans=1, boundry=1e18, temp;
		int length=0;
		// cout<<boundry<<endl;
		bool flag=false, zero=false, tp=true;
		for(int i=0; i<n; i++)
		{
			cin>>temp;
			if(temp==0)
				zero=true;
			ans*=temp;
			if(length>boundry)
			{
				// cout<<length<<endl;
				flag=true;
			}
			else
				flag=false;
		}
		// cout<<length<<endl;
		if(flag && !zero)
			cout<<-1;
		else
			cout<<ans;
	}
	#ifdef SANS
		cout<<"\nTime Elapsed:"<<1.0*clock()/CLOCKS_PER_SEC <<"sec\n";
	#endif
}

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

#include<bits/stdc++.h>
#define modulo 1000000000000000000
int main()
{long long int n;
 cin>>n;
 long long int a[n],prod=1,flag=0;
 for(long long int i=0;i<n;i++)
   cin>>a[i];
 for(long long int i=0;i<n;i++)
 {prod=prod*a[i];
  if(prod>modulo)
  {flag=1;
   break;}
 }
 if(flag==0)
    cout<<prod;
 else
   cout<<"-1";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |  cin>>n;
      |  ^~~
      |  std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |     cout<<prod;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:18:4: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |    cout<<"-1";
      |    ^~~~
      |    std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
#include <cmath>
#include <limits>
#include <utility>
#include <vector>
#include <string>
#include <stdlib.h>
using namespace std;
#define int long long
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define RS(x) rsort(x.begin(),x,end()))
#define REVE(x) reverse(x.begin(), x.end())
#define ALL(x) (x).begin(), (x).end()
typedef long double ld;
int t=1000000000000000000;
signed main(){
int n=0,an=1;
cin >>n;
vector<int> a(n);
REP(i,n){
    cin >> a[i];
an*=a[i];
  }if(a.begin==0){
    cout <<"0";
return 0;
  }else if(a.end>t){
    cout <<"-1";
return 0;
  } else if(an>t){
    cout  <<"-1"; 
    return 0;
}else{
cout << an;
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:14: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator=='
   25 |   }if(a.begin==0){
      |       ~~~~~~~^~~
      |         |      |
      |         |      int
      |         <unresolved overloaded function type>
a.cc:28:17: error: invalid operands of types '<unresolved overloaded function type>' and 'long long int' to binary 'operator>'
   28 |   }else if(a.end>t){
      |            ~~~~~^~
      |              |   |
      |              |   long long int
      |              <unresolved overloaded function type>
Language: C++

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{     int n;
      long long s=1;
      cin >>n;
      long long a[n];
      for(int i=0;i<n;i++)
      {   cin >> a[i];
      }
      sort(a,a+n);
      for(int i=0;i<n;i++)
      {   s=s*a[i];
 
      }
      if(s>1000000000000000000)
          {
              cout << -1 <<endl;
          }
      else if(s<0)
      {
          cout << -1 <<endl;
      }
      else
      {
          cout << s  <<endl;
      }
    return 0;
}
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{   cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout.tie(0);cin.sync_with_stdio(0);cout.sync_with_stdio(0);
      int n,b,c;
      long long s=1;
      cin >>n;
      long long a[n];
      for(int i=0;i<n;i++)
      {   cin >> a[i];
      }
      sort(a,a+n);
      for(int i=0;i<n;i++)
      {   s=s*a[i];

      }
      if(s>1000000000000000000)
          {
              cout << -1 <<endl;
          }
      else if(s<0)
      {
          cout << -1 <<endl;
      }
      else
      {
          cout << s  <<endl;
      }
    return 0;
}
Submission Info

Compiler output:
a.cc:34:5: error: redefinition of 'int main()'
   34 | int main()
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main()
      |     ^~~~
a.cc:64:1: error: 'Submission' does not name a type
   64 | Submission Info
      | ^~~~~~~~~~
Language: C++

#include <bits/stdc++.h> 
using namespace std; 
int main()
{
	int a;
	long long b[100001],cnt=1;
	cin>>a;
	for (int i=0;i<a;i++)
	{
		cin>>b[i];
		if (b[i]==0)
		{
			cout<<"0";
			return 0;
		}
	}
	for (int i=0;i<a;i++)
	{
		cnt*=a[i];
		if (cnt/1000000000000000000)
		{
			cout<<-1;
			return 0;
		}
	}
	cout<<cnt;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:23: error: invalid types 'int[int]' for array subscript
   19 |                 cnt*=a[i];
      |                       ^
Language: C++

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <boost/multiprecision/cpp_int.hpp> 
using namespace boost::multiprecision; 
using namespace std;
using namespace __gnu_pbds;
#define MOD  1000000007
#define ll long long
#define int long long
#define INF 1e18
#define ar array
#define MAX 1000004
#define wt(x) int x;cin>>x;while(x--)

typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update> pbds;

void  c_p_c(){
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
 
#ifndef ONLINE_JUDGE
  freopen("input1.txt","r",stdin);
  freopen("output1.txt","w",stdout);
#endif
 
}
ll power(ll a,ll b,int mod){
    a=a%mod;
    if(a==0){
        return 1;
    }
    ll res=1;
    while(b){
        if(b&1){
            res=(res*a)%mod;
        }
        b>>=1;
        a=(a*a)%mod;
    }
    return res;
 }
 int128_t boost_product(long long A, long long B) 
{ 
    int128_t ans = (int128_t) A * B; 
    return ans; 
} 
  

 int32_t main() {

c_p_c();

    int  n;
    cin>>n;
    int128_t ans=1;
    for(int i=0;i<n;i++){
        ll x;
        cin>>x;
        ans=boost_product(ans,x);
        

    }
    if(ans>(int128_t)1e18){
            cout<<-1;
            return 0;
        }
        else{
    
        cout<<ans;
    }
    

return 0;

}
 


   


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

#include<iostream>
#include<math.h>
using namespace std;
 
int main()
{
  int n;
  cin>>n;
  long long m=1;
  while(n--)
  {
    int x;
    cin>>x;
    m=m*x;
    if(m>pow(10,18))
    {
      cout<<"-1"<<endl
    }
  }
  cout<<m<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:23: error: expected ';' before '}' token
   17 |       cout<<"-1"<<endl
      |                       ^
      |                       ;
   18 |     }
      |     ~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#define MAX pow(10, 18)
using namespace std;

bool is_negative(long long int l){// 負の数が true
    return (l < 0);
}

int main(){
    int N;
    cin >> N;
    vector<long long> A(N);
    long long ans = 1;

    for (int i = 0; i < N; i++){
        cin >> A[i];
    }
    //cout << A.size() << endl;
    if(count(A.begin(), A.end(), 0) > 0){
        cout << "0" << endl;
        return 0;
    }else {
        for (int i = 0; i < N; i++) {
            if(A[i] < 0){
                cout << "-1" << endl;
                return 0;
            }else if(ans <= MAX / A[i]){
                ans *= A[i];
            }else{
                cout << "-1" << endl;
                return 0;
            }
        }
        cout << ans << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:13: error: 'pow' was not declared in this scope
    4 | #define MAX pow(10, 18)
      |             ^~~
a.cc:29:29: note: in expansion of macro 'MAX'
   29 |             }else if(ans <= MAX / A[i]){
      |                             ^~~
Language: C++

#include<stdio.h>
int main(){
 long long n;
 scanf("%lld",&n);
 long long a[n],ans=1;
 for(long long i=0;i<n,i++){
  scanf(" %lld",&a[i]);
  ans*=a[i];
 }
 printf("%lld\n",ans);
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:27: error: expected ';' before ')' token
    6 |  for(long long i=0;i<n,i++){
      |                           ^
      |                           ;
Language: C++

#include <bits/stdc++.h> 
using namespace std;
#define endl "\n"
typedef long long int ll;
ll inline multiply(ll a[], ll n) 
{ 
    // Termination condition 
    if (n == 0) 
        return(a[n]); 
    else
        return (a[n] * multiply(a, n - 1)); 
} 
int main(){
 
 
 
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
   ll n;
  cin>>n;



  ll y=1,x;;
  for(int i=0;i<n;i++){
    cin>>x;
    y=y*x;
  }
       
    ll y=multiply(arr,n);
   (y<1e18)?cout<<y<<endl:cout<<-1<<endl;
  return 0;
}
  
 


Compiler output:
a.cc: In function 'int main()':
a.cc:31:8: error: redeclaration of 'll y'
   31 |     ll y=multiply(arr,n);
      |        ^
a.cc:25:6: note: 'll y' previously declared here
   25 |   ll y=1,x;;
      |      ^
a.cc:31:19: error: 'arr' was not declared in this scope
   31 |     ll y=multiply(arr,n);
      |                   ^~~
Language: C++

#include<bits/stdc+.h>
using namespace std;
long long a[1000005]l
int main()
{
	long long sum=1;
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		if(a[i]==0)
		{
			cout<<"0";
			return 0;
		}
		if(1000000000000000000ll/sum<a[i]){
			cout<<'-1';
			return 0;
		}
		else{
			sum*=a[i];
		}
	}
	cout<<sum;
	return 0;
}

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

#include<bits/stdc++.h>
#define llu unsigned long long
#define ll long long
#define INF 0x3f3f3f3f
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#include <boost/multiprecision/cpp_int.hpp> 
using namespace boost::multiprecision;

using namespace std;


template <typename T> 
inline void inp(T &any) {
    cin >> any;
}
template <typename T, typename... U> 
inline void inp(T &a, U &...b) {
    cin >> a; inp(b...);
}
// scan vector
template <typename T> 
inline istream &operator>>(istream &in, vector<T> &a) {
    for(auto &x : a) in >> x;
    return in;
}
// scan pair
template <typename T, typename U> 
inline istream &operator>>(istream &in, pair<T,U> &a) {
    in >> a.first >> a.second; 
    return in;
}

int main()	
{
	#ifdef SANS
		freopen("C:\\Users\\ASUS\\Documents\\Sublime\\input_output\\inputf.txt","r",stdin);
		freopen("C:\\Users\\ASUS\\Documents\\Sublime\\input_output\\outputf.txt","w",stdout);
	#endif
	fast
	int t=1;
	// cin>>t;
	while(t--)
	{
		int n;
		cin>>n;
		int_256 ans=1, boundry=1e18, temp;
		int length=0;
		// cout<<boundry<<endl;
		bool flag=false, zero=false, tp=true;
		for(int i=0; i<n; i++)
		{
			cin>>temp;
			if(temp==0)
				zero=true;
			ans*=temp;
			if(length>boundry)
			{
				// cout<<length<<endl;
				flag=true;
			}
			else
				flag=false;
		}
		// cout<<length<<endl;
		if(flag && !zero)
			cout<<-1;
		else
			cout<<ans;
	}
	#ifdef SANS
		cout<<"\nTime Elapsed:"<<1.0*clock()/CLOCKS_PER_SEC <<"sec\n";
	#endif
}

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

/* package whatever; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
	  Scanner sc = new Scanner(System.in);
	  int n = sc.nextInt();
	  
	  BigInteger m = new BigInteger("1");
	  BigInteger limit = new BigInteger("10e18");
	  
	  for(int i = 1; i <= n; i++){
	    int x = sc.nextInt();
	    if(m < limit) m = m.multiply(BigInteger.valueOf(x));
	  }
	  if(m <= limit) System.out.println(m);
	  else System.out.println("-1");
	}
}
  

Compiler output:
Main.java:21: error: bad operand types for binary operator '<'
	    if(m < limit) m = m.multiply(BigInteger.valueOf(x));
	         ^
  first type:  BigInteger
  second type: BigInteger
Main.java:23: error: bad operand types for binary operator '<='
	  if(m <= limit) System.out.println(m);
	       ^
  first type:  BigInteger
  second type: BigInteger
2 errors
Language: C++

#include <algorithm>
#include <boost/multiprecision/cpp_int.hpp>
#include <cmath>
#include <deque>
#include <iostream>
#include <queue>
#include <string>
#include <vector>

using namespace std;
using ll = long long;
namespace mp = boost::multiprecision;
using mpint = mp::cpp_int;  // 多倍長整数（任意精度）

/*
 * 定数
 */
const long double PI = (acos(-1));
const long double EPS = 1e-10;
const long long INF = 1e18;

/*
 * データ変換 
 */
/* char -> int */
int ctoi(char c) { return (int)(c - '0'); }

/*
 * 数学的な計算
 */
/* 階乗 */
int factorial(int n) {
  int ret = 1;
  for (int i = 1; i < n + 1; ++i) {
    ret = ret * i;
  }
  return ret;
}

/* 最大公約数 */
template <typename T>
T gcd(T x, T y) { return x % y == 0 ? y : gcd(y, x % y); }

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

/* n個の整数の最小公倍数 */
template <typename T>
T lcm_n(vector<T> &numbers) {
  T l;
  l = numbers[0];
  for (int i = 1; i < numbers.size(); ++i) {
    l = lcm(l, numbers[i]);
  }
  return l;
}

/*
 * DP向け
 */
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;
}

/**
 * @param N 素因数分解する整数
 * @param result N = 2^3 * 3^2の場合、{{2, 3}, {3, 2}}のような形式のvectorが生成される
 * @brief 2, 3,..., √Nまでの整数をNで割っていき、割り切れる数と割った回数を保存することで、素因数分解を行う。
 *        O(√N)
*/
void prime_factorize(ll N, vector<pair<ll, ll>> &result) {
  for (ll a = 2; a * a <= N; ++a) {
    if (N % a != 0) continue;
    ll ex = 0;  // 指数

    // 割れる限り割り続ける
    while (N % a == 0) {
      ++ex;
      N /= a;
    }

    result.emplace_back(pair<ll, ll>{a, ex});
  }

  // 最後に残った数
  if (N != 1) result.emplace_back(pair<ll, ll>{N, 1});
}

int main() {
  mpint N;
  mpint ans = 1;
  cin >> N;
  vector<ll> A(N);

  for (mpint i = 0; i < N; ++i) {
    cin >> A[i];
    if (A[i] == 0) {
      cout << -1 << endl;
      return 0;
    }
  }

  for (mpint i = 0; i < N; ++i) {
    ans *= A[i];
    if (1'000'000'000'000'000'000 < ans) {
      ans = -1;
      break;
    }
  }

  cout << ans << endl;

  return 0;
}


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

using namespace std;
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
const ll MOD=1000000007;
const long double PI=3.14159265358979;
const ll MAX=0;

int main() {
  ll N;
  cin>>N;
  ll A[N];
  for(int i=0;i<N;i++){
    cin>>A[i];
  }
  ll ans=1;
  sort(A,A+N);
  for(int i=0;i<N;i++){
    if(ans>1000000000000000000/A[i]){
      ans=-1;
      break;
    }
    ans*=A[i];
    if(ans>1000000000000000000){
      ans=-1;
      break;
    }
    if(ans<0){
      ans=-1;break;
    }
  }
  cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope
   10 |   cin>>N;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:16:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |   sort(A,A+N);
      |   ^~~~
      |   short
a.cc:31:3: error: 'cout' was not declared in this scope
   31 |   cout<<ans;
      |   ^~~~
a.cc:31:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

int main(void)
{
    long long n, i;
    scanf("%lld", &n);
    long long a;
    long long result = 1;


    for (i=0; i<n; i++)
    {
        scanf("%lld", &a);
        result = result * a
    }

    if (result > (long long)pow(10, 18))
    {
        printf("%d\n", -1);
        return 0;
    }
    else 
    {
        printf("%lld\n", result);
        return 0;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:28: error: expected ';' before '}' token
   15 |         result = result * a
      |                            ^
      |                            ;
   16 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#define int boost::multiprecision::cpp_int
using namespace std;

typedef unsigned long long ll;
typedef unsigned long long ull;
const long double PI = (acos(-1));
const long long MOD = 1000000007;
struct Edge
{
    long long to;
    long long cost;
};
using Graph = vector<vector<Edge>>;
using P = pair<ll, ll>;
const long long INF = 1LL << 60;

signed main()
{
    int n;

    cin >> n;

    int total = 1;
    int tmp = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> tmp;
        total *= tmp;
    }

    if (total > 1000000000000000000)
    {
        cout << -1 << endl;
        return 0;
    }

    cout << total << endl;
}
//cout << std::fixed << std::setprecision(15)
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#define int boost::multiprecision::cpp_int
using namespace std;

typedef unsigned long long ll;
typedef unsigned long long ull;
const long double PI = (acos(-1));
const long long MOD = 1000000007;
struct Edge
{
    long long to;
    long long cost;
};
using Graph = vector<vector<Edge>>;
using P = pair<ll, ll>;
const long long INF = 1LL << 60;

signed main()
{
    int n;

    cin >> n;

    int total = 1;
    int tmp = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> tmp;
        total *= tmp;
        if (total > 1000000000000000000)
        {
            cout << -1 << endl;
            return 0;
        }
    }


    cout << total << endl;
}
//cout << std::fixed << std::setprecision(15)


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

#!/usr/bin/env python3

N=int(input())
A=list(map(int,input().split()))

ans=1

for i in range(N):
    ans*=A[i]

if ans > 1000000000000000000:
    print(-1)
else:
    print(ans)


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/env python3
      |  ^
a.cc:3:1: error: 'N' does not name a type
    3 | N=int(input())
      | ^
Language: C++

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

int main(){
    int n;
    cin >> n;
    vector<unsigned long long> a(n);
    for(int i = 0; i < n;i++){
        cin >> a[i];
        if(a[i] == 0){
            cout << 0 << endl;
        }
    }
    int check =0
    unsigned long long sum = 1;
    for(int i = 0; i < n;i++){
        sum *= a[i];
        if(sum < 0){
            check = -1;
            cout << -1 << endl;
            break;
        }
    }
    if(check != -1){
        if(sum < 1000000000000000000){
            cout << -1 << endl;
        }else{
            cout << sum << endl;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: expected ',' or ';' before 'unsigned'
   15 |     unsigned long long sum = 1;
      |     ^~~~~~~~
a.cc:17:9: error: 'sum' was not declared in this scope
   17 |         sum *= a[i];
      |         ^~~
a.cc:25:12: error: 'sum' was not declared in this scope
   25 |         if(sum < 1000000000000000000){
      |            ^~~
Language: C++

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;

using i64 = long long;

const i64 MOD = 1e9 + 7;
const i64 INF = i64(1e18) + 7;


template <typename T>
bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

template <typename T>
bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}


void solve(long long n, std::vector<long long> a){
    boost::multiprecision::cpp_int aa(1);
    if(*min_element(a.begin(), a.end() == 0){
    cout << 0 << endl;
    return;
  }  
  for(int i = 0; i < n; ++i){
        aa *= a[i];
    
          if(aa > 1000000000000000000LL){
            cout << -1 << endl;
            return;
        }
    }
    cout << aa << endl;
}


signed main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, std::move(A));
    return 0;
}


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

#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef pair<int, int> P;

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(12)

// vector<vector<int>> data(3, vector<int>(4));

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

  long long a;

  long long n;
  cin >> n;
  vector<long long> vec;

  for (long long i = 0; i < n; i++) {
    cin >> a;
    if (a == 0) {
      cout << "0";
      return 0;
    }
    vec.push_back(a);
  }
  sort(vec.begin(), vec.end(), std::greater<int>());

  long long ans = 1;
  for (long long i = 0; i < n; i++) {
    ans *= vec[i];
    if (ans > 1000000000000000000) {
      cout << "-1";
      return 0;
    }
  }
  printf("%lu", ans;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:20: error: expected ')' before ';' token
   55 |   printf("%lu", ans;
      |         ~          ^
      |                    )
Language: C++

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

struct Union{
  vector<ll> par;
  Union(ll a){
  par=vector<ll>(a,-1);
  }
  ll find(ll a){
    if(par[a]<0){
      return a;
    }
    else{
      return par[a]=find(par[a]);
    }
  }
  bool same(ll a,ll b){
    return (find(a)==find(b));
  }
  ll size(ll a){
    return -par[find(a)];
  }
  void unite(ll a,ll b){
    ll c=find(a),d=find(b);
    if(c==d)
      return;
    if(size(c)<size(d)){
      swap(c,d);
    }
    par[c]+=par[d];
    par[d]=c;
  }
};
ll Nagaemon1;
void swap(ll i,ll j){
  Nagaemon1=i;
  i=j;
  j=Nagaemon1;
}
ll inputNum(void){
    ll num = 0;
    while (1){
        printf("素因数分解したい整数を入力：");
        scanf("%d", &num);
        if (num < 2){
            printf("2以上の整数にしてください\n\n");
        } else{
            break;
        }
    }
    return num;
}
map<ll,ll> mp;
void findFactors(int num){
    ll i;
    while (num % 2 == 0){ // 偶数の素数は2のみ
        mp[2]++;
        num /= 2;
    }
    k=2;
    for (i = 3; i <= num; i++){ // 他の素数で割って
        while (num % i == 0){
            mp[i]++;
            num /= i;
        }
    }
    printf("%b %n");
}
int main(void){
    ll n;
    cin >> n;
    vector<ll> a(n);
    ll ans=1;
    rep(i,n){
      cin >> a[i];
      if(1000000000000000000/ans<a[i]){
        cout << -1;
        return 0;
      }
      ans*=a[i];
    }
    cout << ans;
}

Compiler output:
a.cc: In function 'void findFactors(int)':
a.cc:66:5: error: 'k' was not declared in this scope
   66 |     k=2;
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const long long maxi = 1e18;

int main(){
  int n; cin >> n;
  long long ans = 1;
  vector<long long> v(n);
  for(int i=0; i<n; i++){
    cin >> v[i];
  }
  long long ans = 1;
  bool te = false;
  for(int i=0; i<n; i++){
    ans *= v[i];
    if(ans > maxi){
      cout << "-1\n";
      te = true;
      break;
    }
  }
  if(!te) cout << ans << "\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: redeclaration of 'long long int ans'
   12 |   long long ans = 1;
      |             ^~~
a.cc:7:13: note: 'long long int ans' previously declared here
    7 |   long long ans = 1;
      |             ^~~
Language: C

#include<stdio.h>
int main()
{
	int n,i;
	long a,t=1,c=0;

	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%ld",&a);
		t*=a;
		if(a==0)
			t=0;
		if(t>1000000000000000000)
			c=-1
	}
	if(c==-1)
		printf("-1");
	else
		printf("%ld",t);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:29: error: expected ';' before '}' token
   14 |                         c=-1
      |                             ^
      |                             ;
   15 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>

using namespace std;

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


template <typename T> void show_vec(vector<T> v);





int main(){

    

    //solve();
    int n;
    cin >> n;
    vector<ll> A;
    for (int i = 0; i < n; i++)
    {
        ll a;
        cin >> a;
        A.push_back(a);
    }
    ll ret = 1;
    ll before = 1;
    for (int i = 0; i < n; i++)
    {
         if(ret > 1e+18){
        cout << -1 <<endl;
        return 0;
    }
        ret *= A[i];
    }
   
    else cout << ret << endl;

    return 0;

}

template <typename T> void show_vec(vector<T> v){
    cout << "[";
    for (int i = 0; i < (int)v.size(); i++)
    {
        cout << v[i] << ",";
    }
    cout << "]" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:5: error: 'else' without a previous 'if'
   40 |     else cout << ret << endl;
      |     ^~~~
Language: C++

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

int main() {
  int N;
  cin>>N;
  vector<long long> S(N);
  for(int i=0;i<N;i++){
    cin >> S.at(i);
  }
  long long Ans=1;
  for(int i=0;i<N;i++){
    Ans*=S.at(i);
  }
  if(Ans=<10^18)
    cout << Ans;
  else
    cout << -1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: expected primary-expression before '<' token
   15 |   if(Ans=<10^18)
      |          ^
Language: C++

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


int main(){
  int a, i, b;
  cin >> a;
  i = 0;
  b = 1;
  while (i < a){
    int d;
    cin >> d;
    b *= d
    i += 1
}

 if(O(b) << 18){
   cout << b << endl;
 }
 else{
   cout << "-1" << endl;
 }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: expected ';' before 'i'
   13 |     b *= d
      |           ^
      |           ;
   14 |     i += 1
      |     ~      
a.cc:17:5: error: 'O' was not declared in this scope
   17 |  if(O(b) << 18){
      |     ^
Language: C++

#include <bits/stdc++.h>

#include <boost/multiprecision/cpp_int.hpp>

namespace mp = boost::multiprecision;

using namespace std;
typedef long long lint;

#define RPT(i, b, e) for (int i = ((int)b); i <= ((int)e); i++)
#define RPT0(i, n) RPT(i, 0, ((int)n) - 1)
#define RPT1(i, n) RPT(i, 1, (n))
#define EACH(it, v) for (const auto& it : v)
#define ALL(v) v.begin(), v.end()

void resolve()
{
    int N;
    cin >> N;
    vector<lint> A(N);
    RPT0(i, N)
    {
        cin >> A[i];
        if (A[i] == 0) {
            cout << 0 << endl;
            return;
        }
    }

    mp::cpp_int ans = 1;
    RPT0(i, N)
    {
        ans *= A[i];
        if (ans > pow(10, 18)) {
            cout << -1 << endl;
            return;
        }
    }

    cout << ans << endl;
}

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


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

#include <bits/stdc++.h>;
#define ull unsigned long long;
using namespace std;


int main() {
  int N;
  cin >> N;
  
  ull res = 1;
  for (int i = 0; i < N; i++) {
    ull a;
    cin >> a;
    res *= a;
        
    if (res_length >= pow(10, 18)) {
      cout << "-1" << endl;
      return 0;
  }

  cout << res << endl;
  return 0;
}


Compiler output:
a.cc:1:25: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h>;
      |                         ^
a.cc: In function 'int main()':
a.cc:2:27: error: declaration does not declare anything [-fpermissive]
    2 | #define ull unsigned long long;
      |                           ^~~~
a.cc:10:3: note: in expansion of macro 'ull'
   10 |   ull res = 1;
      |   ^~~
a.cc:10:7: error: 'res' was not declared in this scope
   10 |   ull res = 1;
      |       ^~~
a.cc:2:27: error: declaration does not declare anything [-fpermissive]
    2 | #define ull unsigned long long;
      |                           ^~~~
a.cc:12:5: note: in expansion of macro 'ull'
   12 |     ull a;
      |     ^~~
a.cc:12:9: error: 'a' was not declared in this scope
   12 |     ull a;
      |         ^
a.cc:16:9: error: 'res_length' was not declared in this scope
   16 |     if (res_length >= pow(10, 18)) {
      |         ^~~~~~~~~~
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {

  long long int n, a, ans;

  ans = 1;
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> a;
    ans *= a;
    if (ans > 1000000000000000000) ans = -1;
	if (ans < 0) ans = -1;
   }
   cout << ans << endl;
   }
  return 0;
}

Compiler output:
a.cc:18:3: error: expected unqualified-id before 'return'
   18 |   return 0;
      |   ^~~~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: Java

// Java program to find large factorials using BigInteger 
import java.math.BigInteger; 
import java.util.Scanner; 
  
public class Solution 
{ 
    // Returns Factorial of N 

  
    // Driver method 
    public static void main(String args[]) throws Exception 
    { 
        //int N = 20; 
        //System.out.println(factorial(N)); 
        int t;
        Scanner myObj = new Scanner(System.in); 
        t=myObj.nextInt();
        BigInteger ar[]=new BigInteger[t];
        int t1=0;
        for(int i=0;i<t;i++)
        {
            String s;
            s=myObj.next();
            BigInteger n=new BigInteger(s);
            if(n.compareTo(new BigInteger("0"))==0)
            {
                t1=1;
            }
            ar[i]=n;
        }
        BigInteger ans=new BigInteger("1");
        BigInteger m=new BigInteger("1000000000000000000");
        for(int i=0;i<t;i++)
        {
            ans=ans.multiply(ar[i]);
            if(m.compareTo(ans)<0)
            {
                ans=new BigInteger("-1");
                break;
            }
        }
        System.out.println(ans);
        
        
    } 
} 

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int OOT, YUNI = 0;
  unsigned long long KYR, YABAI, JNY, LAPLAND;
  LAPLAND = 1000000000000000000;
  cin >> OOT >> KYR;
  
  while(YUNI < OOT - 1){
    cin >> JNY;
    KYR *= JNY;
    YUNI ++;
  }
  
  if(KYR > LAPLAND){
    cout << PKRN << endl;
  }
  
  else{
  cout << KYR << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'PKRN' was not declared in this scope
   17 |     cout << PKRN << endl;
      |             ^~~~
Language: C

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

int main() {
  int64_t N,ans=1;
  cin >> N;
  vector<int64_t> a(N);
  //bool flag=true;
  
  for(int i=0;i<N;i++){
    cin >> a.at(i);
    if(a.at(i)==0) ans=0;
  }
    for(int i=0;i<N;i++){
      ans = ans*a.at(i);
      if(ans>int64_t(pow(10,18))) {
        ans = -1;
        break;
      }
    }

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

'''

                            Online Python Compiler.
                Code, Compile, Run and Debug python program online.
Write your code in this editor and press "Run" button to execute it.

'''

n = int(input()) 
  
a = list(map(int,input().strip().split()))[:n] 
x=1
flag=0
flag1=0
for i in range(n):
    if a[i]==0:
        x*=0
        flag1=1
        break
if flag!=1: 
    for i in range(n):
        x*=a[i]
        if x>1000000000000000000:
            flag=1
        else:
            x*=a[i]
        

if flag1==1:
    print(0)
elif flag==1:
    print(-1)
else:
    print(x)
    


Compiler output:
a.cc:1:1: error: empty character constant
    1 | '''
      | ^~
a.cc:1:3: warning: missing terminating ' character
    1 | '''
      |   ^
a.cc:1:3: error: missing terminating ' character
a.cc:7:1: error: empty character constant
    7 | '''
      | ^~
a.cc:7:3: warning: missing terminating ' character
    7 | '''
      |   ^
a.cc:7:3: error: missing terminating ' character
a.cc:1:1: error: expected unqualified-id before '\x0'
    1 | '''
      | ^~
Language: C++

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

int main() {
    long long N, A, ans;
    cin >> N;

    ans = 1;
    bool flag = false;
    for(long long i = 0; i < N; i++){
        cin >> A;
        ans = ans * A;
        if(ans == 0){
            break
        }else if(ans > 1000000000000000000){
            flag = true;
        }
    }

    if(ans == 0){
        cout << "0" << endl;
    }else if(flag){
        cout << "-1" << endl;
    }else if(ans == 0){
        cout << ans << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: expected ';' before '}' token
   14 |             break
      |                  ^
      |                  ;
   15 |         }else if(ans > 1000000000000000000){
      |         ~
Language: C++

#include <stdio.h>
#include <iostream>
#include <string>

int main() {

	int  N;
	_int64 mul = 1,input;
	std::cin >> N;

	for (int i = 0;i < N;i++) {
		std::cin >> input;
		mul = mul * input;
	}

	if (mul <= 1000000000000000000) {
		std::cout << mul << std::endl;
	}

	else {
		std::cout << "-1" << std::endl;
	}


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: '_int64' was not declared in this scope
    8 |         _int64 mul = 1,input;
      |         ^~~~~~
a.cc:12:29: error: 'input' was not declared in this scope; did you mean 'int'?
   12 |                 std::cin >> input;
      |                             ^~~~~
      |                             int
a.cc:13:17: error: 'mul' was not declared in this scope
   13 |                 mul = mul * input;
      |                 ^~~
a.cc:16:13: error: 'mul' was not declared in this scope
   16 |         if (mul <= 1000000000000000000) {
      |             ^~~
Language: C++

#include <algorithm>
#include <boost/multiprecision/cpp_int.hpp>
#include <cmath>
#include <deque>
#include <iostream>
#include <queue>
#include <string>
#include <vector>

using namespace std;
using ll = long long;
namespace mp = boost::multiprecision;
using mpint = mp::cpp_int;  // 多倍長整数（任意精度）

/*
 * 定数
 */
const long double PI = (acos(-1));
const long double EPS = 1e-10;
const long long INF = 1e18;

/*
 * データ変換 
 */
/* char -> int */
int ctoi(char c) { return (int)(c - '0'); }

/*
 * 数学的な計算
 */
/* 階乗 */
int factorial(int n) {
  int ret = 1;
  for (int i = 1; i < n + 1; ++i) {
    ret = ret * i;
  }
  return ret;
}

/* 最大公約数 */
template <typename T>
T gcd(T x, T y) { return x % y == 0 ? y : gcd(y, x % y); }

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

/* n個の整数の最小公倍数 */
template <typename T>
T lcm_n(vector<T> &numbers) {
  T l;
  l = numbers[0];
  for (int i = 1; i < numbers.size(); ++i) {
    l = lcm(l, numbers[i]);
  }
  return l;
}

/*
 * DP向け
 */
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;
}

/**
 * @param N 素因数分解する整数
 * @param result N = 2^3 * 3^2の場合、{{2, 3}, {3, 2}}のような形式のvectorが生成される
 * @brief 2, 3,..., √Nまでの整数をNで割っていき、割り切れる数と割った回数を保存することで、素因数分解を行う。
 *        O(√N)
*/
void prime_factorize(ll N, vector<pair<ll, ll>> &result) {
  for (ll a = 2; a * a <= N; ++a) {
    if (N % a != 0) continue;
    ll ex = 0;  // 指数

    // 割れる限り割り続ける
    while (N % a == 0) {
      ++ex;
      N /= a;
    }

    result.emplace_back(pair<ll, ll>{a, ex});
  }

  // 最後に残った数
  if (N != 1) result.emplace_back(pair<ll, ll>{N, 1});
}

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

  vector<mpint> A(N);

  for (mpint i = 0; i < N; ++i) {
    cin >> A[i];
    if (A[i] == 0) {
      cout << -1 << endl;
      return 0;
    }
  }

  for (mpint i = 0; i < N; ++i) {
    ans *= A[i];
    if (1'000'000'000'000'000'000 < ans) {
      ans = -1;
      break;
    }
  }

  cout << ans << endl;

  return 0;
}


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

int main() {
 long long N;
 cin >> N;
 unsigned long S=1;
 vector<long long> An(N+1);
 for (long long i = 0; i < N; i++)
   An.at(i)=1;
 for (long long i = 0; i < N; i++){
   cin >> An.at(i);
   if(An.at(i)==0){
     cout << "0" <<endl;
     return 0;
   }
 }
 for (long long i = 0; i < N; i++){
   S=S*An.at(i);
   if(S>1000000000000000000){
     cout << "-1" << endl;
     return 0;
   }
 }
 cout<< S <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:2: error: 'cin' was not declared in this scope
    3 |  cin >> N;
      |  ^~~
a.cc:5:2: error: 'vector' was not declared in this scope
    5 |  vector<long long> An(N+1);
      |  ^~~~~~
a.cc:5:9: error: expected primary-expression before 'long'
    5 |  vector<long long> An(N+1);
      |         ^~~~
a.cc:7:4: error: 'An' was not declared in this scope
    7 |    An.at(i)=1;
      |    ^~
a.cc:9:11: error: 'An' was not declared in this scope
    9 |    cin >> An.at(i);
      |           ^~
a.cc:11:6: error: 'cout' was not declared in this scope
   11 |      cout << "0" <<endl;
      |      ^~~~
a.cc:11:20: error: 'endl' was not declared in this scope
   11 |      cout << "0" <<endl;
      |                    ^~~~
a.cc:16:8: error: 'An' was not declared in this scope
   16 |    S=S*An.at(i);
      |        ^~
a.cc:18:6: error: 'cout' was not declared in this scope
   18 |      cout << "-1" << endl;
      |      ^~~~
a.cc:18:22: error: 'endl' was not declared in this scope
   18 |      cout << "-1" << endl;
      |                      ^~~~
a.cc:22:2: error: 'cout' was not declared in this scope
   22 |  cout<< S <<endl;
      |  ^~~~
a.cc:22:13: error: 'endl' was not declared in this scope
   22 |  cout<< S <<endl;
      |             ^~~~