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

#include<iostream>
using namespace std;

void multiply(int *a,int n)
{
   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];
  long long ans =1ll;
  for(int i=0;i<n;i++)
    cin>>a[i];
  multiply(a,n);
 
  return 0;
}
    
  }


Compiler output:
a.cc: In function 'void multiply(int*, int)':
a.cc:7:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
    7 |     ans*=a[i];
      |     ^~~
      |     abs
a.cc:8:6: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |   if(ans > 1000000000000000000)
      |      ^~~
      |      abs
a.cc: In function 'int main()':
a.cc:22:12: error: cannot convert 'long long int*' to 'int*'
   22 |   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:27:3: error: expected declaration before '}' token
   27 |   }
      |   ^
Language: C++

#include<iostream>
using namespace std;

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


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

#include<iostream>
using namespace std;

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

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

#include<iostream>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> vec(N);
  for(int i=0;i<N;i++){
    cin >> vec.at(i);
  }
  int answer = 0;
  for(int j=0;j<N;j++){
   answer *= vec.at(i):
  }
  if(answer>1000000000000000000){
    cout << "-1" << endl;
  }
  else {cout << answer << endl;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> vec(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> vec(N);
      |          ^~~
a.cc:8:12: error: 'vec' was not declared in this scope
    8 |     cin >> vec.at(i);
      |            ^~~
a.cc:12:14: error: 'vec' was not declared in this scope
   12 |    answer *= vec.at(i):
      |              ^~~
a.cc:12:21: error: 'i' was not declared in this scope
   12 |    answer *= vec.at(i):
      |                     ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> vec(N);
  for(int i=0;i<N;i++){
    cin >> vec.at(i);
  }
  int answer = 0;
  for(int j=0;j<N;j++){
   answer *= vec.at(i):
  }
  if(answer>1000000000000000000){
    cout << '-1' << endl;
  }
  else {cout << answer << endl;}
}

Compiler output:
a.cc:15:13: warning: multi-character character constant [-Wmultichar]
   15 |     cout << '-1' << endl;
      |             ^~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> vec(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> vec(N);
      |          ^~~
a.cc:8:12: error: 'vec' was not declared in this scope
    8 |     cin >> vec.at(i);
      |            ^~~
a.cc:12:14: error: 'vec' was not declared in this scope
   12 |    answer *= vec.at(i):
      |              ^~~
a.cc:12:21: error: 'i' was not declared in this scope
   12 |    answer *= vec.at(i):
      |                     ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int N;
  cin >> N;
  int A[N];
  for(int i=0;i<N;i++){
    cin >> A[i];
  }
  int answer = 0;
  for(int j=0;j<N;j++){
   answer *= A[j]
  }
  if(answer>1000000000000000000){
    cout << '-1' << endl;
  }
  else {cout << answer << endl;}
}

Compiler output:
a.cc:15:13: warning: multi-character character constant [-Wmultichar]
   15 |     cout << '-1' << endl;
      |             ^~~~
a.cc: In function 'int main()':
a.cc:12:18: error: expected ';' before '}' token
   12 |    answer *= A[j]
      |                  ^
      |                  ;
   13 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  //acceleration
  ios::sync_with_stdio(0);
  cin.tie(0);
  
  //initialization
  long long lim = 1e18;
  long long tmp = 1;
  
  int n;
  cin >> n;
  long long input;
 
  //calculation
  for(int i = 0; i < n ; i++)
    cin >> input;
   
    // input 0
    if(input == 0){
      cout << 0 << "¥n" ;
      return 0;
    }
     
    tmp *= input;
  
    // over the limit answer
    if(temp > lim || temp < 0){
      temp = -1;
      return 0;
    }
  }
 
    cout << (long long)temp << "\n";
}
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  //acceleration
  ios::sync_with_stdio(0);
  cin.tie(0);
  
  //initialization
  long long lim = 1e18;
  long long tmp = 1;
  
  int n;
  cin >> n;
  long long input;
 
  //calculation
  for(int i = 0; i < n ; i++)
    cin >> input;
   
    // input 0
    if(input == 0){
      cout << 0 << "¥n" ;
      return 0;
    }
     
    tmp *= input;
  
    // over the limit answer
    if(tmp > lim || tmp < 0){
      tmp = -1;
      return 0;
    }
  }
 
    cout << (long long)tmp << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:8: error: 'temp' was not declared in this scope; did you mean 'tmp'?
   30 |     if(temp > lim || temp < 0){
      |        ^~~~
      |        tmp
a.cc: At global scope:
a.cc:36:5: error: 'cout' does not name a type
   36 |     cout << (long long)temp << "\n";
      |     ^~~~
a.cc:37:1: error: expected declaration before '}' token
   37 | }
      | ^
a.cc:41:5: error: redefinition of 'int main()'
   41 | int main(){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(){
      |     ^~~~
a.cc:73:5: error: 'cout' does not name a type
   73 |     cout << (long long)tmp << "\n";
      |     ^~~~
a.cc:74:1: error: expected declaration before '}' token
   74 | }
      | ^
Language: C++

include <bits/stdc++.h>
using namespace std;
 
int main(){
  //acceleration
  ios::sync_with_stdio(0);
  cin.tie(0);
  
  //initialization
  long long lim = 1e18;
  long long tmp = 1;
  
  int n;
  cin >> n;
  long long input;
 
  //calculation
  for(int i = 0; i < n ; i++)
    cin >> input;
   
    // input 0
    if(input == 0){
      cout << 0 << "¥n" ;
      return 0;
    }
     
    tmp *= input;
  
    // over the limit answer
    if(temp > lim || temp < 0){
      temp = -1;
      return 0;
    }
  }
 
    cout << (long long)temp << "\n";
}
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  //acceleration
  ios::sync_with_stdio(0);
  cin.tie(0);
  
  //initialization
  long long lim = 1e18;
  long long tmp = 1;
  
  int n;
  cin >> n;
  long long input;
 
  //calculation
  for(int i = 0; i < n ; i++)
    cin >> input;
   
    // input 0
    if(input == 0){
      cout << 0 << "¥n" ;
      return 0;
    }
     
    tmp *= input;
  
    // over the limit answer
    if(tmp > lim || tmp < 0){
      tmp = -1;
      return 0;
    }
  }
 
    cout << (long long)tmp << "\n";
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'ios' has not been declared
    6 |   ios::sync_with_stdio(0);
      |   ^~~
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin.tie(0);
      |   ^~~
a.cc:23:7: error: 'cout' was not declared in this scope
   23 |       cout << 0 << "¥n" ;
      |       ^~~~
a.cc:30:8: error: 'temp' was not declared in this scope; did you mean 'tmp'?
   30 |     if(temp > lim || temp < 0){
      |        ^~~~
      |        tmp
a.cc: At global scope:
a.cc:36:5: error: 'cout' does not name a type
   36 |     cout << (long long)temp << "\n";
      |     ^~~~
a.cc:37:1: error: expected declaration before '}' token
   37 | }
      | ^
a.cc:41:5: error: redefinition of 'int main()'
   41 | int main(){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(){
      |     ^~~~
a.cc:73:5: error: 'cout' does not name a type
   73 |     cout << (long long)tmp << "\n";
      |     ^~~~
a.cc:74:1: error: expected declaration before '}' token
   74 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  //acceleration
  ios::sync_with_stdio(0);
  cin.tie(0);
  
  //initialization
  long long lim = 1e18;
  long long tmp = 1;
  
  int n;
  cin >> n;
  long long input;

  //calculation
  for(int i = 0; i < n ; i++)
    cin >> input;
   
    // input 0
    if(input == 0){
      cout << 0 << "¥n" ;
      return 0;
    }
     
    tmp *= input;
  
    // over the limit answer
    if(temp > lim || temp < 0){
      temp = -1;
      return 0;
    }
  }
 
    cout << (long long)temp << "\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:8: error: 'temp' was not declared in this scope; did you mean 'tmp'?
   30 |     if(temp > lim || temp < 0){
      |        ^~~~
      |        tmp
a.cc: At global scope:
a.cc:36:5: error: 'cout' does not name a type
   36 |     cout << (long long)temp << "\n";
      |     ^~~~
a.cc:37:1: error: expected declaration before '}' token
   37 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define fast ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define in(n1) cin>>n1
#define lp(i,j,n) for(int i=j;i<=n;i++)
#define output(n1) cout<<n1<<endl
#define output2(n2) cout<<n2<<" "
#define ll long long int
#define ld long double
using namespace std;
int main()
{
  ll n;
  cin>>n;
 ll p=1;
  for(ll i=1;i<=n;i++)
  {
    cin>>t;
    p*=t;
    if(p>=LLONG_MAX)
    {
      P=-1;
      break;
    }
  }
  cout<<p;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: 't' was not declared in this scope
   17 |     cin>>t;
      |          ^
a.cc:21:7: error: 'P' was not declared in this scope
   21 |       P=-1;
      |       ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  int P = 1;
  int A;
  
  for (int i = 0; i < N; i++) {
    cin >> A;
    P *= A;
  }
  int L;
  L = (P - 1) / 1000000000 / 10000000000
  
  if (L < 1)
    cout << P << endl;
  else if (L >= 1)
    cout << "-1" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:41: error: expected ';' before 'if'
   15 |   L = (P - 1) / 1000000000 / 10000000000
      |                                         ^
      |                                         ;
   16 | 
   17 |   if (L < 1)
      |   ~~                                     
a.cc:19:3: error: 'else' without a previous 'if'
   19 |   else if (L >= 1)
      |   ^~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  int P = 1;
  for (i = 0; i < N; i++) {
    int A;
    cin >> A;
    P *= A;
  }
  if (P <= 1000000000000000000)
    cout << P << endl;
  else if (P => 1000000000000000001)
    cout << -1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'i' was not declared in this scope
    8 |   for (i = 0; i < N; i++) {
      |        ^
a.cc:15:15: error: expected primary-expression before '>' token
   15 |   else if (P => 1000000000000000001)
      |               ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  int P = 1;
  for (i = 0; i < N; i++) {
    int A;
    cin >> A;
    P *= A
  }
  if (P <= 1000000000000000000)
    cout << P << endl;
  else if (P => 1000000000000000001)
    cout << -1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'i' was not declared in this scope
    8 |   for (i = 0; i < N; i++) {
      |        ^
a.cc:11:11: error: expected ';' before '}' token
   11 |     P *= A
      |           ^
      |           ;
   12 |   }
      |   ~        
a.cc:15:15: error: expected primary-expression before '>' token
   15 |   else if (P => 1000000000000000001)
      |               ^
Language: C++

#include <iostream>
#include <vector>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
namespace mp = boost::multiprecision;
int main(void){
    // Your code here!
    mp::cpp_int a,b;
    cin >> a;
    b = 1;
    int zf = 0;
    int cf = 0;
    int tmp;
    for (int i = 0; i < a; i++) {
        cin >> tmp;
        b *= tmp;
        if(b>10e18){
            cf=1;
            b=0;
        }
        if(tmp == 0){
            zf = 1;
        }
    }
    if(zf==1){
        cout << 0;
    }else if(cf == 1){
        cout << "-1";
    }else{
        cout << b;
    }
    return 0;
}


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

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

Compiler output:
main.c: In function 'main':
main.c:8:12: error: invalid operands to binary * (have 'int' and 'int *')
    8 |         ans*=A;
      |            ^~~
      |              |
      |              int *
Language: C

#include<stdio.h>
signed main(){

int i,n,answer=1;

scanf("%d",&n);
long long a[n]; 
long long a[n]={};
for(i=0;i<=n;i++){

scanf("%d",&a[i]);
answer*=a[i];
}
if(answer<=1000000000000000000){
printf("%d\n",answer);
}else{
printf("-1\n");    
}



return(0);
}

Compiler output:
main.c: In function 'main':
main.c:8:11: error: redeclaration of 'a' with no linkage
    8 | long long a[n]={};
      |           ^
main.c:7:11: note: previous declaration of 'a' with type 'long long int[n]'
    7 | long long a[n];
      |           ^
Language: C++

#include<stdio.h>
signed main();
scanf("%d", &N);N=5
for(i=0;i<N;i++){i=5
scanf("%d", &a[1]);
}
for(i=N-1;i>=0;i--){
    printf("%d\n",a[i]);
}



Compiler output:
a.cc:3:6: error: expected constructor, destructor, or type conversion before '(' token
    3 | scanf("%d", &N);N=5
      |      ^
a.cc:3:17: error: 'N' does not name a type
    3 | scanf("%d", &N);N=5
      |                 ^
a.cc:4:9: error: 'i' does not name a type
    4 | for(i=0;i<N;i++){i=5
      |         ^
a.cc:4:13: error: 'i' does not name a type
    4 | for(i=0;i<N;i++){i=5
      |             ^
a.cc:7:1: error: expected unqualified-id before 'for'
    7 | for(i=N-1;i>=0;i--){
      | ^~~
a.cc:7:11: error: 'i' does not name a type
    7 | for(i=N-1;i>=0;i--){
      |           ^
a.cc:7:16: error: 'i' does not name a type
    7 | for(i=N-1;i>=0;i--){
      |                ^
Language: Java

import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
    	int arrayNum = sc.next();
        long lim = 1000000000000000000L;
      	long quo = 1;
      boolean flg = true;
        for(int i = 0; i < arrayNum; i++){
          while(flg){
            long tmp = sc.nextLong();
            if(tmp == 0){
              quo = 0;
              flg = false;
            }else if(tmp <= lim / quo){
            	quo *= tmp;
          	}else{
               quo = -1;
          		flg = false;
          	}
          }
        }	

          

        System.out.println(quo);
      
      }
    }

Compiler output:
Main.java:5: error: incompatible types: String cannot be converted to int
    	int arrayNum = sc.next();
    	                      ^
1 error
Language: Java

import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
    	int arrayNum = sc.next();
        long lim = 1000000000000000000;
      	long quo = 1;
      boolean flg = true;
        for(int i = 0; i < arrayNum; i++){
          while(flg){
            long tmp = sc.nextLong();
            if(tmp == 0){
              quo = 0;
              flg = false;
            }else if(tmp <= lim / quo){
            	quo *= tmp;
          	}else{
               quo = -1;
          		flg = false;
          	}
          }
        }	

          

        System.out.println(quo);
      
      }
    }

Compiler output:
Main.java:6: error: integer number too large
        long lim = 1000000000000000000;
                   ^
1 error
Language: Java

    import java.util.*;
    public class Main{
      public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
    	int arrayNum = sc.next();
        longlong quo = 1;
        for(int i = 0; i < arrayNum; i++){
          quo *= sc.nextLong();
        }
        long long check = quo / 1000000000000000000;
        if(check > 1){
          quo = -1;
        }
        System.out.println(quo);
      
      }
    }

Compiler output:
Main.java:10: error: not a statement
        long long check = quo / 1000000000000000000;
        ^
Main.java:10: error: ';' expected
        long long check = quo / 1000000000000000000;
            ^
Main.java:10: error: integer number too large
        long long check = quo / 1000000000000000000;
                                ^
3 errors
Language: Java

    import java.util.*;
    public class Main{
      public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
    	int arrayNum = sc.next();
        longlong quo = 1;
        for(int i = 0; i < arrayNum){
          quo *= sc.nextLong();
        }
        int check = quo / 1000000000000000000;
        if(check > 1){
          quo = -1;
        }
        System.out.println(quo);
      
      }
    }

Compiler output:
Main.java:7: error: ';' expected
        for(int i = 0; i < arrayNum){
                                   ^
Main.java:10: error: integer number too large
        int check = quo / 1000000000000000000;
                          ^
2 errors
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int arrayNum = sc.next();
    long quo = 1;
    for(int i = 0; i < arrayNum)
      quo *= sc.nextLong();
    if(quo /1000000000000000000 > 1){
      quo = -1;
    }
    System.out.println(quo);
  
  }
}

Compiler output:
Main.java:7: error: ';' expected
    for(int i = 0; i < arrayNum)
                               ^
Main.java:9: error: integer number too large
    if(quo /1000000000000000000 > 1){
            ^
2 errors
Language: C

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

int main() {
  int n;
  cin >> n;
  int a=1;
  for(int i=0; i<n; i++){
    int b;
    cin >> b;
    a *= b;
    if(a > 1000000000000000000){
      cout << -1 << endl;
      break;
    }
    else if(i==n-1){
      cout << a << endl;
    }
  }
}

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

import java.math.BigInteger;
import java.util.Scanner;


public class Multiplication2 {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ


	    //入力数字の数を入力
		Scanner sc=new Scanner(System.in);

	    int count=sc.nextInt();

		boolean isOverflow = false;  // 桁あふれしたかフラグ
		BigInteger result=BigInteger.ZERO;
		BigInteger max=BigInteger.valueOf((long)Math.pow(10, 18));

	    //入力処理
		for(int i = 0; i < count; i++) {
			long a = sc.nextLong();

			// 桁あふれしている時は、それ以降ゼロが現れるかチェックする
			if (isOverflow) {
				// 桁あふれ後にゼロが出てきたとき
				if (a == (long)0) {
					// 求める値はゼロになる
					result = BigInteger.ZERO;
					isOverflow = false;
					break;
				}
				// 次の値を処理する
				continue;
			}

			// 積を求める
			BigInteger nyuryoku=BigInteger.valueOf(a);
			result= i==0 ? result.add(nyuryoku):result.multiply(nyuryoku);
			// 桁あふれしているか？
			if (result.compareTo(max) > 0) {
				isOverflow = true;
			}
		}

		// 結果を出力する
		if(isOverflow) {
			// 桁あふれ時は「-1」
			System.out.println(-1);
		} else {
			System.out.println(result);
		}
	}
}


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

import java.math.BigInteger;
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ


	    //入力数字の数を入力
		Scanner sc=new Scanner(System.in);

	    int count=sc.nextInt();

		boolean isOverflow = false;  // 桁あふれしたかフラグ
		BigInteger result=BigInteger.ZERO;
		BigInteger max=BigInteger.valueOf((long)Math.pow(10, 18));

	    //入力処理
		for(int i = 0; i < count; i++) {
			long a =s c.nextLong();

			// 桁あふれしている時は、それ以降ゼロが現れるかチェックする
			if (isOverflow) {
				// 桁あふれ後にゼロが出てきたとき
				if (a == (long)0) {
					// 求める値はゼロになる
					result = BigInteger.ZERO;
					isOverflow = false;
					break;
				}
				// 次の値を処理する
				continue;
			}

			// 積を求める
			BigInteger nyuryoku=BigInteger.valueOf(a);
			result= i==0 ? result.add(nyuryoku):result.multiply(nyuryoku);
			// 桁あふれしているか？
			if (result.compareTo(max) > 0) {
				isOverflow = true;
			}
		}

		// 結果を出力する
		if(isOverflow) {
			// 桁あふれ時は「-1」
			System.out.println(-1);
		} else {
			System.out.println(result);
		}
	}
}


Compiler output:
Main.java:22: error: ';' expected
			long a =s c.nextLong();
			         ^
1 error
Language: Java

import java.math.BigInteger;
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ


	    //入力数字の数を入力
		Scanner sc=new Scanner(System.in);

	    int count=sc.nextInt();

		boolean isOverflow = false;
		BigInteger result=BigInteger.ZERO;
		BigInteger max=BigInteger.valueOf((long)Math.pow(10, 18));

	    //入力処理
		for(int i=0;i<count;i++) {
			long a=sc.nextLong();

			// 桁あふれした時は、それ以降ゼロが現れるかチェックする
			if (isOverflow) {
				// 桁あふれ後にゼロが出てきたとき
				if (a == 0) {
					// 求める値はゼロになる
					result = BigInteger.ZERO;
					isOverflow = false;
					break;
				}
				// 次の値を処理する
				continue;
			}

			// 積を求める
			BigInteger nyuryoku=BigInteger.valueOf(a);
			result= i==0 ? result.add(nyuryoku):result.multiply(nyuryoku);
			// 桁あふれしているか？
			if (result.compareTo(max) > 0) {
				isOverflow = true;
			}
		}

		// 結果を出力する
		if(isOverflow)) {
			// 桁あふれ時は「-1」
			System.out.println(-1);
		}else {
			System.out.println(result);
		}
	}
}


Compiler output:
Main.java:47: error: illegal start of expression
		if(isOverflow)) {
		              ^
Main.java:50: error: 'else' without 'if'
		}else {
		 ^
2 errors
Language: Java

import java.math.BigInteger;
import java.util.Scanner;


public class Multiplication2 {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ


	    //入力数字の数を入力
		Scanner sc=new Scanner(System.in);

	    int count=sc.nextInt();

		BigInteger result=BigInteger.ZERO;
		BigInteger max=BigInteger.valueOf((long)Math.pow(10, 18));

	    //入力処理
		for(int i=0;i<count;i++) {
			long a=sc.nextLong();
			BigInteger nyuryoku=BigInteger.valueOf(a);
			result= i==0 ? result.add(nyuryoku):result.multiply(nyuryoku);
		}

		//System.out.println(result.compareTo(max));
		if(result.compareTo(max) > 0) {
			System.out.println(-1);
		}else {
			System.out.println(result);
		}
	}
}


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

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

Compiler output:
Main.java:9: error: integer number too large
        if(quo > 1000000000000000000)
                 ^
Main.java:14: error: reached end of file while parsing
}
 ^
2 errors
Language: Java

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

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

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int numLen = sc.nextInt();
    long quo = sc.nextLong();
    for(int i = 0; i < numLen; i++){
      quo *= sc.nextLong();
    }
    if(quo < 10^18)
    	quo = -1;
    
    System.out.println(quo);
  
  }
}

Compiler output:
Main.java:10: error: bad operand types for binary operator '^'
    if(quo < 10^18)
               ^
  first type:  boolean
  second type: int
1 error
Language: Java

import java.math.BigInteger;
import java.util.Scanner;


public class Multiplication2 {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ


	    //入力数字の数を入力
		Scanner sc=new Scanner(System.in);

	    int count=sc.nextInt();

		BigInteger result=BigInteger.ZERO;
		BigInteger max=BigInteger.valueOf((long)Math.pow(10, 18));

	    //入力処理
		for(int i=0;i<count;i++) {
			long a=sc.nextLong();
			BigInteger nyuryoku=BigInteger.valueOf(a);
			if(result.compareTo(max)==1) {
				break;
			}else {
				result= i==0 ? result.add(nyuryoku):result.multiply(nyuryoku);
			}
		}

		//System.out.println(result.compareTo(max));
		if(result.compareTo(max)==1) {
			System.out.println(-1);
		}else {
			System.out.println(result);
		}
	}
}


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

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

const ll MX = 1e18;

int main(){
    int n;
    cin >> n;
    ll ans = 1;
    
    bool ng = false;
    rep(i,n){
        ll a;
        cin >> a;
        if (a==0){
            cout << 0;
            return 0;
        }
        if(ng || MX/ans < a || ans*a > MX){
            ng = true;
        }
        ans*=a;
    }
    if(ng)cout << -1;
    else cout << ans;
    return 0;
}

Compiler output:
a.cc:4:1: error: 'ussing' does not name a type
    4 | ussing ll = long long;
      | ^~~~~~
a.cc:7:7: error: 'll' does not name a type
    7 | const ll MX = 1e18;
      |       ^~
a.cc: In function 'int main()':
a.cc:12:5: error: 'll' was not declared in this scope
   12 |     ll ans = 1;
      |     ^~
a.cc:16:11: error: expected ';' before 'a'
   16 |         ll a;
      |           ^~
      |           ;
a.cc:17:16: error: 'a' was not declared in this scope
   17 |         cin >> a;
      |                ^
a.cc:22:18: error: 'MX' was not declared in this scope
   22 |         if(ng || MX/ans < a || ans*a > MX){
      |                  ^~
a.cc:22:21: error: 'ans' was not declared in this scope; did you mean 'abs'?
   22 |         if(ng || MX/ans < a || ans*a > MX){
      |                     ^~~
      |                     abs
a.cc:25:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |         ans*=a;
      |         ^~~
      |         abs
a.cc:28:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |     else cout << ans;
      |                  ^~~
      |                  abs
Language: Java

import java.math.BigInteger;
import java.util.Scanner;

public class Main71 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        BigInteger[] b = new BigInteger[a];
        BigInteger total = BigInteger.ONE;
        for(int i =0; i<a; i++) {
            b[i] = sc.nextBigInteger();
            if(b[i] == BigInteger.ZERO) {
                System.out.println("0");
                return;
            }
        }
        BigInteger c = BigInteger.TEN.pow(18);
        for(int i =0; i<a; i++) {
            if(0 > total.compareTo(c) ) {
                System.out.println("-1");
                return;
            }
            total = b[i].multiply(total);
        }
        System.out.println(total);
    }
}

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

#include <iostream>
#define some 1000000000000000000
using std::cin;
using std::cout;

int main(){
  int n;
  bool containzero = false;
  long long a[100007];
  cin >> n;
  for (int i = 0;i <n;i++){
    cin >> a[i];
    if(!containzero&&a[i] == 0){
      containzero = true;
    }
  }
  if(containzero){
    cout << 0 << '\n';
    return ;
  }
  long long ans = 1;
  for (int i = 0;i<n;i++){
    if (a[i] <= some / ans){
      ans *= a[i];
    }else{
      cout << '-1\n';
      return ;
    }
  }
  cout << ans << '\n';
  return 0;
}


Compiler output:
a.cc:26:15: warning: multi-character character constant [-Wmultichar]
   26 |       cout << '-1\n';
      |               ^~~~~~
a.cc: In function 'int main()':
a.cc:19:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   19 |     return ;
      |     ^~~~~~
a.cc:27:7: error: return-statement with no value, in function returning 'int' [-fpermissive]
   27 |       return ;
      |       ^~~~~~
Language: C++

#include <iostream>
#using std::cin;
#using std::cout;
#define some 1000000000000000000

int main(){
  int n;
  bool containzero = false;
  long long a[100007];
  cin >> n;
  for (int i = 0;i <n;i++){
    cin >> a[i];
    if(!containzero&&a[i] == 0){
      containzero = true;
    }
  }
  if(containzero){
    cout << 0 << '\n';
    return ;
  }
  long long ans = 1;
  for (int i = 0;i<n;i++){
    if (a[i] <= some / ans){
      ans *= a[i];
    }else{
      cout << '-1\n';
      return ;
    }
  }
  cout << ans << '\n';
  return 0;
}


Compiler output:
a.cc:2:2: error: invalid preprocessing directive #using
    2 | #using std::cin;
      |  ^~~~~
a.cc:3:2: error: invalid preprocessing directive #using
    3 | #using std::cout;
      |  ^~~~~
a.cc:26:15: warning: multi-character character constant [-Wmultichar]
   26 |       cout << '-1\n';
      |               ^~~~~~
a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:18:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |     cout << 0 << '\n';
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   19 |     return ;
      |     ^~~~~~
a.cc:26:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   26 |       cout << '-1\n';
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:27:7: error: return-statement with no value, in function returning 'int' [-fpermissive]
   27 |       return ;
      |       ^~~~~~
a.cc:30:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   30 |   cout << ans << '\n';
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
const int p= 1e18;
signed main(){
   FAST;

   int n; unsigned long long int m=1; bool b=false;
  cin>>n;
  while(n--){
  	int x; cin>>x; m*=x;
    if(m>18){b=true; break;}
  }
   if(b) cout<<-1<<endl; else cout<<m<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long
      |             ^~~~
a.cc:9:30: note: in expansion of macro 'int'
    9 |    int n; unsigned long long int m=1; bool b=false;
      |                              ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:9:30: note: in expansion of macro 'int'
    9 |    int n; unsigned long long int m=1; bool b=false;
      |                              ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ss second
#define ff first
#define N 100005
#define inf 1000000009
#define ll long long
#define pii pair<int,int>
#define sz(a) int(a.size())
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

int n;
ll sum = 1,x;

int main(){
	cin >> n;
	for(int i = 1;i <= n;i++){
    	cin >> x;
      if(x > 1e18/sum) return cout << -1;
		sum *= x;
    }
  cout << sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:36: error: cannot convert 'std::basic_ostream<char>' to 'int' in return
   20 |       if(x > 1e18/sum) return cout << -1;
      |                               ~~~~~^~~~~
      |                                    |
      |                                    std::basic_ostream<char>
Language: C++

#include <iostream>
using namespace std;

int main() {
  int n,key;
  int judge = 1, sum = 1;
  cin >> n;
  for(int i = 0; i < 18; i++){
    judge *= 10;
  }
  for(int i = 0; i < n; i++) {
    cin >> key;
    sum *= key;
  }
  if(sum < judge) {
    cout << sum << endl;
  }
  else {
    count << "-1" << endl;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: 'count' was not declared in this scope
   19 |     count << "-1" << endl;
      |     ^~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int n,key;
  int judge = 1, sum = 1;
  cin >> n;
  for(int i = 0; i < 18; i++){
    judge *= 10;
  }
  for(int i = 0; i < n; i++) {
    cin >> key;
    c *= key;
  }
  if(c < judge) {
    cout << c << endl;
  }
  else {
    count << "-1" << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'c' was not declared in this scope
   13 |     c *= key;
      |     ^
a.cc:15:6: error: 'c' was not declared in this scope
   15 |   if(c < judge) {
      |      ^
a.cc:19:5: error: 'count' was not declared in this scope
   19 |     count << "-1" << endl;
      |     ^~~~~
Language: C++

#include<iostream.h>
using namespace std;
int main(){
  int a, b;
  cin>>a>>b;
  unsigned long long int b;
  b = (a*a);
  if(b>1000000000000000000) cout<<"-1";
  else cout<<b;
  return 0;
}
 	

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

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll n,a,p=1,l=1;;
    cin>>n;
    while(n--)
    {
        cin>>a;
        p*=a;
        if(p>1e18)
        {
            l=0;;
        }
    }
    if(l==1)
        cout<<p;
    else
        cout<<"-1";




}


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

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

Compiler output:
Main.java:15: error: integer number too large
      if( sum < 0 || sum >= 1000000000000000000 )
                            ^
1 error
Language: Java

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

Compiler output:
Main.java:9: error: cannot find symbol
    val = scan.nextInt();
          ^
  symbol:   variable scan
  location: class Main
Main.java:14: error: cannot find symbol
      sum += scan.nextLong();
             ^
  symbol:   variable scan
  location: class Main
2 errors
Language: C++

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

int main
{
int n,temp;
int ans=1;
for(int i=0; i<n; i++)
  {
    cin >> temp;
    ans *= temp
  }
  if(ans <= 10**18) cout << ans;
  else{cout << -1;}
}


Compiler output:
a.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main
      |     ^~~~
a.cc:6:1: error: expected primary-expression before 'int'
    6 | int n,temp;
      | ^~~
a.cc:6:1: error: expected '}' before 'int'
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
a.cc:8:1: error: expected unqualified-id before 'for'
    8 | for(int i=0; i<n; i++)
      | ^~~
a.cc:8:14: error: 'i' does not name a type
    8 | for(int i=0; i<n; i++)
      |              ^
a.cc:8:19: error: 'i' does not name a type
    8 | for(int i=0; i<n; i++)
      |                   ^
a.cc:13:3: error: expected unqualified-id before 'if'
   13 |   if(ans <= 10**18) cout << ans;
      |   ^~
a.cc:14:3: error: expected unqualified-id before 'else'
   14 |   else{cout << -1;}
      |   ^~~~
a.cc:15:1: error: expected declaration before '}' token
   15 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
int main(){
  ll n;
  cin>>n;
  ll ans=1;
  vector<ll> a(n);
  for(int i=0; i<n; i++){
    cin>>a.at(i);
    if(a.at(i) ==0){
      cout<<0<<endl;
      return 0;
    }
  }
  for(int i=0; i<n; i++){
    cin>>a.at(i);
    if(a.at(i) <= 1e18/ans){
      ans *= a;
    }
    else{
      cout<<-1<<endl;
      return 0;
    }
  }
  cout<<ans<<endl;
  
//    cout << fixed << setprecision(10);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: no match for 'operator*=' (operand types are 'll' {aka 'long long int'} and 'std::vector<long long int>')
   19 |       ans *= a;
      |       ~~~~^~~~
Language: C++

#include <stdio.h>
int main(void){
    int N,b=0;
    scanf("%d",&N);
    int A[N],ans=1;
    for (int i =0;i<N;i++){
        scanf("%d",&A[i]);
        ans*=A[i];
        if (ans>1000000000000000000){
            for(int j=i;j<N;j++){
                if(A[j]==0){
                    printf("0");
                    b=1
                    break;
                }
            if(j==N-1){
                printf("-1");
                b=1;
                break;
            }
            break;
            }
        }
    if(b==0) printf("a");
    
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: expected ';' before 'break'
   13 |                     b=1
      |                        ^
      |                        ;
   14 |                     break;
      |                     ~~~~~
Language: C++

#include<stdio.h>
int main()
{ int a[10],i,N;
  printf(" no of elements");
  scanf("%d",&N);
  for(i=0;i<N;i++)
  {
    printf("enter the no: ");
    scanf("%d",&a[i]);
  }
 


Compiler output:
a.cc: In function 'int main()':
a.cc:10:4: error: expected '}' at end of input
   10 |   }
      |    ^
a.cc:3:1: note: to match this '{'
    3 | { int a[10],i,N;
      | ^
Language: C++

#include<stdio.h>
int main()
{ int a,b,i,N;
  printf(" no of elements");
  scanf("%d",&N);
  for(i=0;i<N;i++)
  {
    printf("enter the no: ");
    scanf("%d",&a[i]);
  }
 


Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: invalid types 'int[int]' for array subscript
    9 |     scanf("%d",&a[i]);
      |                  ^
a.cc:10:4: error: expected '}' at end of input
   10 |   }
      |    ^
a.cc:3:1: note: to match this '{'
    3 | { int a,b,i,N;
      | ^
Language: C++

#include<stdio.h>
int main()
{ int a,b,i,N;
  printf(" no of elements");
  scanf("%d"&N);
  for(i=0;i<N;i++)
  {
    printf("enter the no: ");
    scanf("%d",&a[i]);
  }
 


Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: invalid operands of types 'const char [3]' and 'int' to binary 'operator&'
    5 |   scanf("%d"&N);
      |         ~~~~^~
      |         |    |
      |         |    int
      |         const char [3]
a.cc:9:18: error: invalid types 'int[int]' for array subscript
    9 |     scanf("%d",&a[i]);
      |                  ^
a.cc:10:4: error: expected '}' at end of input
   10 |   }
      |    ^
a.cc:3:1: note: to match this '{'
    3 | { int a,b,i,N;
      | ^
Language: C++

#include<stdio.h>
int main()
{ int a,b,i;
  printf(" no of elements");
  scanf("%d"&N);
  for(i=0;i<N;i++)
  {
    printf("enter the no: ");
    scanf("%d",&a[i]);
  }
 


Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: 'N' was not declared in this scope
    5 |   scanf("%d"&N);
      |              ^
a.cc:9:18: error: invalid types 'int[int]' for array subscript
    9 |     scanf("%d",&a[i]);
      |                  ^
a.cc:10:4: error: expected '}' at end of input
   10 |   }
      |    ^
a.cc:3:1: note: to match this '{'
    3 | { int a,b,i;
      | ^
Language: C++

#include<stdio.h>
int main()
{
  printf(" no of elements");
  scanf("%d"&N);
  for(i=0;i<N;i++)
  {
    printf("enter the no: ");
    scanf("%d",&

Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: 'N' was not declared in this scope
    5 |   scanf("%d"&N);
      |              ^
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   for(i=0;i<N;i++)
      |       ^
a.cc:9:17: error: expected primary-expression at end of input
    9 |     scanf("%d",&
      |                 ^
a.cc:9:17: error: expected '}' at end of input
a.cc:7:3: note: to match this '{'
    7 |   {
      |   ^
a.cc:9:17: error: expected '}' at end of input
    9 |     scanf("%d",&
      |                 ^
a.cc:3:1: note: to match this '{'
    3 | {
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define maxN 1000000000000000000
int n;
long long a[100020];

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin>>n;
  long long P=1;
  for (int i=1;i<=n;++i){
    {
      cin>>a[i];
      if (maxN/P<a[i]) 
      {
        cout<<"-1";exit(0);
      }
      P*=a[i];
    }
   cout<<P;
 }

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

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

#define ll long long cpp_int
 
int main(){
  int n;
  cin>>n;
  ll a[n];
  ll fact=1;
  for(int i=0; i<n; i++) {
  fact = fact*a[i];
    if(fact > 1000000000000000000)
    {fact=-1; break;}
  }
  cout<<fact<<endl;
  return 0;
}


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

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

#define ll cpp_int
 
int main(){
  ll n;
  cin>>n;
  ll a[n];
  ll fact=1;
  for(int i=0; i<n; i++) {
  fact = fact*a[i];
    if(fact > 1000000000000000000)
    {fact=-1; break;}
  }
  cout<<fact<<endl;
  return 0;
}


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

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

#define ll long long cpp_int
 
int main(){
  ll n;
  cin>>n;
  ll a[n];
  ll fact=1;
  for(int i=0; i<n; i++) {
  fact = fact*a[i];
    if(fact > 1000000000000000000)
    {fact=-1; break;}
  }
  cout<<fact<<endl;
  return 0;
}


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

import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
      	int factors = scanner.nextInt();
      	long result = 1l;
      	for(int i = 0; i < factors; i++)
          result *= scanner.nextLong();
      	if(result > Math.pow(10, 18) || result < 0){
      		result = -1;
      	}
      	System.out.print(result);
	}
}

Compiler output:
Main.java:10: error: illegal character: '\u00a0'
      	if(result > Math.pow(10, 18) ||?result < 0){
      	                               ^
Main.java:10: error: illegal start of type
      	if(result > Math.pow(10, 18) ||?result < 0){
      	                                         ^
Main.java:10: error: not a statement
      	if(result > Math.pow(10, 18) ||?result < 0){
      	                                       ^
3 errors
Language: Java

import java.util.Scanner;

public class Main {
	public static void Main(String[] args){
		Scanner scanner = new Scanner(System.in);
      	int factors = scanner.nextInt();
      	long result = 1l;
      	for(int i = 0; i < factors; i++)
          result *= scanner.nextLong;
      	if(result > Math.pow(10, 18) || result < 0){
      		result = -1;
      	}
      	System.out.print(result);
	}
}

Compiler output:
Main.java:10: error: illegal character: '\u00a0'
      	if(result > Math.pow(10, 18) ||?result < 0){
      	                               ^
Main.java:10: error: illegal start of type
      	if(result > Math.pow(10, 18) ||?result < 0){
      	                                         ^
Main.java:10: error: not a statement
      	if(result > Math.pow(10, 18) ||?result < 0){
      	                                       ^
3 errors
Language: C++

#include <iostream>
using namespace std;

int main() {
	int n;
  	cin >> n;
  	unsigned long long x;
  	unsigned long long z = 1;
  	bool flag = false;
  	bool zeroflag = false;
  	for (int i = 0; i < n; i++ )
    {
      cin >> x;
      
      if (x == 0) 
      {
        zeroflag = true;
      }
      if (x <= 1000000000000000000/z)
      {
        z = z*x;
      }
      else 
      {
		flah = true;
      }
    }
  if (!zeroflag) 
  {
    if(!flag) 
    {
  		cout << z << endl;
    }
    else
    {
          cout << -1 << endl;
    }
  }
  else
  {
    cout << 0 << endl;
  }
  
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: 'flah' was not declared in this scope; did you mean 'flag'?
   25 |                 flah = true;
      |                 ^~~~
      |                 flag