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

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

int main(void)
{
	int i,n;
	unsigned long double threshold,mult=1,temp;

	scanf("%d",&n);

	threshold = pow(10,18);

	for(i=0;i<n;i++){
		scanf("%.0Lf",&temp);
		mult *= temp;
	}

	if(mult > threshold){
		mult =-1;
	}
	printf("%.0Lf\n",mult);

	return 0;
}



Compiler output:
main.c: In function 'main':
main.c:7:23: error: both 'unsigned' and 'double' in declaration specifiers
    7 |         unsigned long double threshold,mult=1,temp;
      |                       ^~~~~~
Language: C++

#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <vector>

typedef long long ll;
using namespace std;

int main() {
  int n;
  cin >> n;
  unsigned ll total = 1;
  ll a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (total != -1) {
      total *= a;
    }
    if (total > 1000000000000000000 || total < 0) {
      total = -1;
    }
    if (a == 0) {
      total = 0;
    }
  }
  cout << total << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: expected initializer before 'total'
   12 |   unsigned ll total = 1;
      |               ^~~~~
a.cc:16:9: error: 'total' was not declared in this scope
   16 |     if (total != -1) {
      |         ^~~~~
a.cc:19:9: error: 'total' was not declared in this scope
   19 |     if (total > 1000000000000000000 || total < 0) {
      |         ^~~~~
a.cc:23:7: error: 'total' was not declared in this scope
   23 |       total = 0;
      |       ^~~~~
a.cc:26:11: error: 'total' was not declared in this scope
   26 |   cout << total << endl;
      |           ^~~~~
Language: C

#include <stdio.h>

void main(void){
  long N,A,i;
  scanf("%ld",&N);
  for(i=0;i<N;i++){

Compiler output:
main.c: In function 'main':
main.c:6:3: error: expected declaration or statement at end of input
    6 |   for(i=0;i<N;i++){
      |   ^~~
main.c:6:3: error: expected declaration or statement at end of input
Language: C++

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

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
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(){
   ll b = 1e18;
   ll 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 =1;
  rep(i,n) {
    ans *= a.at(i);
    if(ans > b){
    cout << -1 << endl;
    return 0;
  }
  }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:2: error: expected '}' at end of input
   27 | }
      |  ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
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;
  vector<int> a(n);
  rep(i,n) cin >> a.at(i);
  int ans =1;
  rep(i,n) ans *= a.at(i);
  ll b = 1000000000000000000;
  if(ans > b) count << -1 << endl;
  else count << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
   14 |   if(ans > b) count << -1 << endl;
      |               ~~~~~~^~~~~
a.cc:15:14: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
   15 |   else count << ans << endl;
      |        ~~~~~~^~~~~~
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;
  vector<int> a(n);
  rep(i,n) cin >> a.at(i);
  int ans =1;
  rep(i,n) ans *= a.at(i);
  if(ans > 1000000000000000000) count << -1 << endl;
  else count << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:39: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
   13 |   if(ans > 1000000000000000000) count << -1 << endl;
      |                                 ~~~~~~^~~~~
a.cc:14:14: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
   14 |   else count << ans << endl;
      |        ~~~~~~^~~~~~
Language: C

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

    for(i=1; i<=n; i++)

        s= m*a[i];
if( s>=0 && s<= (1000000000000000000))
{
     printf("%lld\n",s);
}

    else if(s>=1000000000000000000){
        printf("-1\n");
    }
    
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:12: error: 'm' undeclared (first use in this function)
   13 |         s= m*a[i];
      |            ^
main.c:13:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main()
{
   long long int n,a[1000002
1000000000 1000000000],i,m=1;
    scanf("%lld/n",&n);
    for(i=1; i<=n; i++)
    {
        scanf("%lld",&a[i]);
    }

    for(i=1; i<=n; i++)

        m= m*a[i];
if( m>=0 && m <= (100000000000000000))
{
     printf("%lld\n",m);
}

    else if(m>=1000000000000000000){
        printf("-1\n");
    }
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:29: error: expected ']' before numeric constant
    4 |    long long int n,a[1000002
      |                             ^
      |                             ]
    5 | 1000000000 1000000000],i,m=1;
      | ~~~~~~~~~~                   
main.c:7:9: error: 'i' undeclared (first use in this function)
    7 |     for(i=1; i<=n; i++)
      |         ^
main.c:7:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:23: error: 'a' undeclared (first use in this function)
    9 |         scanf("%lld",&a[i]);
      |                       ^
main.c:14:9: error: 'm' undeclared (first use in this function)
   14 |         m= m*a[i];
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  long long N,x=1;
  cin >> N;
  vector<long long> a(N);
  for(long long i=0;i<N;i++){
    cin >> a.at(i);
    x *= a.at(i);
  }
  long long A=1000000000;
  if(p>A*A)cout << "-1" << endl;
  else cout << p << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:6: error: 'p' was not declared in this scope
   12 |   if(p>A*A)cout << "-1" << endl;
      |      ^
Language: C++

#include<bits/stdc++>
using namespace std;
int main(){
  long long N,x=1;
  cin >> N;
  vector<long long> a(N);
  for(long long i=0;i<N;i++){
    cin >> a.at(i);
    x *= a.at(i);
  }
  long long A=1000000000;
  if(p>A*A)cout << "-1" << endl;
  else cout << p << endl;
}

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

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

int main()
{
    int n, temp = 0;

    cin >> n;

    unsigned long long int inArr[n], element, result = 1;

    for (int i = 0; i < n; i++)
    {
        cin >> element;

        if (element / pow(10, 18) <= 1)
        {
            inArr[i] = element;
        }
        else
        {
            temp = -1
        }
    }

    if (temp == -1)
    {
        cout << temp << endl;
    }

    else
    {
        for (int i = 0; i < n; i++)
        {
            result = result * inArr[i];

            if (result > 1000000000000000000)
            {
                temp = -1;
                break;
            }
        }
    }

    if (temp == 0)
    {
        cout << result << endl;
    }
    else
    {
        cout << temp << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:22: error: expected ';' before '}' token
   22 |             temp = -1
      |                      ^
      |                      ;
   23 |         }
      |         ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<long long> a(N)
  for(int i=0;i<N;i++)cin >> a.at(i);
  long long p=1;
  for(int i=0;i<N;i++)p *= a.at(i);
  if(p>1000000000000000000)cout << "-1" << endl;
  else cout << p << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'for'
    7 |   for(int i=0;i<N;i++)cin >> a.at(i);
      |   ^~~
a.cc:7:15: error: 'i' was not declared in this scope
    7 |   for(int i=0;i<N;i++)cin >> a.at(i);
      |               ^
a.cc:11:26: error: expected '}' at end of input
   11 |   else cout << p << endl;
      |                          ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h> 
using namespace std;
#define ll long long;
int main()
{
  ll n;
  cin>>n;
  ll arr[n];
  bool f=0;
  ll p=1;
  bool x=0;
  for(ll i=0;i<n;i++)
  {
    cin>>arr[i];
    p*=arr[i];
    if(p>1000000000000000000)
    {
      p=0;
      x=1;
    }
    if(!arr[i])f=1;
  }
  if(f)cout<<"0";
  else if(!x)cout<<p;
  else cout<<"-1";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:6:3: note: in expansion of macro 'll'
    6 |   ll n;
      |   ^~
a.cc:6:6: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   ll n;
      |      ^
      |      yn
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:8:3: note: in expansion of macro 'll'
    8 |   ll arr[n];
      |   ^~
a.cc:8:6: error: 'arr' was not declared in this scope
    8 |   ll arr[n];
      |      ^~~
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:10:3: note: in expansion of macro 'll'
   10 |   ll p=1;
      |   ^~
a.cc:10:6: error: 'p' was not declared in this scope
   10 |   ll p=1;
      |      ^
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:12:7: note: in expansion of macro 'll'
   12 |   for(ll i=0;i<n;i++)
      |       ^~
a.cc:12:10: error: 'i' was not declared in this scope
   12 |   for(ll i=0;i<n;i++)
      |          ^
a.cc:12:17: error: expected ')' before ';' token
   12 |   for(ll i=0;i<n;i++)
      |      ~          ^
      |                 )
a.cc:12:18: error: 'i' was not declared in this scope
   12 |   for(ll i=0;i<n;i++)
      |                  ^
Language: Java

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

public class Main {
  
  public static void main(String[] args) {
    
    Scanner scan = new Scanner(System.in);
    long N = scan.nextLong();
    long limit = (long) Math.pow(10,18);
    
    BigInteger product = new BigInteger("1");
    
    for (int i = 1; i <= N; i++) {
      long A_i = scan.nextLong();
      
      if (A_i == 0) {
        System.out.println("0");
        return;
      }
      
      if (product.compareTo(limit) > 0) {
        System.out.println("-1");
        return;
      }
      
      else {
        product = product.multiply(BigIntger.valueOf(A_i));
      }
    }
    
    System.out.println(product);
  }
}


Compiler output:
Main.java:22: error: incompatible types: long cannot be converted to BigInteger
      if (product.compareTo(limit) > 0) {
                            ^
Main.java:28: error: cannot find symbol
        product = product.multiply(BigIntger.valueOf(A_i));
                                   ^
  symbol:   variable BigIntger
  location: class Main
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: Java

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

public class Main {
  
  public static void main(String[] args) {
    
    Scanner scan = new Scanner(System.in);
    long N = scan.nextLong();
    long limit = (long) Math.pow(10,18);
    
    BigInteger product = new BigInteger("1");
    
    for (int i = 1; i <= N; i++) {
      long A_i = scan.nextLong();
      
      if (A_i = 0) {
        System.out.println("0");
        return;
      }
      
      if (product.compareTo(limit) > 0) {
        System.out.println("-1");
        return;
      }
      
      else {
        product = product.multiply(BigIntger.valueOf(A_i));
      }
    }
    
    System.out.println(product);
  }
}

Compiler output:
Main.java:17: error: incompatible types: long cannot be converted to boolean
      if (A_i = 0) {
              ^
Main.java:22: error: incompatible types: long cannot be converted to BigInteger
      if (product.compareTo(limit) > 0) {
                            ^
Main.java:28: error: cannot find symbol
        product = product.multiply(BigIntger.valueOf(A_i));
                                   ^
  symbol:   variable BigIntger
  location: class Main
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
3 errors
Language: C

#include<stdio.h>
using namespace std;
#define ll unsigned  long long
#define maxn 100005
#define H 1000000000000000000
ll a[maxn];
int main(void)
{
	ll n,t=1;
	scanf("%lld",&n);
	for(int i=0;i<n;++i)
	{
		scanf("%lld",&a[i]);
		if(a[i]==0)
		t=0;
	}
	_int128_t sum=0; 
	if(t)
	{
		sum=1;
		for(int i=0;i<n;++i)
		{
		sum*=a[i];
		if(sum>H)
		{
			printf("-1\n");
			return 0;
		}
		}
	}
	printf("%lld\n",(ll)sum);
	return 0;
}

Compiler output:
main.c:2:1: error: unknown type name 'using'
    2 | using namespace std;
      | ^~~~~
main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    2 | using namespace std;
      |                 ^~~
main.c: In function 'main':
main.c:17:9: error: unknown type name '_int128_t'; did you mean '__int128_t'?
   17 |         _int128_t sum=0;
      |         ^~~~~~~~~
      |         __int128_t
Language: C++

#include<cstdio>
#include<algorithm>
using namespace std;
#define ll unsigned  long long
bool cmp(ll a,ll b)
{
	return a<b;
}
#define maxn 100005
#define H 1000000000000000000
ll a[maxn];
int main(void)
{
	ll n,t=1;
	scanf("%lld",&n);
	for(int i=0;i<n;++i)
	{
		scanf("%lld",&a[i]);
		if(a[i]==0)
		t=0;
	}
	sort(a,a+n,cmp);
	_int128_t sum=0; 
	if(t)
	{
		sum=1;
		for(int i=0;i<n;++i)
		{
		sum*=a[i];
		if(sum>H)
		{
			printf("-1\n");
			return 0;
		}
		}
	}
	printf("%lld\n",(ll)sum);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: '_int128_t' was not declared in this scope; did you mean '__int128_t'?
   23 |         _int128_t sum=0;
      |         ^~~~~~~~~
      |         __int128_t
a.cc:26:17: error: 'sum' was not declared in this scope
   26 |                 sum=1;
      |                 ^~~
a.cc:37:29: error: 'sum' was not declared in this scope
   37 |         printf("%lld\n",(ll)sum);
      |                             ^~~
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;
9
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 | 9
      |  ^
      |  ;
    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: Java

import java.util.*;
import java.math.BigInteger;
 
public class Main {
  
  public static void main(String[] args) {
    
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    BigInteger product = new BigInteger("1");
    BigInteger limit = new BigInteger("10^18"); 
    
    for (int i = 1; i <= N; i++) {
      int A_i = scan.nextInt();
      product = product.multiply(BigInteger.valueof(A_i));
      
      return;
    }
    
    if (product.compareTo(limit) > 0) {
      System.out.println(-1);
    }
	
	System.out.println(product);
  }
}

Compiler output:
Main.java:15: error: cannot find symbol
      product = product.multiply(BigInteger.valueof(A_i));
                                           ^
  symbol:   method valueof(int)
  location: class BigInteger
1 error
Language: Java

import java.util.*;
import java.math.BigInteger;
 
public class Main {
  
  public static void main(String[] args) {
    
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    BigInteger product = new BigInteger.ONE;
    BigInteger limit = new BigInteger("10^18"); 
    
    for (int i = 1, i <= N; i++) {
      int A_i = scan.nextInt();
      product = product.multiply(BigInteger.valueof(A_i));
      
      return;
    }
    
    if (product.compareTo(limit) > 0) {
      System.out.println(-1);
    }
	
	System.out.println(product);
  }
}

Compiler output:
Main.java:10: error: '(' or '[' expected
    BigInteger product = new BigInteger.ONE;
                                           ^
Main.java:13: error: ';' expected
    for (int i = 1, i <= N; i++) {
                     ^
Main.java:13: error: illegal start of expression
    for (int i = 1, i <= N; i++) {
                      ^
3 errors
Language: C++

#include <bits/stdc++.h>
#include <cmath>
#include <limits>
#include <iostream>

using namespace std;

int main(){
  int N;
  
  cin >> N;
  
  uint64_t out = 1;
  uint64_t limval = pow(10.0, 18.0);
//   std::cout << limval << std::endl;
  vector<uint64_t> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  
  std::sort(vec.begin(),vec.end());
  if(vec[0]==0){std::cout << 0 << std::endl;}
  else{
    bool isok = true;
    for (int i = 0; i < N; i++) {
    //   std::cout << vec[i] << std::endl;
    //  out = out * uint64_t(vec[i]);
    //  out  > limval / uint64_t(vec[i]);
      
    //   std::cout << out << std::endl;
      if(out > limval / uint64_t(vec[i])) == 0){
        isok = false;
        break;
      }

    }

    if(isok==false){std::cout << "-1" << std::endl;}
    else{std::cout << out << std::endl;}
    
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:43: error: expected primary-expression before '==' token
   31 |       if(out > limval / uint64_t(vec[i])) == 0){
      |                                           ^~
Language: Java

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

public class AtCoder {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();

        BigInteger product = new BigInteger("1");
        long limit = (long) Math.pow(10, 18);
        //  System.out.println(limit);
        boolean smaller = true;

        for (int i = 1; i <= N; i++) {
            long A_i = scan.nextLong();
            if (A_i == 0) {
                System.out.println(0);
                return;
            }

            if (smaller) {
                product = product.multiply(BigInteger.valueOf(A_i));
            }

            if (product.compareTo(BigInteger.valueOf(limit)) == 1) {
                smaller = false;
            }

            System.out.println("product is" + product + " smaller is" + smaller);
        }

        if (smaller) {
            System.out.println(product);
        } else {
            System.out.println(-1);
        }
    }

}


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

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

public class AtCoder {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();

        BigInteger product = new BigInteger("1");
        long limit = (long) Math.pow(10, 18);
        //  System.out.println(limit);
        boolean smaller = true;

        for (int i = 1; i <= N; i++) {
            long A_i = scan.nextLong();
            if (A_i == 0) {
                System.out.println(0);
                return;
            }

            if (smaller = true) {
                product = product.multiply(BigInteger.valueOf(A_i));
            }

            if (product.compareTo(BigInteger.valueOf(limit)) == 1) {
                smaller = false;
            }

            //System.out.println("product is" + product + " smaller is" + smaller);
        }

        if (smaller) {
            System.out.println(product);
        } else {
            System.out.println(-1);
        }
    }

}


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

import java.util.*;

public class AtCoder {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();

        double product = 1;
        double limit = (double) Math.pow(10, 18);

        for (int i = 1; i <= N; i++) {
            double A_i = scan.nextDouble();
            product = product * A_i;
        }

        if (product > limit) {
            System.out.println("-1");
            return;
        } 
        
        else {
            System.out.println(product);
        }
        
    }

}

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

import java.util.*;

public class AtCoder {

    public static void main(String[] args) {
        
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();

        double product = 1;
        double limit = (double) Math.pow(10, 18);

        for (int i = 1; i <= N; i++) {
            int A_i = scan.nextDouble();
            product = product * A_i;
        }

        if (product > limit) {
            System.out.println("-1");
            return;
        } 
        
        else {
            System.out.println(product);
        }
        
        System.out.println(product);
        
    }

}

Compiler output:
Main.java:3: error: class AtCoder is public, should be declared in a file named AtCoder.java
public class AtCoder {
       ^
Main.java:14: error: incompatible types: possible lossy conversion from double to int
            int A_i = scan.nextDouble();
                                     ^
2 errors
Language: Java

import java.util.*;

public class AtCoder {

    public static void main(String[] args) {
        
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();

        double product = 1;
        double limit = (double)Math.pow(10, 18);

        for (int i = 1; i <= N; i++) {
            double A_i = scan.nextDouble();
            product = product * A_i;
        }

        if (product > limit) {
            System.out.println("-1");
            return;
        } 
        
        System.out.println(product);
        
    }

}

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

import java.util.*;

/**
 *
 * @author lisaf
 */
public class AtCoder {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();

        long product = 1L;
        long limit = (long) Math.pow(10, 18);

        for (int i = 1; i <= N; i++) {
            long A_i = scan.nextInt();

            product = product * A_i;
        }

        if (product > limit) {
            System.out.println("-1");
            return;
        }
        
        System.out.println(product);
    }

}


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

import java.util.*;

public static void main(String[] args) {
        // TODO code application logic here
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();

        long product = 1L;
        long limit = (long) Math.pow(10, 18);

        for (int i = 1; i <= N; i++) {
            long A_i = scan.nextInt();

            product = product * A_i;
        }

        if (product > limit) {
            System.out.println("-1");
            return;
        }
        
        System.out.println(product);
    }

}

Compiler output:
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
              ^
  (use --enable-preview to enable unnamed classes)
Main.java:25: error: class, interface, enum, or record expected
}
^
2 errors
Language: Java

import java.util.*;
 
public class Main {
 
	public static void main(String[] arguments) {
    
    	Scanner scan = new Scanner(System.in);
       	int N = scan.nextInt();
        
        long product = 1L;
      	long limit = (long) Math.pow(10,18);
        
        for (int i = 1; i <= N; i++) {
        	long A_i = scan.nextInt();
            
            product = product * A_i;
          
        	if (product > limit) {
        	System.out.println("-1");
        	}        
        }
        
      	System.out.println(product);
      
		}
    }
}

Compiler output:
Main.java:27: error: class, interface, enum, or record expected
}
^
1 error
Language: Java

import java.util.*;
 
public class Main {
 
	public static void main(String[] arguments) {
    
    	Scanner scan = new Scanner(System.in);
       	int N = scan.nextInt();
        
        long product = 1L;
      	long limit = (long) Math.pow(10,18);
        
        for (int i = 1; i <= N; i++) {
        	long A_i = scan.nextInt();
            
            product == product * A_i;
        }
        
        if (product < limit) {
        	System.out.println(product);
        }
        
        else {
        	System.out.println("-1");
		}
    }
}

Compiler output:
Main.java:16: error: not a statement
            product == product * A_i;
                    ^
1 error
Language: Java

import java.util.*;
 
public class Main {
 
	public static void main(String[] arguments) {
    
    	Scanner scan = new Scanner(System.in);
       	int N = scan.nextInt();
        
        long product = 1L;
      	long limit = Math.pow(10,18);
        
        for (int i = 1; i <= N; i++) {
        	long A_i = scan.nextInt();
            
            product = product * A_i;
        }
        
        if (product < limit) {
        	System.out.println(product);
        }
        
        else {
        	System.out.println("-1");
		}
    }
}

Compiler output:
Main.java:11: error: incompatible types: possible lossy conversion from double to long
      	long limit = Math.pow(10,18);
      	                     ^
1 error
Language: Java

import java.util.*;
 
public class Main {
 
	public static void main(String[] arguments) {
    
    	Scanner scan = new Scanner(System.in);
       	int N = scan.nextInt();
        
        long product = 1L;
      	long limit = Math.pow(10,18)L;
        
        for (int i = 1; i <= N; i++) {
        	long A_i = scan.nextInt()L;
            
            product = product * A_i;
        }
        
        if (product < limit) {
        	System.out.println(product);
        }
        
        else {
        	System.out.println("-1");
		}
    }
}

Compiler output:
Main.java:11: error: ';' expected
      	long limit = Math.pow(10,18)L;
      	                            ^
Main.java:14: error: ';' expected
        	long A_i = scan.nextInt()L;
        	                         ^
2 errors
Language: Java

import java.util.*;
 
public class Main {
 
	public static void main(String[] arguments) {
    
    	Scanner scan = new Scanner(System.in);
       	int N = scan.nextInt();
        
        long product = 1;
      	long limit = Math.pow(10,18);
        
        for (int i = 1; i <= N; i++) {
        	int A_i = scan.nextInt();
            
            product = product * A_i;
        }
        
        if (product < limit) {
        	System.out.println(product);
        }
        
        else {
        	System.out.println("-1");
		}
    }
}

Compiler output:
Main.java:11: error: incompatible types: possible lossy conversion from double to long
      	long limit = Math.pow(10,18);
      	                     ^
1 error
Language: Java

import java.util.*;
 
public class Main {
 
	public static void main(String[] arguments) {
    
    	Scanner scan = new Scanner(System.in);
       	int N = scan.nextInt();
        
        int product = 1;
      	int limit = Math.pow(10,18);
        
        for (int i = 1; i <= N; i++) {
        	int A_i = scan.nextInt();
            
            product = product * A_i;
        }
        
        if (product < limit) {
        	System.out.println(product);
        }
        
        else {
        	System.out.println("-1");
		}
    }
}

Compiler output:
Main.java:11: error: incompatible types: possible lossy conversion from double to int
      	int limit = Math.pow(10,18);
      	                    ^
1 error
Language: Java

import java.util.*;
 
public class Main {
 
	public static void main(String[] arguments) {
    
    	Scanner scan = new Scanner(System.in);
       	int N = scan.nextInt();
        
        int product = 1;
        
        for(int i = 1, i <= N, i++) {
        	int A_i = scan.nextInt();
            
            product = product * A_i;
        }
        
        if(product < 10^18) {
        	System.out.println(product);
        }
        
        else {
        	System.out.println("-1");
		}
    }
}

Compiler output:
Main.java:12: error: ';' expected
        for(int i = 1, i <= N, i++) {
                        ^
Main.java:12: error: illegal start of expression
        for(int i = 1, i <= N, i++) {
                         ^
Main.java:12: error: ';' expected
        for(int i = 1, i <= N, i++) {
                             ^
3 errors
Language: Java

import java.util.*

public class Main {

	public static void main(String[] arguments) {
    
    	Scanner scan = new Scanner(System.in);
       	int N = scan.nextInt();
        
        int product = 1;
        
        for (int i = 1, i <= N, i++) {
        	int A_i = scan.nextInt();
            
            product = product * A_i;
        }
        
        if (product < 10^18) {
        	System.out.println(product);
        }
        
        else {
        	System.out.println("-1");
		}
    }
}


Compiler output:
Main.java:1: error: ';' expected
import java.util.*
                  ^
Main.java:12: error: ';' expected
        for (int i = 1, i <= N, i++) {
                         ^
Main.java:12: error: illegal start of expression
        for (int i = 1, i <= N, i++) {
                          ^
Main.java:12: error: ';' expected
        for (int i = 1, i <= N, i++) {
                              ^
4 errors
Language: C++

#include <bits/stdc++.h>
#include <cmath>
#include <limits>
#include <iostream>

using namespace std;

int main(){
  int N;
  
  cin >> N;
  
  unsigned long long out = 0;
  unsigned long long limval = pow(10.0, 18.0);
  
  bool isok = true;
  
  for (int i = 0; i < N; i++) {
    out = out * long long(cin)
    if(out > limval){
      isok = false;
      break;
    }
   
  }
  if(isok==false){std::cout << "-1" << std::endl;}
  else{std::cout << out << std::endl;}
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: expected primary-expression before 'long'
   19 |     out = out * long long(cin)
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>
#include <cmath>
#include <limits>
#include <iostream>

using namespace std;

int main(){
  int N;
  
  cin >> N;
  
  long long out = 0;
  long long lim = pow(10.0, 18.0);
  
  bool isok = true;
  
  for (int i = 0; i < N; i++) {
    out += long long(cin)
    if(out > lim){
      isok = false;
      break;
    }
   
  }
  if(isok==false){std::cout << "-1" << std::endl;}
  else{std::cout << out << std::endl;}
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:12: error: expected primary-expression before 'long'
   19 |     out += long long(cin)
      |            ^~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
	int n ;
	cin >> n;
	long long mul = 1;
	for(int i = 0 ; i < n ; i++){
		int x;
		cin >> x;
		if(x == 0){
			cout << 0 << endl;
			return 0;
		}
		else if(mul*x > pow(10 , 18) ){
			cout << -1 << endl;
			return 0;
		}
		else{
			mul = mul*x;
		}
	}
	cout << mul << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:33: error: 'pow' was not declared in this scope
   15 |                 else if(mul*x > pow(10 , 18) ){
      |                                 ^~~
Language: C++

/** author: __nishad__ **/
#include<bits/stdc++.h>
using namespace std;


typedef long long ll ;
typedef vector<ll> vll ;

#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(v) (v).begin(),(v).end()
#define precision(k) cout<<setprecision(k)<<fixed;
#define loop(i,a,b) for(ll i=(a);i<(b);++i)
#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define getpos(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define unq(v) sort(all(v)),(v).erase(unique((v).begin(),(v).end()),(v).end())
#define pb push_back
#define mp make_pair
#define pi 3.14159265358979323
#define endl "\n"

int main()
{
    IOS;

    int n;

    cin>>n;
    unsigned long long arr[n], res=1;

    loop(i, 0, n){
        cin>>arr[i];
        }
    }

    loop(i, 0, n){
        res = res * arr[i];

        unsigned long long num = (1e18)/res;

        if(arr[i+1] > num && i+1 !< n){
            cout<<"-1"<<endl;
            return 0;
        }
    }

    cout<<res;



}





























Compiler output:
a.cc:12:21: error: expected unqualified-id before 'for'
   12 | #define loop(i,a,b) for(ll i=(a);i<(b);++i)
      |                     ^~~
a.cc:36:5: note: in expansion of macro 'loop'
   36 |     loop(i, 0, n){
      |     ^~~~
a.cc:36:10: error: 'i' does not name a type; did you mean 'pi'?
   36 |     loop(i, 0, n){
      |          ^
a.cc:12:34: note: in definition of macro 'loop'
   12 | #define loop(i,a,b) for(ll i=(a);i<(b);++i)
      |                                  ^
a.cc:12:40: error: expected unqualified-id before '++' token
   12 | #define loop(i,a,b) for(ll i=(a);i<(b);++i)
      |                                        ^~
a.cc:36:5: note: in expansion of macro 'loop'
   36 |     loop(i, 0, n){
      |     ^~~~
a.cc:47:5: error: 'cout' does not name a type
   47 |     cout<<res;
      |     ^~~~
a.cc:51:1: error: expected declaration before '}' token
   51 | }
      | ^
Language: C++

#include <bits/stdc++.h>
    using namespace std;
     
    int main(){
      int N;
      cin>>N;
      vector<int> A(N);
      for(int i=0;i<N;i++){
        cin>>A.at(i);
      }
      int128_t ans=1;
      for(int i=0;i<N;i++){
        ans=ans*A.at(i);
      }
      if(ans>1000000000000000000)
        cout<<-1<<endl;
      else
        cout<<ans<<endl;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'int128_t' was not declared in this scope; did you mean 'int8_t'?
   11 |       int128_t ans=1;
      |       ^~~~~~~~
      |       int8_t
a.cc:13:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |         ans=ans*A.at(i);
      |         ^~~
      |         abs
a.cc:15:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |       if(ans>1000000000000000000)
      |          ^~~
      |          abs
Language: C++

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>

using namespace std;


#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int (i)=(n); (i)>=(0); (i)--)
#define SIZE(x) ((int)(x).size())
#define GCD(a, b) int gcd(int a,int b){return b?gcd(b,a%b):a;}
#define QP(a, b) int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define all(v) (v).begin(),(v).end()


template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
template<typename A, size_t N, typename T>
void FILL(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

typedef vector<int, int> vint;
typedef pair<int,int> pint;
typedef vector<pint>vpint;
typedef long long ll;

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1LL << 60;
const ll MOD = 1000000007LL;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n = 0; cin >> n;
    ll now = 1;
    for(int i=0; i<n; i++){
        int a; cin >> a;
        if(a >= 1000000000000000000 / now){
            cout << -1 << endl;
            return 0;
    }
    cout << now;
    cout << endl;
    return 0;
}

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

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

#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long LL;

const LL m = 1e18;

int main(){
  int n;
  cin >> n;
  LL a[n];
  LL ans = 1;
  rep(i, n){
    cin >> a[i];
	if(0 == a[i]){
      cout << 0 << endl;
      return 0;
    }
  }
  rep(i, n){
    if((M+1)/a[i] >= ans){
      cout << -1 << endl;
      return 0;
    }
    ans *= a[i];
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'M' was not declared in this scope
   23 |     if((M+1)/a[i] >= ans){
      |         ^
Language: C++

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

#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long LL;

int main(){
  int n;
  cin >> n;
  LL a[n];
  LL ans = 1;
  LL m = 1e18;
  rep(i, n){
    cin >> a[i];
	if(0 == a[i]){
      cout << 0 << endl;
      return 0;
    }
  }
  rep(i, n){
    if((m+1)/a[i] >= ans){
      cout << -1 << endl;
      return 0;
    }
    ans *= a[i];
  }
  if(ans > M || ans < 0) cout << -1 << endl;
  else cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:12: error: 'M' was not declared in this scope
   28 |   if(ans > M || ans < 0) cout << -1 << endl;
      |            ^
Language: C++

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

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define M 1e18
using namespace std;
typedef long long LL;

int main(){
  int n;
  cin >> n;
  LL a[n];
  LL ans = 1;
  LL m = (LL) M;
  rep(i, n){
    cin >> a[i];
	if(0 == a[i]){
      cout << 0 << endl;
      return 0;
    }
  }
  rep(i, n){
    if(M/a > ans){
      cout << -1 << endl;
      return 0;
    }
    ans *= a[i];
  }
  if(ans > M || ans < 0) cout << -1 << endl;
  else cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: invalid operands of types 'double' and 'LL [n]' {aka 'long long int [n]'} to binary 'operator/'
   23 |     if(M/a > ans){
      |         ^~
      |          |
      |          LL [n] {aka long long int [n]}
Language: C++

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

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define M 1e18
using namespace std;
typedef long long LL;

int main(){
  int n;
  cin >> n;
  LL a[n];
  LL ans = 1;
  int tag = 0;
  rep(i, n){
    cin >> a[i];
	if(0 == a[i]){
      cout << 0 << endl;
      return 0;
    }
  }
  rep(i, n){
    if(a[i]/M > 1){
      cout << -1 << endl;
      return 0;
    }
    ans *= a[i];
  }
  else cout << ans << endl;
  return 0;
}


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

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

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define M pow(10, 18)
using namespace std;
typedef long long LL;

int main(){
  int n;
  cin >> n;
  LL a[n];
  LL ans = 1;
  rep(i, n){
    cin >> a[i];
    ans *= a[i];
  }
  if(ans > M) cout << -1 << endl;
  else cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: 'pow' was not declared in this scope
    5 | #define M pow(10, 18)
      |           ^~~
a.cc:18:12: note: in expansion of macro 'M'
   18 |   if(ans > M) cout << -1 << endl;
      |            ^
Language: C++

#include <iostream>

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define M pow(10, 18)
using namespace std;
typedef long long LL;

int main(){
  int n;
  cin >> n;
  LL a[n];
  LL ans = 1;
  rep(i, n){
    cin >> a[i];
    ans *= a[i];
  }
  if(ans > M) cout << -1 << endl;
  else cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:11: error: 'pow' was not declared in this scope
    4 | #define M pow(10, 18)
      |           ^~~
a.cc:17:12: note: in expansion of macro 'M'
   17 |   if(ans > M) cout << -1 << endl;
      |            ^
Language: C++

#include <iostream>

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define M 10e+17
using namespace std;
typedef long long LL;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'pow' was not declared in this scope
   17 |   if(ans > (LL) pow(10, 18)) cout << -1 << endl;
      |                 ^~~
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;

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:1:20: warning: extra tokens at end of #include directive
    1 | #include <stdio.h> long long a[100010]; int main (){
      |                    ^~~~
a.cc:3:6: error: expected constructor, destructor, or type conversion before '(' token
    3 | scanf("%d",&n);
      |      ^
a.cc:4:1: error: expected unqualified-id before 'for'
    4 | for(int i=0;i<n;i++)scanf("%lld",&a[i]);
      | ^~~
a.cc:4:13: error: 'i' does not name a type
    4 | for(int i=0;i<n;i++)scanf("%lld",&a[i]);
      |             ^
a.cc:4:17: error: 'i' does not name a type
    4 | for(int i=0;i<n;i++)scanf("%lld",&a[i]);
      |                 ^
a.cc:7:1: error: expected unqualified-id before 'for'
    7 | for(int i=0;i<n;i++)if(a[i]==0)zero++; if(zero >0){
      | ^~~
a.cc:7:13: error: 'i' does not name a type
    7 | for(int i=0;i<n;i++)if(a[i]==0)zero++; if(zero >0){
      |             ^
a.cc:7:17: error: 'i' does not name a type
    7 | for(int i=0;i<n;i++)if(a[i]==0)zero++; if(zero >0){
      |                 ^
a.cc:7:40: error: expected unqualified-id before 'if'
    7 | for(int i=0;i<n;i++)if(a[i]==0)zero++; if(zero >0){
      |                                        ^~
a.cc:11:20: error: expected unqualified-id before 'for'
   11 | long long prod =1; for(int i=0;i<n;i++){
      |                    ^~~
a.cc:11:32: error: 'i' does not name a type
   11 | long long prod =1; for(int i=0;i<n;i++){
      |                                ^
a.cc:11:36: error: 'i' does not name a type
   11 | long long prod =1; for(int i=0;i<n;i++){
      |                                    ^
a.cc:17:7: error: expected constructor, destructor, or type conversion before '(' token
   17 | printf("%lld\n",prod); }
      |       ^
a.cc:17:24: error: expected declaration before '}' token
   17 | printf("%lld\n",prod); }
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define all(n) n.begin(),n.end()
#define yn(x) cout << (x ? "Yes":"No") << endl;

int main() {
  ll n;
  cin >> n;
  vector<ll>a(n);
  rep(i,n) cin >> a[i];
  ll ans = 1;
  rep(i,n){
    ans *= a[i];
  }
  if(ans > 1000000000000000000){
      ans = -1;
      break;
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:7: error: break statement not within loop or switch
   19 |       break;
      |       ^~~~~
Language: Java

package rensyuu;

import java.util.*;

public class Bmondai {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N= keyboard.nextInt();
		long[] a = new long[N];
		
		for(int i =0; i<N; i++) {
			a[i] = keyboard.nextLong();			
		}
		
		long ans = 1;
		for(int k =0; k<N; k++) {
			if(a[k] == 0) {
				System.out.print(-1);
				keyboard.close();
				return;
			}
		}

		
		long cons = 1000000000000000000L;

		
		for(int j=0; j<N; j++) {
			if(a[j] !=0) {
				if(a[j] <= cons/ans) {
					ans = ans*a[j];	
				}else {
					ans = -1;
					break;
				}
			}else{
				ans = 0;
				break;
			}
		}
		
		System.out.print(ans);
		keyboard.close();	
		
	}
}





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

package rensyuu;

import java.util.*;

public class Bmondai {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N= keyboard.nextInt();
		long[] a = new long[N];
		
		for(int i =0; i<N; i++) {
			a[i] = keyboard.nextLong();			
		}
		
		long ans = 1;
		for(int i =0; i<N; i++) {
			if(a[i] == 0) {
				System.out.print(-1);
				return;
			}
		}

		
		long cons = 1000000000000000000L;

		
		for(int j=0; j<N; j++) {
			if(a[j] !=0) {
				if(a[j] <= cons/ans) {
					ans = ans*a[j];	
				}else {
					ans = -1;
					break;
				}
			}else{
				ans = 0;
				break;
			}
		}
		
		System.out.print(ans);
		keyboard.close();	
		
	}
}





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

package rensyuu;

import java.util.*;

public class Bmondai {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N= keyboard.nextInt();
		long[] a = new long[N];
		
		for(int i =0; i<N; i++) {
			a[i] = keyboard.nextLong();			
		}
		
		long ans = 1;
		for(int i =0; i<N; i++) {
			if(a[i] == 0) {
				ans = -1;		
				return;
			}
		}

		
		long cons = 1000000000000000000L;

		
		for(int j=0; j<N; j++) {
			if(a[j] !=0) {
				if(a[j] <= cons/ans) {
					ans = ans*a[j];	
				}else {
					ans = -1;
					break;
				}
			}else{
				ans = 0;
				break;
			}
		}
		
		System.out.print(ans);
		keyboard.close();	
		
	}
}





Compiler output:
Main.java:5: error: class Bmondai is public, should be declared in a file named Bmondai.java
public class Bmondai {
       ^
1 error