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

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
	int n;
	cin >> n;
	vector<ll> a(n);
	ll mult=1ll;
	ll m18 = 1ll;
	for (int i=0;i< 18;i++) {
		m18 *= 10;
	}

	for (int i=0;i<n;i++) {
		cin >> a.at(i);
	}

	for (int i=0;i<n;i++) {
		if (a.at(i) == 0ll){
			cout << 0 << endl;
            flush(stdout);
			return 0;
		}
	}
	for (int i=0;i<n;i++) {
		mult *= a.at(i);
		if (mult > m18) {
			cout << -1 << endl;
            flush(stdout);
			return 0;
		}
	}
	cout << mult << endl;
    flush(stdout);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:18: error: no matching function for call to 'flush(FILE*&)'
   25 |             flush(stdout);
      |             ~~~~~^~~~~~~~
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
                 from a.cc:1:
/usr/include/c++/14/ostream:766:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::flush(basic_ostream<_CharT, _Traits>&)'
  766 |     flush(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~~
/usr/include/c++/14/ostream:766:5: note:   template argument deduction/substitution failed:
a.cc:25:18: note:   mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'FILE*'
   25 |             flush(stdout);
      |             ~~~~~^~~~~~~~
a.cc:33:18: error: no matching function for call to 'flush(FILE*&)'
   33 |             flush(stdout);
      |             ~~~~~^~~~~~~~
/usr/include/c++/14/ostream:766:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::flush(basic_ostream<_CharT, _Traits>&)'
  766 |     flush(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~~
/usr/include/c++/14/ostream:766:5: note:   template argument deduction/substitution failed:
a.cc:33:18: note:   mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'FILE*'
   33 |             flush(stdout);
      |             ~~~~~^~~~~~~~
a.cc:38:10: error: no matching function for call to 'flush(FILE*&)'
   38 |     flush(stdout);
      |     ~~~~~^~~~~~~~
/usr/include/c++/14/ostream:766:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::flush(basic_ostream<_CharT, _Traits>&)'
  766 |     flush(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~~
/usr/include/c++/14/ostream:766:5: note:   template argument deduction/substitution failed:
a.cc:38:10: note:   mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'FILE*'
   38 |     flush(stdout);
      |     ~~~~~^~~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  a[n];
  long long int p=1;
  for(int i=0;i<n;i++)
  { cin>>a[i];
   p*=a[i];
  }
  if(p>10000000000000000000)
    cout<<-1;
  else
    cout<<p;
  return 0;
}

  

Compiler output:
a.cc:13:8: warning: integer constant is so large that it is unsigned
   13 |   if(p>10000000000000000000)
      |        ^~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'a' was not declared in this scope
    7 |   a[n];
      |   ^
Language: C++

#include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
int main() {
  unsigned long long int n, t = 0;
  cin >> n;
  vector<unsigned long long int> a(n);
  cin >> a[0];
  t = a[0];
  bool sav = false;
  for (unsigned long long int i = 1; i < n; i++) {
    cin >> a[i];
    t *= a[i];
    if (t > 1000000000000000000) {
      sav = true;
    }
  }
  bool tas = find(a.begin(), a.end());
  if (tas == true) {
    cout << 0 << endl;
  } else if (sav == true) {
    cout << -1 << endl;
  } else if (t > 1000000000000000000) {
    cout << -1 << endl;
  } else {
    cout << t << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:18: error: no matching function for call to 'find(std::vector<long long unsigned int>::iterator, std::vector<long long unsigned int>::iterator)'
   23 |   bool tas = find(a.begin(), a.end());
      |              ~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:3842:5: note: candidate: 'template<class _IIter, class _Tp> _IIter std::find(_IIter, _IIter, const _Tp&)'
 3842 |     find(_InputIterator __first, _InputIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:3842:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::find(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
   60 | find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note:   candidate expects 4 arguments, 2 provided
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:3:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

long long int n, sum = 1,a;
    cin >> n;

    for (long long int i = 0; i < n; i++)
    {
        cin >> a;
        sum = sum * a;
    }

    if (sum <= 1000000000000000000)
        cout << sum;
    else
        cout << "-1";

    return 0;

Compiler output:
a.cc:2:5: error: 'cin' does not name a type
    2 |     cin >> n;
      |     ^~~
a.cc:4:5: error: expected unqualified-id before 'for'
    4 |     for (long long int i = 0; i < n; i++)
      |     ^~~
a.cc:4:31: error: 'i' does not name a type
    4 |     for (long long int i = 0; i < n; i++)
      |                               ^
a.cc:4:38: error: 'i' does not name a type
    4 |     for (long long int i = 0; i < n; i++)
      |                                      ^
a.cc:10:5: error: expected unqualified-id before 'if'
   10 |     if (sum <= 1000000000000000000)
      |     ^~
a.cc:12:5: error: expected unqualified-id before 'else'
   12 |     else
      |     ^~~~
a.cc:15:5: error: expected unqualified-id before 'return'
   15 |     return 0;
      |     ^~~~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
int main(){
	int n;
	scanf("%d",&n);
	uint64_t a[n];
	for(int i = 0; i < n; i++){
		scanf("%llu", &a[i]);
	}
	uint64_t sum = 1;
	for(int i = 0; i < n; i++){
		sum *= a[i];
	}
	if(sum > 1000000000000000000){
		puts("-1");
	}else{
		printf("%llu\n", sum);
	}

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:9: error: unknown type name 'uint64_t'
    6 |         uint64_t a[n];
      |         ^~~~~~~~
main.c:3:1: note: 'uint64_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
    2 | #include<stdlib.h>
  +++ |+#include <stdint.h>
    3 | int main(){
main.c:10:9: error: unknown type name 'uint64_t'
   10 |         uint64_t sum = 1;
      |         ^~~~~~~~
main.c:10:9: note: 'uint64_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
Language: C++

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

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

  long long a[n];
  long long ans = 1;
  for(int i = 0; i < n; ++i){
    cin >> a[i];
    if(a[i]==0){
      cout << 0 << endl;
      return 0;
    }
  }
  long long ans=1;
  for(int i = 0; i < n; ++i){
    ans *= a[i];
  }
  if(ans > pow(10,18)){
    cout << -1 << endl;
    return 0;
  }
  cout << ans << endl;
  return 0;
}

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

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


int main() {
  int N;
  cin >> N;
  
  double S =1
  int x;
  
  rep(i, N) {
    cin >> x;
    S *= x;
  }
  
  if(S > 1000000000000000000){
    cout << -1 <<endl;
  }
  
  else{
    cout << S <<endl;
  }
  
  return 0;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'int'
   11 |   int x;
      |   ^~~
a.cc:14:12: error: 'x' was not declared in this scope
   14 |     cin >> x;
      |            ^
Language: Java

/*
 * @author- Vardhan Shah
@Roll no AU1841138
@date-//2019
@description
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
    import java.util.Scanner;
/**
 *
 * @author vardh
 */
public class mul {
    public static void main(String[] args) {
        int x;
        Scanner sc = new Scanner(System.in);
        long ans = 1;
        x=sc.nextInt();
        long[] arr = new long[x];
        for (int i = 0; i < x; i++) {
            arr[i] = sc.nextLong();
        }
        //System.out.println(Math.pow(10, 18));
        for (int i = 0; i < x; i++) {
            ans *= arr[i];
            if (ans > (long)Math.pow(10, 18)) {
                System.out.println("-1");
                return;
            }
        }
        
        System.out.println(ans);
    }
}


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

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const unsigned long long INF = 1000000000000000000;
#define rep1(i, n) for ( i=0; i<(n); i++) 
#define rep2(i, k, n) for (ll i=k; i<(n); i++)


int main() {
    ll n;
    cin >> n;
    vector<ll> a(n, 0);
    unsigned long long ans = 1;
    bool judge = true;
    rep1(i, n){
        cin >> a[i];
    }
    rep1(i, n){
        ans *= a[i];
        if (ans >= INF) judge = false;
        if (a[i] == 0){
            judge = true;
            ans = 0; break;
        }
    }
    if (judge) cout << ans << endl;
    else cout << -1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: 'i' was not declared in this scope
   16 |     rep1(i, n){
      |          ^
a.cc:6:26: note: in definition of macro 'rep1'
    6 | #define rep1(i, n) for ( i=0; i<(n); i++)
      |                          ^
a.cc:19:10: error: 'i' was not declared in this scope
   19 |     rep1(i, n){
      |          ^
a.cc:6:26: note: in definition of macro 'rep1'
    6 | #define rep1(i, n) for ( i=0; i<(n); i++)
      |                          ^
Language: C

#include<stdio.h>
 
int main(){
  int N;
  int A[N];
  int i;
  while(scanf("%d",&)==0);
  
  for(i=0;i=N-1;i++){
    while(scanf("%d",&A[i])==0);
  }
  
  A[N]='\n';
  
  int K=1;
  
  for(i=0;i<N;i++){
    K=K*A[i];
  }
  
  if(K<=1000000000000000000)
    printf("%d\n",K);
  else
    printf("-1\n");
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:21: error: expected expression before ')' token
    7 |   while(scanf("%d",&)==0);
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int cou(long long int k){
	int c = 0;
	while(1){
		k /= 10;
		if(k == 0){
			return co;
		}
		co++;
	}
}
int main(){
	long long int n, a, ans = 1;
	cin >> n;
	for(int i = 0;i < n;i++){
		cin >> a;
		if((cou(a) + cou(ans)) > 18){
			cout << "-1" << endl;
			return 0;
		}
		ans *= a;
		if(ans > 1000000000000000000){
			cout << "-1" << endl;
			return 0;
		}
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int cou(long long int)':
a.cc:8:32: error: 'co' was not declared in this scope; did you mean 'c'?
    8 |                         return co;
      |                                ^~
      |                                c
a.cc:10:17: error: 'co' was not declared in this scope; did you mean 'c'?
   10 |                 co++;
      |                 ^~
      |                 c
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long arr [] = new long[n];
    for(long i=0 ; i<n ; i++)
    {
      arr[i] = sc.nextLong();
    }
    long mult = 1;
    for(long i=0 ; i<n ; i++)
    {
      mult = mult * arr[i];
    }
    System.out.println(mult);
  }
}

Compiler output:
Main.java:6: error: incompatible types: possible lossy conversion from long to int
    long arr [] = new long[n];
                           ^
Main.java:9: error: incompatible types: possible lossy conversion from long to int
      arr[i] = sc.nextLong();
          ^
Main.java:14: error: incompatible types: possible lossy conversion from long to int
      mult = mult * arr[i];
                        ^
3 errors
Language: C++

#include <iostream>
#include <string>
using namespace std;
 
int main(){
  
	int n;
  long int ans=1;
	cin >> n;
    vector<long int> vec(n);
  try{
    checked{
  for (int i=0;i<n;i++){
    cin >> vec.at(i);
    ans*=vec.at(i);
  } 
    }
  }
  catch(OverflowException ex){
    cout << "-1";
    return 0;
  }
  
  cout << ans;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'vector' was not declared in this scope
   10 |     vector<long int> vec(n);
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | #include <string>
a.cc:10:12: error: expected primary-expression before 'long'
   10 |     vector<long int> vec(n);
      |            ^~~~
a.cc:12:5: error: 'checked' was not declared in this scope
   12 |     checked{
      |     ^~~~~~~
a.cc:19:9: error: 'OverflowException' does not name a type
   19 |   catch(OverflowException ex){
      |         ^~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h> 
using namespace std;
#define rep(i, N) for(int i=0; i<N; i++)
typedef long long ll;
#define dump(x) cerr<<#x<<"="<<x<<endl
using P = pair<int, int>;

int main() {
  int n; cin >> n;
  vector<ll> a(n);
  rep(i, n){
    cin >> a.at(i);
    if(a.at(i)==0){
      cout << 0 << endl;
      return 0;
    }
  }

  ll ans = 1LL;
  rep(i,n){
    ll tmp  = ans * a.at(i);
    if(tmp/a.at(i)!=ans){
      cout << -1 < << endl;
      return 0;
    }
    else{
      ans = tmp;
    }
    
 }

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


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

#include <iostream>
#include <string>

using namespace std;

int main()
{
    int N;

    cin >> N;

    __int64 A;

    __int64 ANS = 1;

    for (int i = 0; i < N; i++)
    {
        cin >> A;

        ANS = ANS * A;
    }

    if (ANS > 1000000000000000000)
    {

        ANS = -1;
    }

    cout << ANS << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   12 |     __int64 A;
      |     ^~~~~~~
      |     __int64_t
a.cc:14:12: error: expected ';' before 'ANS'
   14 |     __int64 ANS = 1;
      |            ^~~~
      |            ;
a.cc:18:16: error: 'A' was not declared in this scope
   18 |         cin >> A;
      |                ^
a.cc:20:9: error: 'ANS' was not declared in this scope
   20 |         ANS = ANS * A;
      |         ^~~
a.cc:23:9: error: 'ANS' was not declared in this scope
   23 |     if (ANS > 1000000000000000000)
      |         ^~~
a.cc:29:13: error: 'ANS' was not declared in this scope
   29 |     cout << ANS << endl;
      |             ^~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <sstream>

using namespace std;

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

	vector<long long> A(N);
	long long sum = 1;
	bool isOver = false;
	long long max = (long long)std::pow(10, 18);
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		sum = sum * A[i];
		if (sum > max)
		{
			isOver = true;
			break;
		}
	}

	if (isOver)
	{
		cout << "-1" << endl;
	}
	else
	{
		cout << sum << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:41: error: 'pow' is not a member of 'std'
   17 |         long long max = (long long)std::pow(10, 18);
      |                                         ^~~
Language: C++

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

//g++ -g -o yourexe yourfile.cpp
//./yourexe < yourinput.in > youroutput.out

#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define M 1000000000000000000

#define ull unsigned long long
#define ld long double
#define vi vector<ll>
#define pi pair<ll, ll>
#define vii vector<pi>
#define vvi vector<vi>
#define pb push_back
#define endl "\n"
#define ff first
#define ss second

#define REP(i, s, e) for (ll i = s; i < e; i++)
#define RREP(i, s, e) for (ll i = s; i > e; i--)

#define all(v) v.begin(), v.end()
#define print(v) REP(i,0,v.size())cout<<v[i]<<" ";


int main() {
    fast
    ll t;
    //cin>>t;
    t=1;
    while(t--){
      ull n;
      cin>>n;
      ull arr[n];
      ull ans=1;
      REP(i,0,n){cin>>arr[i];if(arr[i]==0){ans=0;break;}}
      if(ans==0)cout<<0<<endl;
      else{
      REP(i,0,n){
        ans*=arr[i];
        if(ans>M)cout<<-1<<endl;
      }
      if(ans<=M)cout<<ans<<endl;
    }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: 'll' was not declared in this scope; did you mean 'ull'?
   31 |     ll t;
      |     ^~
      |     ull
a.cc:33:5: error: 't' was not declared in this scope; did you mean 'tm'?
   33 |     t=1;
      |     ^
      |     tm
a.cc:39:11: error: expected ';' before 'i'
   39 |       REP(i,0,n){cin>>arr[i];if(arr[i]==0){ans=0;break;}}
      |           ^
a.cc:22:30: note: in definition of macro 'REP'
   22 | #define REP(i, s, e) for (ll i = s; i < e; i++)
      |                              ^
a.cc:39:11: error: 'i' was not declared in this scope
   39 |       REP(i,0,n){cin>>arr[i];if(arr[i]==0){ans=0;break;}}
      |           ^
a.cc:22:37: note: in definition of macro 'REP'
   22 | #define REP(i, s, e) for (ll i = s; i < e; i++)
      |                                     ^
a.cc:42:11: error: expected ';' before 'i'
   42 |       REP(i,0,n){
      |           ^
a.cc:22:30: note: in definition of macro 'REP'
   22 | #define REP(i, s, e) for (ll i = s; i < e; i++)
      |                              ^
a.cc:42:11: error: 'i' was not declared in this scope
   42 |       REP(i,0,n){
      |           ^
a.cc:22:37: note: in definition of macro 'REP'
   22 | #define REP(i, s, e) for (ll i = s; i < e; i++)
      |                                     ^
Language: Java

import java.util.Scanner;

public class Main{
  static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    double a = sc.nextInt();
    while(sc.next()){
      a *= sc.nextInt();
    }
    
    if(a > (10^18)){
      System.out.print(-1);
    }else{
      System.out.print(a);
    }
  }
}

Compiler output:
Main.java:7: error: incompatible types: String cannot be converted to boolean
    while(sc.next()){
                 ^
1 error
Language: C++

#include<iostream>
using namespace std;

int main(){
  int t;
  cin>>t;
  unsigned long long int w=1;
  long long int q= 1000000000000000000;
  bool limited= true;
  bool zero= false
  while(t--){
    unsigned long long int n;
    cin>>n;
    if(n==0){
    zero= true;
    }
    if(n>q){
      limited = false;
      break;
    }
    w=w*n
      if(w>q){
        limited = false;
        break;
      }
  }
  if(zero){
    cout<<0<<endl;
  }else if(limited){
  cout<<w<<endl;
  }else{
    cout<<-1<<endl;
  }
  
}

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

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

int main() {
  int N,B;
  int i = 0;
  
  cin >> N;
  int A[N];
  
  B=1;
  while(i<N){
    B=B*A[i];
    i++;
  }
  If(B>1000000000000000000){
    B=-1;
  }
cout << B;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'If' was not declared in this scope
   16 |   If(B>1000000000000000000){
      |   ^~
Language: C++

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

//g++ -g -o yourexe yourfile.cpp
//./yourexe < yourinput.in > youroutput.out

#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define M 1000000000000000000

#define ll long long
#define ld long double
#define vi vector<ll>
#define pi pair<ll, ll>
#define vii vector<pi>
#define vvi vector<vi>
#define pb push_back
#define endl "\n"
#define ff first
#define ss second

#define REP(i, s, e) for (ll i = s; i < e; i++)
#define RREP(i, s, e) for (ll i = s; i > e; i--)

#define all(v) v.begin(), v.end()
#define print(v) REP(i,0,v.size())cout<<v[i]<<" ";


int main() {
    fast
    ll t;
    //cin>>t;
    t=1;
    while(t--){
      ull n;
      cin>>n;
      ull arr[n];
      ull ans=1;
      REP(i,0,n){cin>>arr[i];if(arr[i]==0){ans=0;break;}}
      if(ans==0)cout<<0<<endl;
      else{
      REP(i,0,n){
        ans*=arr[i];
        if(ans>M)cout<<-1<<endl;
      }
      if(ans<=M)cout<<ans<<endl;
    }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:7: error: 'ull' was not declared in this scope; did you mean 'all'?
   35 |       ull n;
      |       ^~~
      |       all
a.cc:36:12: error: 'n' was not declared in this scope
   36 |       cin>>n;
      |            ^
a.cc:37:10: error: expected ';' before 'arr'
   37 |       ull arr[n];
      |          ^~~~
      |          ;
a.cc:38:10: error: expected ';' before 'ans'
   38 |       ull ans=1;
      |          ^~~~
      |          ;
a.cc:39:23: error: 'arr' was not declared in this scope
   39 |       REP(i,0,n){cin>>arr[i];if(arr[i]==0){ans=0;break;}}
      |                       ^~~
a.cc:39:44: error: 'ans' was not declared in this scope; did you mean 'abs'?
   39 |       REP(i,0,n){cin>>arr[i];if(arr[i]==0){ans=0;break;}}
      |                                            ^~~
      |                                            abs
a.cc:40:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   40 |       if(ans==0)cout<<0<<endl;
      |          ^~~
      |          abs
a.cc:43:14: error: 'arr' was not declared in this scope
   43 |         ans*=arr[i];
      |              ^~~
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long arr [] = new long[n];
    for(long i=0 ; i<n ; i++)
    {
      arr[i] = sc.nextLong();
    }
    long mult = 1;
    for(long i=0 ; i<n ; i++)
    {
      mult = mult * a[i];
    }
    System.out.println(mult);
  }
}

Compiler output:
Main.java:6: error: incompatible types: possible lossy conversion from long to int
    long arr [] = new long[n];
                           ^
Main.java:9: error: incompatible types: possible lossy conversion from long to int
      arr[i] = sc.nextLong();
          ^
Main.java:14: error: cannot find symbol
      mult = mult * a[i];
                    ^
  symbol:   variable a
  location: class Main
Main.java:14: error: incompatible types: possible lossy conversion from long to int
      mult = mult * a[i];
                      ^
4 errors
Language: C

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

int main()
{

	int i;
	int A;
	int ans;
	
	// 整数の入力
	for(int i; i < N ; i++)
	{
		scanf("%d", &A);
		
		ans = ans * A;
	}
	
	// 出力
	
	if(ans < 10^18){
		printf("%d",ans);
	
	}else{
		printf("-1")
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:24: error: 'N' undeclared (first use in this function)
   14 |         for(int i; i < N ; i++)
      |                        ^
main.c:14:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:27:29: error: expected ';' before '}' token
   27 |                 printf("-1")
      |                             ^
      |                             ;
   28 |         }
      |         ~
Language: C++

#include <iostream>
#include <math>


int main(void){
    unsigned int N;
    std::cin >> N;
    unsigned long long c = 0;
    unsigned long long mul = 1;
    for(int i = 0; i < N; i++){
        std::cin >> c;
        if(log(c) / log(10) + log(mul) / log(10) > 18){
            std::cout << -1 << std::endl;
            return 0;
        }
        mul *= c;
    }
    std::cout << mul << std::endl;
    return 0;
}



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

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <sstream>

using namespace std;

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

	vector<long long> A(N);
	long long sum = 1;
	bool isOver = false;
	long long max = std::pow(10, 18);
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		sum = sum * A[i];
		if (sum > max)
		{
			isOver = true;
			break;
		}
	}

	if (isOver)
	{
		cout << "-1" << endl;
	}
	else
	{
		cout << sum << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:30: error: 'pow' is not a member of 'std'
   17 |         long long max = std::pow(10, 18);
      |                              ^~~
Language: C++

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

int main() {
  int N,B;
  int i = 0;
  
  cin >> N;
  int A[N];
  
  B=1;
  while(i<N){
    B=B*A[i];
    i++;
  }
  If(B>10^18){
    B=-1;
  }
cout << B;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'If' was not declared in this scope
   16 |   If(B>10^18){
      |   ^~
Language: C

#include<stdio.h>

int main(){
  int N;
  int A[N];
  int i;
  while(scanf("%d",&)==0);
  
  for(i=0;i=N-1;i++){
    while(scanf("%d",&A[i])==0);
  }
  
  A[N]='\n';
  
  int K=1;
  
  for(i=0;i<N;i++){
    K=K*A[i];
  }
  
  if(K<=1000000000000000000)
    printf("%d\n",K);
  else
    printf("-1\n");
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:21: error: expected expression before ')' token
    7 |   while(scanf("%d",&)==0);
      |                     ^
Language: C++

# created by dipta10

n = int(input())
ls = list(map(int, input().split(' ')))

ls = sorted(ls)
f = 1
ans = 1
inf = 1000000000000000000
for x in ls:
    ans *= x
    if ans > inf:
        f = 0
        break

if f == 1:
    print(ans)
else:
    print("-1")



Compiler output:
a.cc:1:3: error: invalid preprocessing directive #created
    1 | # created by dipta10
      |   ^~~~~~~
a.cc:3:1: error: 'n' does not name a type
    3 | n = int(input())
      | ^
Language: C++

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

int main() {
  cpp_int n;
  cin >> n;
  cpp_int prod = 1;
  for (int i = 0; i < n; i++){
    cpp_int cur;
    cin >> cur;
    prod *= cur;
  }
  if (prod > 1e18)
    cout << -1 << endl;
  else
    cout << prod << endl;
} 

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: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long arr [] = new long[n];
    for(long i=0 ; i<n ; i++)
    {
      arr[i] = sc.nextLong();
    }
    long mult = 1;
    for(long i=0 ; i<n ; i++)
    {
      mult = mult * a[i];
    }
    System.out.println(mult);
}

Compiler output:
Main.java:17: error: reached end of file while parsing
}
 ^
1 error
Language: C++

using namespace std;
int main(){
	int n;
	cin >> n;
	vector<int long long> a(n);
	for (int i = 0; i < n; ++i)
	{
		cin >> a.at(i);
	}
	sort(a.begin(),a.end());
	int long long p=1;
	for (int i = 0; i < n; ++i)
	{
		p = p*a.at(i);
	}
	if(p>1000000000000000000){
		cout << -1 << endl;
	}
	else{
		cout << p << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         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:5:9: error: 'vector' was not declared in this scope
    5 |         vector<int long long> a(n);
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:5:16: error: expected primary-expression before 'int'
    5 |         vector<int long long> a(n);
      |                ^~~
a.cc:8:24: error: 'a' was not declared in this scope
    8 |                 cin >> a.at(i);
      |                        ^
a.cc:10:14: error: 'a' was not declared in this scope
   10 |         sort(a.begin(),a.end());
      |              ^
a.cc:10:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |         sort(a.begin(),a.end());
      |         ^~~~
      |         short
a.cc:17:17: error: 'cout' was not declared in this scope
   17 |                 cout << -1 << endl;
      |                 ^~~~
a.cc:17:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:17:31: error: 'endl' was not declared in this scope
   17 |                 cout << -1 << endl;
      |                               ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:20:17: error: 'cout' was not declared in this scope
   20 |                 cout << p << endl;
      |                 ^~~~
a.cc:20:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:30: error: 'endl' was not declared in this scope
   20 |                 cout << p << endl;
      |                              ^~~~
a.cc:20:30: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  int N;
  cin >> N;
  
  vector<int64_t> a(N);
  for(int i=0;i<N;i++){
      cin >> a[i];
  }
  int64_t flag = 1000000000000000000;
  int64_t answer = 1;

    for(int i=0;i<N;i++){
        answer = answer * a[i];
      	if(answer > flag){
        	    cout << answer << endl;
          return 0;
        {
    }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:16:25: note: to match this '{'
   16 |     for(int i=0;i<N;i++){
      |                         ^
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

//   Rishabh Agarwal
#include <bits/stdc++.h>
#define F first
#define S second
#define MAX 10000003
using namespace std;

typedef long long int ll;
const ll mod = 1e17;
long double PI=3.1415926;

ll power(ll a,ll b){
    if(b==0){
        return 1;
    }
    ll temp=power(a,b/2)%mod;
    if(b%2==0){
        return (temp*temp)%mod;
    }
    else{
        return ((a*temp)%mod*temp)%mod;
    }
}

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

vector<ll>v;
vector<ll>::iterator it;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll t;
    //cin>>t;
    t=1;
    //ll c=1;
    while(t--){
        ll n;
        cin>>n;
        ll a[n];
        for(ll x=0; x<n; x++){
            cin>>a[x];
        }
        //sort(a,a+n);
        ll ans=1;
        //ll g=1e18;
        for(ll x=0; x<n; x++){
            ans=ans*a[x];
        }
        if(ans>g||ans<0){
            ans=-1;
            //break;
        }
        cout<<ans<<"\n";
        v.clear();
        //cout<<"Case #"<<c<<": "<<ans<<"\n";
        //c++;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:16: error: 'g' was not declared in this scope
   58 |         if(ans>g||ans<0){
      |                ^
Language: Java

import java.util.*;
import java.math.BigInteger;
public class Main 
{
	public static void main(String[] args)
    {
      BigInteger mul = new BigInteger("1");
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
        while(num >= 0)
        {
          int b = sc.nextInt();
          mul.multiply(new BigInteger(sc.nextInt()));
          num--;
        }
      BigInteger bd = new BigInteger("1000000000000000000");
      if(mul.equals(bd) || mul.compareTo(bd)>0)
		System.out.println(mul);
      else
        System.out.println(-1);
	}
}

Compiler output:
Main.java:13: error: no suitable constructor found for BigInteger(int)
          mul.multiply(new BigInteger(sc.nextInt()));
                       ^
    constructor BigInteger.BigInteger(byte[]) is not applicable
      (argument mismatch; int cannot be converted to byte[])
    constructor BigInteger.BigInteger(int[]) is not applicable
      (argument mismatch; int cannot be converted to int[])
    constructor BigInteger.BigInteger(String) is not applicable
      (argument mismatch; int cannot be converted to String)
    constructor BigInteger.BigInteger(long) is not applicable
      (BigInteger(long) has private access in BigInteger)
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C++

#include<iostream>
using namespace std;
#define K 1000000000000000000

int main() {
  int N;
  cin >> N;
  
  long long A[N];
  long long ans = 1;
  for(int i=0; i<N; i++){
    cin >> A[i];
    ans *= A[i];
    if(ans > K){
      cout << -1 << endl;
      return 0
    }
    if(ans == 0){
      cout << ans << endl;
      return 0
    }
  }
  cout << ans << endl;
  return 0;
}
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: expected ';' before '}' token
   16 |       return 0
      |               ^
      |               ;
   17 |     }
      |     ~          
a.cc:20:15: error: expected ';' before '}' token
   20 |       return 0
      |               ^
      |               ;
   21 |     }
      |     ~          
a.cc: At global scope:
a.cc:26:3: error: expected declaration before '}' token
   26 |   }
      |   ^
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C

nclude <stdio.h>
 
int main(void)
{
    int x,y,i;
    int array[x];
 
    scanf("%d",&x);
    y=1;
    for(i=0;i<x;i++)
    {
        scanf("%d",&array[x]);
        y=y*array[x];
    }
 
    if(y<=1000000000000000000)
    {
        printf("%d",y);
    } else{
        printf("-1");
    };
    
    return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | nclude <stdio.h>
      |        ^
Language: C++

#include <iostream>
#include <cmath>
typedef unsigned long long ulong;

using namespace std;

int main(void){
    ulong n, *a, sum = 1;
    cin >> n;
    a = new ulong[n];
    for (size_t i = 0; i < n; i++) {
        cin >> a[i];
        sum *= a[i];
    }
    if (sum >= pow(10, 19)) {
        cout << -1 << endl;
    }else{
        cout << sum << endl;
    }

    return 0;
}


Compiler output:
a.cc:3:28: error: conflicting declaration 'typedef long long unsigned int ulong'
    3 | typedef unsigned long long ulong;
      |                            ^~~~~
In file included from /usr/include/stdlib.h:514,
                 from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/sys/types.h:148:27: note: previous declaration as 'typedef long unsigned int ulong'
  148 | typedef unsigned long int ulong;
      |                           ^~~~~
Language: C++

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

return 0;

}

Compiler output:
a.cc:2:1: error: 'usingnamespace' does not name a type
    2 | usingnamespace std;
      | ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   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:14:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   cout<<res;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |     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 <bits/stdc++.h>
using namespace std;
typedef long long ll;

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

    vector<ll> A(N);
    for (ll i = 0; i < N; i++)
    {
        cin >> A[i];
    }

    ll ans = 1;
    for (ll i = 0; i < N; i++)
    {
        ans *= A[i];
        if (ans > 1000000000000000000)
        {
            cout << "-1" << endl;
            return;
        }
    }

    cout << ans << endl;
}


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

#include<bits/stdc++.h>
using namespace std;
template <typename T> using vec = vector<T>;

int main()
{
    int n;
    cin >> n;
    long ans =1;
    vec<long> a(n);
    for (auto &&e : a)
    {
        cin >> e;
    }
    sort(a.begin(),a.end());
    long ans = 1;
    bool flag = true;
    for (auto &&e : a)
    {
        ans *= e;
        if (ans > 1000000000000000000)
        {
            flag = false;
            break;
        }
        
    }
    if(flag)
    {
        cout << ans << endl;
    }
    else
    {
        cout << -1 << endl;
    }
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: redeclaration of 'long int ans'
   16 |     long ans = 1;
      |          ^~~
a.cc:9:10: note: 'long int ans' previously declared here
    9 |     long ans =1;
      |          ^~~
Language: Java

import java.util.*;
import java.math.BigInteger;
public class Main 
{
	public static void main(String[] args)
    {
      BigInteger mul = new BigInteger("1");
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
        while(num >= 0)
        {
          int b = sc.nextInt();
          mul.multiply(new BigInteger(b));
          num--;
        }
      BigInteger bd = new BigInteger("1000000000000000000");
      if(mul.equals(bd) || mul.compareTo(bd)>0)
		System.out.println(mul);
      else
        System.out.println(-1);
	}
}

Compiler output:
Main.java:13: error: no suitable constructor found for BigInteger(int)
          mul.multiply(new BigInteger(b));
                       ^
    constructor BigInteger.BigInteger(byte[]) is not applicable
      (argument mismatch; int cannot be converted to byte[])
    constructor BigInteger.BigInteger(int[]) is not applicable
      (argument mismatch; int cannot be converted to int[])
    constructor BigInteger.BigInteger(String) is not applicable
      (argument mismatch; int cannot be converted to String)
    constructor BigInteger.BigInteger(long) is not applicable
      (BigInteger(long) has private access in BigInteger)
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C++

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


int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  
  double S =1
  
  rep(i, N) {
    cin >> A.at(i);
    S *= A.at(i);
  }
  
  if(S > 1000000000000000000){
    cout << -1 <<endl;
  }
  
  else{
    cout << S <<endl;
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:19: error: expected ',' or ';' before 'for'
    3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                   ^~~
a.cc:13:3: note: in expansion of macro 'rep'
   13 |   rep(i, N) {
      |   ^~~
a.cc:13:7: error: 'i' was not declared in this scope
   13 |   rep(i, N) {
      |       ^
a.cc:3:35: note: in definition of macro 'rep'
    3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                                   ^
Language: C++

#include<bits/stdc++.h> 
using namespace std; 
//python interactive_runner.py python3 local_testing_tool.py 0 -- ./Code
 
#define x first
#define y second
#define rep(i, a,b) for(int i = int(a); i < int(b); ++i)
#define forn(i,b) for(int i = 0; i < int(b); ++i)
const long long INF =1000000000000000000;

void solve(){
	int N;
	cin>>N;
	long long prod = 1;
	vector<long long> num(N);
    int f0 = 0;
	forn(i,N){
		cin>>num[i];
		if(a==0){
			cout<<0<<'\n';
			return;
		}
		
		if(INF/num[i]<prod){
			f0 = 1;
		}	
		prod = prod * a;	
	}
	if(f0){
		cout<<-1<<'\n';
		return;
	} 
	cout<<prod<<'\n';
//	long long A;
//	string B;
//	cin>>A>>B;
//	int st = ((B[0]-'0')*100)+((B[2]-'0')*10)+((B[3]-'0'));
//	cout<<(A*st)/100<<'\n';
}
int main(){

	 solve();
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:19:20: error: 'a' was not declared in this scope
   19 |                 if(a==0){
      |                    ^
a.cc:27:31: error: 'a' was not declared in this scope
   27 |                 prod = prod * a;
      |                               ^
Language: C++

#include<queue>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;

int main(){
    int n;
    cin >> n;
    long long a[n];
    long long ans=1;
    for(int i=0;i<n;i++){
        cin >> a[i];
        if(a[i]==0){
            ans =0;
        }
    }
    if(ans==0){
        cout << 0 << endl;
        return 0;
    }

    long long A = pow(10,18);
    for(int i=0;i<n;i++){
        if(ans*a[i]>A){
            cout << -1 << endl;
            return 0;
        }
        ans *= a[i];
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin >> n;
      |     ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include<cmath>
  +++ |+#include <iostream>
    5 | using namespace std;
a.cc:19:9: error: 'cout' was not declared in this scope
   19 |         cout << 0 << endl;
      |         ^~~~
a.cc:19:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:22: error: 'endl' was not declared in this scope
   19 |         cout << 0 << endl;
      |                      ^~~~
a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    4 | #include<cmath>
  +++ |+#include <ostream>
    5 | using namespace std;
a.cc:26:13: error: 'cout' was not declared in this scope
   26 |             cout << -1 << endl;
      |             ^~~~
a.cc:26:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:27: error: 'endl' was not declared in this scope
   26 |             cout << -1 << endl;
      |                           ^~~~
a.cc:26:27: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:31:5: error: 'cout' was not declared in this scope
   31 |     cout << ans << endl;
      |     ^~~~
a.cc:31:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:20: error: 'endl' was not declared in this scope
   31 |     cout << ans << endl;
      |                    ^~~~
a.cc:31:20: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

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

int32_t main() {
  cpp_int n;
  cin >> n;
  cpp_int prod = 1;
  for (int i = 0; i < n; i++){
    cpp_int cur;
    cin >> cur;
    prod *= cur;
  }
  if (prod > 1e18)
    cout << -1 << endl;
  else
    cout << prod << endl;
} 

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.