criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.*;
import java.lang.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long p = 1;

		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			p = p * sc.nextLong();
		}
		if (p > 1000000000000000000) {
        	System.out.println(-1);
          	return;
        }
		System.out.println(p);
	}
}

Compiler output:
Main.java:13: error: integer number too large
		if (p > 1000000000000000000) {
		        ^
1 error
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long p = 1;

		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			p = p * sc.nextLong();
		}
		if (p > 1000000000000000000) System.out.println(-1);
		System.out.println(p);
	}
}

Compiler output:
Main.java:12: error: integer number too large
		if (p > 1000000000000000000) System.out.println(-1);
		        ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ;;;
int main(){
  ll sm=1,an=1e18;
  int n;cin>>n;ll ls[n];
  for(int u=0;u<n;u++)cin>>ls[u];
  for(ll x:ls){
    sm*=x;
    if(sm>=an)break;}
  cout<<(sm>=an? -1:sm);
}

Compiler output:
a.cc:3:14: error: declaration does not declare anything [-fpermissive]
    3 | typedef long long ;;;
      |              ^~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'll' was not declared in this scope
    5 |   ll sm=1,an=1e18;
      |   ^~
a.cc:6:18: error: expected ';' before 'ls'
    6 |   int n;cin>>n;ll ls[n];
      |                  ^~~
      |                  ;
a.cc:7:28: error: 'ls' was not declared in this scope
    7 |   for(int u=0;u<n;u++)cin>>ls[u];
      |                            ^~
a.cc:8:9: error: expected ';' before 'x'
    8 |   for(ll x:ls){
      |         ^~
      |         ;
a.cc:11:10: error: 'sm' was not declared in this scope; did you mean 'tm'?
   11 |   cout<<(sm>=an? -1:sm);
      |          ^~
      |          tm
a.cc:11:14: error: 'an' was not declared in this scope; did you mean 'n'?
   11 |   cout<<(sm>=an? -1:sm);
      |              ^~
      |              n
a.cc:12:1: error: expected primary-expression before '}' token
   12 | }
      | ^
a.cc:11:25: error: expected ')' before '}' token
   11 |   cout<<(sm>=an? -1:sm);
      |                         ^
      |                         )
   12 | }
      | ~                        
a.cc:8:6: note: to match this '('
    8 |   for(ll x:ls){
      |      ^
a.cc:12:1: error: expected primary-expression before '}' token
   12 | }
      | ^
Language: C++

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

int main() {
  int n;
  long long ans=1;
  bool x=true;
  for (int i=0;i<n;i++) {
	long long a;
    cin>>a;
    ans*=a;
    if (ans<0) {
      x=false;
      break;
    }
    if (x)
      cout<<ans<<endl;
    else cout<<-1<<endl;
  }

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

#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include <queue>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define srep(i,s,t) for (int i = s; i < t; i++)
#define drep(i,n) for(int i = (n)-1; i >= 0; i--)
using namespace std;
typedef long long ll;
typedef vector<vector<char>> field_t;
typedef unsigned long long ull;
typedef pair<int, int> point_t;


int main()
{
    int64_t N,ans,zero;
    cin >> N;
    ans=1;
    vector<int64_t> A(N);
    for(int64_t i=0;i<N;i++){
        cin >> A[i];
    }
    for(int64_t i=0;i<N;i++){
        if(A[i]==0){
            zero++;
        }
        if(zero>0){
            cout << 0 << endl;
            return 0;
        }
    for(int64_t i=0;i<N;i++){

        ans*=A[i];
        if(ans>1000000000000000000){
            ans=-1;
            break;
        }
    }
    cout << ans <<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:2: error: expected '}' at end of input
   42 | }
      |  ^
a.cc:16:1: note: to match this '{'
   16 | {
      | ^
Language: Java

import java.util.*;
 
public class Main{
  public static void main(String[] args){
    Scanner st = new Scanner(System.in);
    long sum=1L;
    int num= st.nextInt();
    for(int i=0;i<num;i++){
      sum *= st.nextLong();
      if(sum > 1000000000000000000L) {
        sum=-1;
        goto End;
      }
    }
    End:
    System.out.println(sum);
  }
}

Compiler output:
Main.java:12: error: illegal start of expression
        goto End;
        ^
Main.java:12: error: not a statement
        goto End;
             ^
2 errors
Language: Java

import java.util.*;
 
public class Main{
  public static void main(String[] args){
    Scanner st = new Scanner(System.in);
    long sum=1L;
    int num= st.nextInt();
    for(int i=0;i<num;i++){
      sum *= st.nextLong();
      if(sum > 1000000000000000000) {
        sum=-1;
        break;
      }
    }
    System.out.println(sum);
  }
}

Compiler output:
Main.java:10: error: integer number too large
      if(sum > 1000000000000000000) {
               ^
1 error
Language: Java

import java.util.*;
 
public class Main{
  public static void main(String[] args){
    Scanner st = new Scanner(System.in);
    long sum=1L;
    int num= st.nextInt();
    for(int i=0;i<num;i++){
      sum *= (long)st.nextInt();
      if(sum > 1000000000000000000) {
        sum=-1;
        break;
      }
    }
    System.out.println(sum);
  }
}

Compiler output:
Main.java:10: error: integer number too large
      if(sum > 1000000000000000000) {
               ^
1 error
Language: Java

import java.util.*;
 
public class Main{
  public static void main(String[] args){
    Scanner st = new Scanner(System.in);
    long sum=1L;
    int num= st.nextInt();
    for(int i=0;i<num;i++){
      sum *= (long)st.nextInt();
      if(sum >=1000000000000000000) {
        sum=-1;
        break;
      }
    }
    System.out.println(sum);
  }
}

Compiler output:
Main.java:10: error: integer number too large
      if(sum >=1000000000000000000) {
               ^
1 error
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner st = new Scanner(System.in);
    long sum=1L;
    int num= st.nextInt();
    for(int i=0;i<num;i++){
      sum *= st.nextInt();
      if(sum >=1000000000000000000) {
        sum=-1;
        brake;
      }
    }
    System.out.println(sum);
  }
}

      

Compiler output:
Main.java:10: error: integer number too large
      if(sum >=1000000000000000000) {
               ^
Main.java:12: error: not a statement
        brake;
        ^
2 errors
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
  unsigned long long a=1;
  for (int i = 0; i < N; i++) {
    unsigned long long b;
    cin>>b;
    if(1000000000000000001/b>a){
      cout<<-1<<endl;
      return 0;
    }
    else{
      a*=b;
    }
 
  }
    
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: 'N' was not declared in this scope
    7 |   for (int i = 0; i < N; i++) {
      |                       ^
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define mod 1000000007
// #define mod 998244353
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	ll a[n], ans = 1;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
		if (ans != -1)
		{
			if (1000000000000000000 / ans > a[i])
			{
				ans *= a[i];
			}
			else if (1000000000000000000 / ans == a[i] && 1000000000000000000 % ans == 0)
			{
				ans *= a[i];
			}
			else
			{
				ans = -1'
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:32:41: warning: missing terminating ' character
   32 |                                 ans = -1'
      |                                         ^
a.cc:32:41: error: missing terminating ' character
a.cc: In function 'int main()':
a.cc:32:41: error: expected ';' before '}' token
   32 |                                 ans = -1'
      |                                         ^
      |                                         ;
   33 |                         }
      |                         ~
Language: C++

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

int main() {
  int n;
  cin >> n;
  
  vector<long> arr(n);
  for(int i = 0; i < n; ++i) cin >> arr[i];
  
  for (int i = 0;i < n; ++i) {
    if (arr[i] == 0) {
      cout << 0;
      return 0;
    }
    long prod = 1;
    for (int i = 0; i < n; ++i) {
      if (prod * arr[i] < 1e+18) prod *= arr[i];
      else {cout << -1; return 0;}
    }
  cout << prod;
  return 0;
}
      

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

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

int main() {
  int n;
  cin >> n;
  
  vector<long> arr(n);
  for(int i = 0; i < n; ++i) cin >> arr[i];
  
  for (int i = 0;i < n; ++i) {
    if (arr[i] == 0) {
      cout << 0;
      return 0;
    }
    long prod = 1;
    for (int i = 0; i < n; ++i) {
      if (prod * arr[i] < 1e+18) prod *= arr[i];
      else {cout << -1; return 0;}
    }
  }
  cout << prod;
  return 0;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:22:11: error: 'prod' was not declared in this scope
   22 |   cout << prod;
      |           ^~~~
Language: C++

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

int main()
{
	int n;

	cin >> n;

	double a[n];
	double m = 1;

	for (double i = 0; i < n; i++)
	{
		cin >> a[i];
		m *= a[i];
	}
	if (m < 1e+18)
	{
		cout << m << endl;
	}
	else
	{
		cout << -1 << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:25: error: invalid types 'double [n][double]' for array subscript
   15 |                 cin >> a[i];
      |                         ^
a.cc:16:23: error: invalid types 'double [n][double]' for array subscript
   16 |                 m *= a[i];
      |                       ^
Language: C++

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

int main()
{
	double n;

	cin >> n;

	double a[n];
	double m = 1;

	for (double i = 0; i < n; i++)
	{
		cin >> a[i];
		m *= a[i];
	}
	if (m < 1e+18)
	{
		cout << m << endl;
	}
	else
	{
		cout << -1 << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   10 |         double a[n];
      |                  ^
a.cc:10:18: error: could not convert 'n' from 'double' to 'long unsigned int'
   10 |         double a[n];
      |                  ^
      |                  |
      |                  double
a.cc:10:18: error: size of array 'a' has non-integral type 'double'
a.cc:15:25: error: invalid types 'double [1][double]' for array subscript
   15 |                 cin >> a[i];
      |                         ^
a.cc:16:23: error: invalid types 'double [1][double]' for array subscript
   16 |                 m *= a[i];
      |                       ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
  
  int N;
  cin >> N;

  int a=1;
  int A;
  
  for(int i=0;i<N;i++){
    cin >> A;
    a *=  A;
  }
  if(a>=10e18){
    return -1;
  }
  else cout << a << endl;  

  
  }
}

Compiler output:
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

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

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

	sort(A.begin(), A.end());

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

	}

	cout << ans << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:51: error: 'prod' was not declared in this scope
   23 |                 if (A[i] <= 1000000000000000000 / prod) {
      |                                                   ^~~~
Language: Java

import java.io.BufferedReader; 
import java.io.IOException; 
import java.io.InputStreamReader; 
import java.util.Scanner; 
import java.util.StringTokenizer; 
  
public class Main 
{ 
    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; 
        } 
    } 
  
    public static void main(String[] args) 
    { 
        FastReader s=new FastReader(); 
        long  n,x,i;
        BigInteger f=new BigInteger("1");
        BigInteger l=new BigInteger("1000000000000000000");
         n = s.nextLong(); 
        while (n-- > 0) 
        { 
           x=s.nextLong();
           f=f.multiply(BigInteger.valueOf(x));
        } 
       int val=f.compareTo(l);
        if(val==1)System.out.println("-1");
        else System.out.println(f);
    } 
} 

Compiler output:
Main.java:70: error: cannot find symbol
        BigInteger f=new BigInteger("1");
        ^
  symbol:   class BigInteger
  location: class Main
Main.java:70: error: cannot find symbol
        BigInteger f=new BigInteger("1");
                         ^
  symbol:   class BigInteger
  location: class Main
Main.java:71: error: cannot find symbol
        BigInteger l=new BigInteger("1000000000000000000");
        ^
  symbol:   class BigInteger
  location: class Main
Main.java:71: error: cannot find symbol
        BigInteger l=new BigInteger("1000000000000000000");
                         ^
  symbol:   class BigInteger
  location: class Main
Main.java:76: error: cannot find symbol
           f=f.multiply(BigInteger.valueOf(x));
                        ^
  symbol:   variable BigInteger
  location: class Main
5 errors
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define ll long long

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

	sort(A.begin(), A.end());

	ll ans=1;
	rep(i,n){
		if (A[i]==0) {
			cout<<0<<endl;
			return 0;
		}
		if (A[i]<=1e18/ans) {
			ans*= A[i];
		} else {
			cout<<"-1"<<endl;
			return 0;
		}

	}

	cout<<ans<<endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'i' was not declared in this scope
   11 |         rep(i,n){
      |             ^
a.cc:11:9: error: 'rep' was not declared in this scope
   11 |         rep(i,n){
      |         ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define ll long long

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

	sort(A.begin(), A.end());

	ll ans=1;
	for(i,n){
		if (A[i]==0) {
			cout<<0<<endl;
			return 0;
		}
		if (A[i]<=1e18/ans) {
			ans*= A[i];
		} else {
			cout<<"-1"<<endl;
			return 0;
		}

	}

	cout<<ans<<endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'i' was not declared in this scope
   11 |         rep(i,n){
      |             ^
a.cc:11:9: error: 'rep' was not declared in this scope
   11 |         rep(i,n){
      |         ^~~
a.cc:34:9: error: expected primary-expression before 'return'
   34 |         return 0;
      |         ^~~~~~
a.cc:32:25: error: expected ')' before 'return'
   32 |         cout<<ans<<endl;
      |                         ^
      |                         )
   33 | 
   34 |         return 0;
      |         ~~~~~~           
a.cc:18:12: note: to match this '('
   18 |         for(i,n){
      |            ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int (i) = 0; (i) < (n); i++)
#define ll long long
using namespace std;
 
int main() {
  ll n,a[100005];
  ans=1,c=1000000000000000000;
  cin>>n;
  rep(i,n){
    cin>>a[i];
    if(a[i]==0){
    	cout<<"0"<<endl;
    	return 0;
		  }
    }
    ans=a[0];
    rep(i,n){
      if(ans*a[i]>c || a[i]*ans<ans){
        cout<<"-1"<<endl;
      	return(0);
      }
      else{
        ans*=a[i];
      }
    }
    cout<<ans<<endl;
    return(0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |   ans=1,c=1000000000000000000;
      |   ^~~
      |   abs
a.cc:8:9: error: 'c' was not declared in this scope
    8 |   ans=1,c=1000000000000000000;
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
	long long n;
	cin>>n;
	bool Flag=false;
	long long a,b=1,MAX=pow(10,18);
	for(long long i=0;i<n;i++){
		cin>>a;
		b*=a;
		if(b>MAX||b<0) Flag=true;
		if(a==0){
			cout<<0;
			return 0;
		}
	}
	if(Flag==true) cout<<"-1";
	else cout<<b;
	return 0;
}#include <bits/stdc++.h>
using namespace std;
int main(void){
	long long n;
	cin>>n;
	bool Flag=false;
	long long a,b=1,MAX=pow(10,18);
	for(long long i=0;i<n;i++){
		cin>>a;
		b*=a;
		if(b>MAX||b<0) Flag=true;
		if(a==0){
			cout<<0;
			return 0;
		}
	}
	if(Flag==true) cout<<"-1";
	else cout<<b;
	return 0;
}

Compiler output:
a.cc:20:2: error: stray '#' in program
   20 | }#include <bits/stdc++.h>
      |  ^
a.cc:20:3: error: 'include' does not name a type
   20 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:22:5: error: redefinition of 'int main()'
   22 | int main(void){
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main(void){
      |     ^~~~
Language: Java

import java.math.BigInteger;
import java.util.Scanner;
public class main {
 
    public static void main(String[] args) {
        long  n,x,i;
        BigInteger f=new BigInteger("1");
        BigInteger l=new BigInteger("1000000000000000000");
        Scanner inpu=new Scanner(System.in);
        n=inpu.nextLong();
        for(i=0;i<n;i++) {
        x=inpu.nextLong();
        f=f.multiply(BigInteger.valueOf(x));
       
        }
        int val=f.compareTo(l);
        if(val==1)System.out.println("-1");
        else System.out.println(f);
 
    }
 
}

Compiler output:
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
       ^
1 error
Language: Java

import java.math.BigInteger;
import java.util.Scanner;
import java.util.*;
public class main {

	public static void main(String[] args) {
		long  n,x,i;
		BigInteger f=new BigInteger("1");
		BigInteger l=new BigInteger("1000000000000000000");
		Scanner inpu=new Scanner(System.in);
		n=inpu.nextLong();
		for(i=0;i<n;i++) {
	    x=inpu.nextLong();
	    f=f.multiply(BigInteger.valueOf(x));
	    
		}
		int val=f.compareTo(l);
		if(val==1)System.out.println("-1");
		else System.out.println(f);

	}

}


Compiler output:
Main.java:4: error: class main is public, should be declared in a file named main.java
public class main {
       ^
1 error
Language: Java

import java.math.BigInteger;
import java.util.Scanner;
public class main {

	public static void main(String[] args) {
		long  n,x,i;
		BigInteger f=new BigInteger("1");
		BigInteger l=new BigInteger("1000000000000000000");
		Scanner inpu=new Scanner(System.in);
		n=inpu.nextLong();
		for(i=0;i<n;i++) {
	    x=inpu.nextLong();
	    f=f.multiply(BigInteger.valueOf(x));
	    
		}
		int val=f.compareTo(l);
		if(val==1)System.out.println("-1");
		else System.out.println(f);

	}

}


Compiler output:
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
       ^
1 error
Language: Java

import java.math.BigInteger;
import java.util.Scanner;
public class Fgh {

	public static void main(String[] args) {
		long  n,x,i;
		BigInteger f=new BigInteger("1");
		BigInteger l=new BigInteger("1000000000000000000");
		Scanner inpu=new Scanner(System.in);
		n=inpu.nextLong();
		for(i=0;i<n;i++) {
	    x=inpu.nextLong();
	    f=f.multiply(BigInteger.valueOf(x));
	    
		}
		int val=f.compareTo(l);
		if(val==1)System.out.println("-1");
		else System.out.println(f);

	}

}


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

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    ll e,mul=1;
    cin>>n;
    while(n--)
    {
        cin>>e;
        mul=mul*e;
    }
    if(mul<=pow(10,18))
        cout<<mul;
    else
    {
        cout<<-1;
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'll' was not declared in this scope
    6 |     ll e,mul=1;
      |     ^~
a.cc:10:14: error: 'e' was not declared in this scope
   10 |         cin>>e;
      |              ^
a.cc:11:9: error: 'mul' was not declared in this scope; did you mean 'fmul'?
   11 |         mul=mul*e;
      |         ^~~
      |         fmul
a.cc:13:8: error: 'mul' was not declared in this scope; did you mean 'fmul'?
   13 |     if(mul<=pow(10,18))
      |        ^~~
      |        fmul
Language: C++

#include<iostream>
using namespace std;
int main()
{
  long N;
  cin>>N;
  long A[N];
  for(int i=0;i<N;i++)
    cin>>A[i];
  
  long mult=1;
  for(int i=0;i<N;i++)
    mult=mult*A[i];
  
  if(mult<=pow(10,18))
    cout<<mult<<"\n";
   else
      cout<<"-1"<<"\n";
  
  
  return 0;
}
  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 'pow' was not declared in this scope
   15 |   if(mult<=pow(10,18))
      |            ^~~
Language: C++

#include<iostream>
#include<math>
using namespace std;
int main()
{
  long N;
  cin>>N;
  long A[N];
  for(int i=0;i<N;i++)
    cin>>A[i];
  
  long mult=1;
  for(int i=0;i<N;i++)
    mult=mult*A[i];
  
  if(mult<=pow(10,18))
    cout<<mult<<"\n";
   else
      cout<<"-1"<<"\n";
  
  
  return 0;
}
  
  
  

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

#include <bits/stdc++.h>
using namespace std;
 
int main()
{
  int n;
  vector<int> a;
  a.resize(n);
  long long result = 1;
  
  for(int i=0; i<n;i++)
  {
    cin >> a[i];
    result * = a[i];
  }
  
  if(result > 1e18)
    cout << -1 << endl;
  else
    cout << result << endl;
  
}
#include <bits/stdc++.h>
using namespace std;

int main()
{
  int n;
  vector<int> a;
  a.resize(n);
  long long result = 1;
  
  for(int i=0; i<n;i++)
  {
    cin >> a[i];
    result = result * a[i];
  }
  
  if(result > 1e18)
    cout << -1 << endl;
  else
    cout << result << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: expected primary-expression before '=' token
   14 |     result * = a[i];
      |              ^
a.cc: At global scope:
a.cc:26:5: error: redefinition of 'int main()'
   26 | int main()
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main()
      |     ^~~~
Language: C++

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

int main()
{
  int n;
  vector<int> a;
  a.resize(n);
  long long result = 1;
  
  for(int i=0; i<n;i++)
  {
    cin >> a[i];
    result * = a[i];
  }
  
  if(result > 1e18)
    cout << -1 << endl;
  else
    cout << result << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: expected primary-expression before '=' token
   14 |     result * = a[i];
      |              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5+5;
ll a[maxn],n;
ll ans=1;
int main(){
	cin >> n;
	for (ll i=1;i<=n;i++){
		cin >> a[i];
		if (a[i]==0) {cout << '0';return 0;}
	}
	for (ll i=1;i<=n;i++){
		ll j=0,k=ans,l=a[i];
		while (k>=10){
			k/=10;
			j++;	
		}
		while (l>=10){
			l/=10;
			j++;	
		}
		if ((j>=18 && k*l!=1)|| (j==17 && k*l>=10)) {cout << "-1";return 0;}
		ans *= a[i];
		if (ans > 1000000000000000000) {cout<<"-1";return 0;}
	}
	cout << an

Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: 'an' was not declared in this scope; did you mean 'yn'?
   27 |         cout << an
      |                 ^~
      |                 yn
a.cc:27:19: error: expected '}' at end of input
   27 |         cout << an
      |                   ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include <iostream>

using namespace std;

int main()
{
    long long n, a, current = 1;
    cin >> n;

    while (n--)
    {
        cin >> a;

        if (a > pow(10, 18) / current)
        {
            cout << -1;
            return 0;
        }
        else
        {
            current *= a;
        }
    }

    cout << current << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'pow' was not declared in this scope
   14 |         if (a > pow(10, 18) / current)
      |                 ^~~
Language: C++

#include <iostream>
using namespace std;

int main(){
	long long n;
	long long a[n];
	cin >> n;

	long long res = 1;
	for(long long i=0; i<n; i++){
		long long a; cin >> a[i];
		if (a[i] == 0) res = 0;
	}

	if (res == 0){
		cout << res << endl;
		return 0;
	}

	for(int i=0; i<n; i++){
		res = res*a[i];
		if (res > (long long)1e18){
			cout << "-1" << endl;
			return 0;
		}
	}
	cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:38: error: invalid types 'long long int[long long int]' for array subscript
   11 |                 long long a; cin >> a[i];
      |                                      ^
a.cc:12:22: error: invalid types 'long long int[long long int]' for array subscript
   12 |                 if (a[i] == 0) res = 0;
      |                      ^
Language: C++

#include <iostream>
using namespace std;

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

	long long res = 1;
	for(long long i=0; i<n; i++){
		long long a; cin >> a;
		res *= a;

		if (res > (long long)1e8){
			cout << "-1" << endl;
			return;
		}
	}
	cout << res << endl;
}

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

import java.util.*;

public class Main{
public static void main(String[] args)
{
   Scanner sc=new Scanner(System.in);
  int n=sc.nextInt();
  int[] a=new int[n];
  long ans=1;
  for(int i=0;i<n;i++)
  {  a[i]=sc.nextInt();
   ans *=a[i];}
  
  if(ans>1000000000000000000)
    System.out.println("-1");
  else
    System.out.println(ans);
  
  
  
}
}

Compiler output:
Main.java:14: error: integer number too large
  if(ans>1000000000000000000)
         ^
1 error
Language: C++

#include "bits/stdc++.h"
	using namespace std;
	#define sim template < class c
	#define ris return * this
	#define dor > debug & operator <<
	#define eni(x) sim > typename \
	  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
	sim > struct rge { c b, e; };
	sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
	sim > auto dud(c* x) -> decltype(cerr << *x, 0);
	sim > char dud(...);
	struct debug {
	#ifdef LOCAL
	~debug() { cerr << endl; }
	eni(!=) cerr << boolalpha << i; ris; }
	eni(==) ris << range(begin(i), end(i)); }
	sim, class b dor(pair < b, c > d) {
	  ris << "(" << d.first << ", " << d.second << ")";
	}
	sim dor(rge<c> d) {
	  *this << "[";
	  for (auto it = d.b; it != d.e; ++it)
		*this << ", " + 2 * (it == d.b) << *it;
	  ris << "]";
	}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define cool ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int  long long int
#define pb push_back
#define fe first
#define lb lower_bound 
#define ub upper_bound
#define pii pair<pair<int,int>,pair<int,int> >
#define se second
#define endl "\n"
#define pi pair<int, int>
#define mi          map<int,int>
#define mii         map<pi,int>
#define vi vector<int> 
#define vvi vector<vi>
#define bs   binary_search
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rep1(i,a,b) for(int i=a;i<=b;i++)	
#define all(c) (c).begin(),(c).end()
#define sz(x)       (int)x.size() 
#define PI 3.14159265358979323846
 
 const int  N=1e6;
 const int INF=1e18;
 int mod= 1e9+7;
 int dx[4]={0,0,+1,-1};
 int dy[4]={+1,-1,0,0};  
 
 
int po(int a, int b) {
a %= mod;
int res = 1;
while (b > 0) {
	if (b & 1)
		res = res * a % mod;
	a = a * a % mod;
	b >>= 1;
}
 return res;
}
 
const int sq=320+10;	
 
		   		
void solve() {	  
         int n;
         cin>>n;
         vi v(n,0);
         rep(i,0,n) {
			 cin>>v[i];
         sort(all(v));
         
         int sm=1,p=1e18;
         
         rep(i,0,n) {
		         sm*=v[i];
		         if(sm>p || sm<0) {
					    cout<<-1<<endl;
					    return;
					 }	 
			 }
			 
			 cout<<sm<<endl;
     
     
	}
	 
	   
			
  int32_t main() {  
	  cool;
	  int t=1;
	   //~ cin>>t;         
	  
	  while (t--)
		 solve();	
	
	  return 0;
	}
	


Compiler output:
a.cc: In function 'void solve()':
a.cc:99:15: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   99 |   int32_t main() {
      |               ^~
a.cc:99:15: note: remove parentheses to default-initialize a variable
   99 |   int32_t main() {
      |               ^~
      |               --
a.cc:99:15: note: or replace parentheses with braces to value-initialize a variable
a.cc:99:18: error: a function-definition is not allowed here before '{' token
   99 |   int32_t main() {
      |                  ^
a.cc:108:10: error: expected '}' at end of input
  108 |         }
      |          ^
a.cc:74:14: note: to match this '{'
   74 | void solve() {
      |              ^
Language: Java

import java.io.*;

 public class Main
{
  public static void main(String [] args)
  {
    Scanner s = new Scanner(System.in);
    int n = s.nextInt();
    long ans = 1;
    for(int i = 0; i < n;i++)
      ans *= s.nextLong();
    
    if(ans > 1000000000000000000L)
    System.out.println(-1);
    else
      System.out.println(ans);
  }
}

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

#include<bits/stdc++.h>
using namespace std;
using lli = long long int;

void solve()
{
	int n,i,z=0;
	cin>>n;
	lli ans=1,arr[n];
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
		if(arr[i]==0)
			z++;
	}
	if(z>0)
	{
		cout<<0;
		return ;
	}
	for(i=0;i<n;i++)
	{
		if(arr[i]<=1e18/prod)
			prod*=arr[i];
		else
		{
			cout<<-1;
			return ;
		}
		//cout<<ans<<endl;
	}
	cout<<ans;
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:23:33: error: 'prod' was not declared in this scope
   23 |                 if(arr[i]<=1e18/prod)
      |                                 ^~~~
Language: C++

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

//const int INF = 1001001001;
const ll INF = 1000000000000000000;

double dist(pair<int,int> a, pair<int,int> b){
	double dx, dy;
	dx = a.first - b.first;
	dy = a.second - b.second;
	return sqrt(dx*dx + dy*dy);
}

int main() {
	int n;
	cint >> n;
	vector<ll> a(n);
	rep(i,n) {
		ll x;
		cin >> x;
		if (x == 0) {
			cout << 0 << endl;
			return 0;
		}
		a[i] = x;
	}

	ll ans = 1;
	rep(i,n) {
		if (ans <= INF/a[i]) {
			ans *= a[i];
		}
		else {
			ans = -1;
			break;
		}
	}
	cout << ans << endl;
	return 0;
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'cint' was not declared in this scope; did you mean 'uint'?
   19 |         cint >> n;
      |         ^~~~
      |         uint
Language: C++

n = int(input())
a = list(map(int, input().split()))
p = 1
if 0 in a:
    print(0)
else:
    for i in a:
        p *= i
        if p > 10**18:
            print(-1)
            break
    if p <= 10 ** 18: print(p)

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

long long a [100010];
int main (){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++) scanf("%lld",&a[i]);
int zero =0;

for(int i=0;i<n;i++)if(a[i]==0) zero ++;
if(zero >0){
// a[i] contains 0
printf("0\n");
return 0;
}
long long prod =1;
for(int i=0;i<n;i++){
if(a[i ] <=1000000000000000000/ prod ){
// This condition is equivalent to prod*a[i] <=10ˆ18
prod *=a[i];
}else{
printf("-1\n");
return 0;
}
}
printf("%lld\n",prod );
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: 'scanf' was not declared in this scope
    4 | scanf("%d",&n);
      | ^~~~~
a.cc:11:1: error: 'printf' was not declared in this scope
   11 | printf("0\n");
      | ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | long long a [100010];
a.cc:20:1: error: 'printf' was not declared in this scope
   20 | printf("-1\n");
      | ^~~~~~
a.cc:20:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:24:1: error: 'printf' was not declared in this scope
   24 | printf("%lld\n",prod );
      | ^~~~~~
a.cc:24:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include<stdio.h>
long long a [100010];
int main (){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++) scanf("%lld",&a[i]);
int zero =0;
2
for(int i=0;i<n;i++)if(a[i]==0) zero ++;
if(zero >0){
// a[i] contains 0
printf("0\n");
return 0;
}
long long prod =1;
for(int i=0;i<n;i++){
if(a[i ] <=1000000000000000000/ prod ){
// This condition is equivalent to prod*a[i] <=10ˆ18
prod *=a[i];
}else{
printf("-1\n");
return 0;
}
}
printf("%lld\n",prod );
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:2: error: expected ';' before 'for'
    8 | 2
      |  ^
      |  ;
    9 | for(int i=0;i<n;i++)if(a[i]==0) zero ++;
      | ~~~
a.cc:9:13: error: 'i' was not declared in this scope
    9 | for(int i=0;i<n;i++)if(a[i]==0) zero ++;
      |             ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: unable to find numeric literal operator 'operator""ll'
   17 |         if(ans>1e18ll)
      |                ^~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:33:2: error: expected '}' at end of input
   33 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
   20 |                 return;
      |                 ^~~~~~
a.cc:33:2: error: expected '}' at end of input
   33 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: Java

import java.util.Scanner;
import java.math.BigInterger;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		long ans = 1;

		for(int i = 0; i < n; i++){
			long s = sc.nextLong();
			ans *= s;
		}
      
		if(ans > 1e18)
			System.out.println(-1);
		else
			System.out.println(ans);
      	sc.cloes();
	}
}


Compiler output:
Main.java:2: error: cannot find symbol
import java.math.BigInterger;
                ^
  symbol:   class BigInterger
  location: package java.math
Main.java:20: error: cannot find symbol
      	sc.cloes();
      	  ^
  symbol:   method cloes()
  location: variable sc of type Scanner
2 errors
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long ans = 1;
        for(int i = 0; i < n; i++){
            long s = sc.nextInt();
            ans *= s;
        }
        if(ans >= 1.0e18){
            System.out.prinln(-1);
        }else {
        System.out.println(ans);}
        
        sc.close();
        
    }
}

Compiler output:
Main.java:13: error: cannot find symbol
            System.out.prinln(-1);
                      ^
  symbol:   method prinln(int)
  location: variable out of type PrintStream
1 error
Language: Java

import java.util.Scanner;

public class at {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long ans = 1;
        for(int i = 0; i < n; i++){
            long s = sc.nextInt();
            ans *= s;
        }
        if(ans >= 1.0e18){
            System.out.prinln(-1);
        }else {
        System.out.println(ans);}
        
        sc.close();
        
    }
}

Compiler output:
Main.java:3: error: class at is public, should be declared in a file named at.java
public class at {
       ^
Main.java:13: error: cannot find symbol
            System.out.prinln(-1);
                      ^
  symbol:   method prinln(int)
  location: variable out of type PrintStream
2 errors
Language: C++

#include<bits/stdc++.h>
#include<boost/multiprecision/cpp_int.hpp>
using  boost::multiprecision::cpp_int;
using namespace std;
int main()
{
  cpp_int n;
  cin>>n;
  cpp_int mul=1;
  vector<long long>v(n);
  for(int i=0;i<n;i++)
  {
    cin>>v[i];
    if(v[i]==0)
    {
      cout<<0;
      return 0;
    }
  
  }
  
  for(int i=0;i<n;i++)
  {
    if(v[i]<1000000000000000000/mul)
        mul*=v[i];
    else
    {
      cout<<-1;
      return 0;
    }
    
    
  }
 
    cout<<mul;
}


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

#include<bits/stdc++.h>
#include<boost/multiprecision/cpp_int.hpp>
using  boost::multiprecision::cpp_int;
using namespace std;
int main()
{
  cpp_int n;
  cin>>n;
  cpp_int mul=1;
  vector<long long>v(n);
  for(int i=0;i<n;i++)
  {
    cin>>v[i];
    if(v[i]==0)
    {
      cout<<0;
      return 0;
    }
  
  }
  if(count(v.begin(),v.end(),0)>=1)
      mul=0;
  else
  for(int i=0;i<n;i++)
  {
    mul*=v[i];
    
  }
  if(mul>1000000000000000000)
    cout<<-1;
  else
    cout<<mul;
}


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

#include<bits/stdc++.h>
#include<boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision::cpp_int;
using namespace std;
int main()
{
  int n;
  cin>>n;
  cpp_int mul=1;
  vector<int>v(n);
  for(int i=0;i<n;i++)
  {
    cin>>v[i];
  
  }
  for(int i=0;i<n;i++)
    mul*=v[i];
  if(mul>1000000000000000000)
    cout<<-1;
  else
    cout<<mul;
}


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

#include<bits/stdc++.h>
#include<boost/multiprecision/cpp_int.hpp>
using namespace std;
int main()
{
  int n;
  cin>>n;
  cpp_int mul=1;
  vector<int>v(n);
  for(int i=0;i<n;i++)
  {
    cin>>v[i];
  
  }
  for(int i=0;i<n;i++)
    mul*=v[i];
  if(mul>1000000000000000000)
    cout<<-1;
  else
    cout<<mul;
}


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

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  long long mul=1;
  vector<int>v(n);
  for(int i=0;i<n;i++)
  {
    cin>>v[i];
  
  }
  for(int i=0;i<n;i++)
    mul*=v[i]
  if(mul>1000000000000000000)
    cout<<-1;
  else
    cout<<mul;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: expected ';' before 'if'
   15 |     mul*=v[i]
      |              ^
      |              ;
   16 |   if(mul>1000000000000000000)
      |   ~~          
a.cc:18:3: error: 'else' without a previous 'if'
   18 |   else
      |   ^~~~
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class main {
 
 
 
	public static void main(String[] args) {
 
 
		Scanner myObj = new Scanner(System.in);
 
		long ans = sol(myObj);
		
		
		myObj.close();
		
		System.out.println(ans);
	}
	
	
	public static long sol(Scanner obj)
	{
		ArrayList<Long> arr = new ArrayList<>();
		
		long n = obj.nextLong();
		
		for(long i = 0; i < n; i++)
		{
			long num = obj.nextLong();
			if(num == 0)
				return 0;
			else
				arr.add(num);
		}
		long total = 1;
		long bound = (long)Math.pow(10.0, 18.0);
		
		for(long i = 0; i < n; i++)
		{
			if(total > bound)
				return -1;
			else
				total *= obj.nextLong();
		}
		return total;
	}
}

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

#include<bits/stdc++>h>
using namespace std;
unsigned long long int a[100000];
int main()
{
    unsigned long long int n,result=0;
    int m=-1;
    for(unsigned long long int i=0;i<n;i++)
    {
       
        cin>>a[i];
        result=result*a[i];
    }
     if(result<=1000000000000000000)
     {cout<<result;
     }
     else
     { cout<<m;
     }
}  

Compiler output:
a.cc:1:23: warning: extra tokens at end of #include directive
    1 | #include<bits/stdc++>h>
      |                       ^
a.cc:1:9: fatal error: bits/stdc++>: No such file or directory
    1 | #include<bits/stdc++>h>
      |         ^~~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力(スペース改行関係なし)
		int n = sc.nextInt();
        long sum = 1;
      
        for(int i = 0 ; i < n  ; i++){
          int temp = sc.nextInt();
          sum = sum * temp;
        }


		if(sum <= 1000000000000000000){
			// 出力
			System.out.println(sum);
		}else{
			System.out.println(-1);
		}
		
	}
}

Compiler output:
Main.java:15: error: integer number too large
		if(sum <= 1000000000000000000){
		          ^
1 error
Language: C++

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

int main() {
  int N;
  cin>>N;
  vector<int > aa(N);
  for(int i=0;i<N;i++){
    cin>>aa.at(i);
  } int a=1;
  for(i=0;i<N;i++){
    a*=aa.at(i);
    if(a>1000000000000000000){
      cout<<-1<<endl;
      exit(1);
    }
  }cout<<a<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i=0;i<N;i++){
      |       ^
Language: C++

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

int main() {
  int N;
  cin>>N;
  vector<int > aa(N);
  for(int i=0;i<N;i++){
    cin>>N.at(i);
  } int a=1;
  for(i=0;i<N;i++){
    a*=aa.at(i);
    if(a>1000000000000000000){
      cout<<-1<<endl;
      exit(1);
    }
  }cout<<a<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: request for member 'at' in 'N', which is of non-class type 'int'
    9 |     cin>>N.at(i);
      |            ^~
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i=0;i<N;i++){
      |       ^
Language: C++

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

int main() {
  int N;
  cin>>N;
  vector<int > aa(N);
  for(int i=0;i<N;i++){
    cin>>N.at(i);
  } int a=1;
  for(i=0;i<N;i++){
    a*=aa.at(i);
    if(a>1000000000000000000)cout<<-1<<endl;exit(1);
  }cout<<a<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: request for member 'at' in 'N', which is of non-class type 'int'
    9 |     cin>>N.at(i);
      |            ^~
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i=0;i<N;i++){
      |       ^
Language: C++

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

int main() {
  int N;
  cin>>N;
  vector<int > aa(N);
  for(int i=0;i<N;i++){
    cin>>N.at(i);
  } int a=1;
  for(i=0;i<N;i++){
    a*=aa.at(i);
    if(a>1000000000000000000)cout<<-1<<endl;exit(0);
  }cout<<a<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: request for member 'at' in 'N', which is of non-class type 'int'
    9 |     cin>>N.at(i);
      |            ^~
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i=0;i<N;i++){
      |       ^
Language: C++

#include<iostream>
using namespace std;

void multiply(int *a,int n)
{
   long long ans =1ll;
   for(int i=0;i<n;i++)
    ans*=a[i];
  if(ans > 1000000000000000000)
    cout<<-1<<endl;
  else
    cout<<ans<<endl;
}
int main()
{
  int n;
  cin>>n;
  //int i=0;
  long long a[n];
 
  for(int i=0;i<n;i++)
    cin>>a[i];
  multiply(a,n);
 
  return 0;
}
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: cannot convert 'long long int*' to 'int*'
   23 |   multiply(a,n);
      |            ^
      |            |
      |            long long int*
a.cc:4:20: note:   initializing argument 1 of 'void multiply(int*, int)'
    4 | void multiply(int *a,int n)
      |               ~~~~~^
Language: C++

#include<iostream>
using namespace std;

void multiply(long long *a,int n)
{
   long long ans =1ll;
   for(int i=0;i<n;i++)
    ans*=a[i];
  if(ans > 1000000000000000000)
    cout<<-1<<endl;
  else
    cout<<ans<<endl;
}
int main()
{
  int n;
  cin>>n;
  //int i=0;
  long long a[n];
 
  for(int i=0;i<n;i++)
    cin>>a[i];
  multiply(a,n);
 
  return 0;
}
    
  }


Compiler output:
a.cc:28:3: error: expected declaration before '}' token
   28 |   }
      |   ^
Language: C++

#include<iostream>
using namespace std;

void multiply(int *a,int n)
{
   long long ans =1ll;
   for(int i=0;i<n;i++)
    ans*=a[i];
  if(ans > 1000000000000000000)
    cout<<-1<<endl;
  else
    cout<<ans<<endl;
}
int main()
{
  int n;
  cin>>n;
  //int i=0;
  long long a[n];
 
  for(int i=0;i<n;i++)
    cin>>a[i];
  multiply(a,n);
 
  return 0;
}
    
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: cannot convert 'long long int*' to 'int*'
   23 |   multiply(a,n);
      |            ^
      |            |
      |            long long int*
a.cc:4:20: note:   initializing argument 1 of 'void multiply(int*, int)'
    4 | void multiply(int *a,int n)
      |               ~~~~~^
a.cc: At global scope:
a.cc:28:3: error: expected declaration before '}' token
   28 |   }
      |   ^