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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: call of overloaded 'abs(long long unsigned int&)' is ambiguous
   13 |   if(abs(sum)>1000000000000000000 ||sum<0)
      |      ~~~^~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
  137 |   abs(__float128 __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
   85 |   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll,ll> pll;
#define fs first
#define re resize
#define sc second
#define pb push_back
#define eb emplace_back
#define MP make_pair
#define all(x) x.begin(),x.end()
#define mod 1000000007
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define REP(i,n) FOR(i,0,n-1)
#define ins insert
#define mod 1000000007
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << std::endl;
        //use cerr if u want to display at the bottom
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif
#define endl "\n"
void fastIO(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif   
}
ll modexpo(ll a , ll b){
    if(a==0)return 0;
    if(a==1 or b==0)return 1;
    if(b==1)return a;
    if(b&1) return (a%mod*modexpo(a,b-1)%mod)%mod;
    return modexpo(a%mod * a%mod  ,  b/2 ) % mod;
}
void printv(vll v){
    for(auto&x:v) {
        cout<<x<<" ";
    }
    cout<<endl;
}
string to_string1(ll x){stringstream ss; ss<<x; return ss.str();}
ll to_integer(string s){stringstream ss(s); ll x; ss>>x; return x;}
#define tp9 1000000000 
#define N 8000
ll  a, b,c,d;
void input(){
    cin >> a>> b >> c>> d;
} 
ld pi = 3.1415926535;
void printYes() {
    cout << "Yes\n";
}
void printNo() {
    cout << "No\n";
}
ll t , n , p ;
string s;
ll a [100010];
int main (){
    ll n;
    cin >> n  ;
    REP(i,n){
        cin >> a[i] ;
    }
    ll zero =0;
    REP(i,n) if(a[i]==0) zero ++;
    if(zero){
        cout<<0<<endl;
        return 0;
    }
    ll ans =1;
    for(int i=0;i<n;i++){
        if(a[i] <=1000000000000000000/ ans ){
            ans *=a[i];
        }else{
            cout<<-1<<endl;
            return 0;
        }
    }
    cout<<ans<<endl;
}


Compiler output:
a.cc:73:4: error: conflicting declaration 'll a [100010]'
   73 | ll a [100010];
      |    ^
a.cc:60:5: note: previous declaration as 'll a'
   60 | ll  a, b,c,d;
      |     ^
a.cc: In function 'int main()':
a.cc:78:17: error: invalid types 'll {aka long long int}[int]' for array subscript
   78 |         cin >> a[i] ;
      |                 ^
a.cc:81:18: error: invalid types 'll {aka long long int}[int]' for array subscript
   81 |     REP(i,n) if(a[i]==0) zero ++;
      |                  ^
a.cc:88:13: error: invalid types 'll {aka long long int}[int]' for array subscript
   88 |         if(a[i] <=1000000000000000000/ ans ){
      |             ^
a.cc:89:20: error: invalid types 'll {aka long long int}[int]' for array subscript
   89 |             ans *=a[i];
      |                    ^
Language: C++

#include<bit/stdc++.h>
using namespace std;
int main()
{
  long long int n,i,a[100005],sum=1,result=1000000000;
  cin>>n;
  for(i=0;i<n;i++)
  {
   cin>>a[i];
    sum=sum*a[i];
  }
  result=result+result;
  if(sum>result)
  {
   cout<<"-1"<<endl; 
  }
  else
  {
   cout<<sum<<endl; 
  }
  return 0;
}

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

#import <iostream>
#import <math.h>
using namespace std;
 
int main() {
 
long a;
cin >> a;
 
unsigned long long int b;
unsigned long long int realtotal = 1;
unsigned long long temp = 1;
for(int i = 0; i<a; i++){
  cin >> b;
  temp = temp*b
  if(temp < realtotal){
   	cout << -1;
    break;
  }
  realtotal = realtotal*b;
  }
  if(realtotal == 0){
    break;
  }
}
 
  if(0 < realtotal < 1e18){
    cout << realtotal; 
  }
 
}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import <iostream>
      |  ^~~~~~
a.cc:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    2 | #import <math.h>
      |  ^~~~~~
a.cc: In function 'int main()':
a.cc:15:16: error: expected ';' before 'if'
   15 |   temp = temp*b
      |                ^
      |                ;
   16 |   if(temp < realtotal){
      |   ~~            
a.cc:23:5: error: break statement not within loop or switch
   23 |     break;
      |     ^~~~~
a.cc: At global scope:
a.cc:27:3: error: expected unqualified-id before 'if'
   27 |   if(0 < realtotal < 1e18){
      |   ^~
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^
Language: C++

int main(){
	int a;
  	cin>>a;
  	long long int total = 1;
  	long long int b;
  	for(int i =0; i<a; i++){
      	cin>>b;
      	total*=b;
      	if(total>1e18){
          total=-1;
         break;
        }
 
    }
  	cout<<total;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin>>a;
      |         ^~~
a.cc:15:9: error: 'cout' was not declared in this scope
   15 |         cout<<total;
      |         ^~~~
Language: C++

#import <iostream>
#import <math.h>
using namespace std;
 
int main() {
 
long a;
cin >> a;
 
long long int b;
long long int realtotal = 1;
for(int i = 0; i<a; i++){
  cin >> b;
  if(1e18/realtotal < b){
    cout << -1;
    break;
  }
  realtotal = realtotal*b;
  if(realtotal == 0){
    break;
  }
 
 
  if(realtotal < 1e18){
    cout << realtotal; 
  }
 
}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import <iostream>
      |  ^~~~~~
a.cc:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    2 | #import <math.h>
      |  ^~~~~~
a.cc: In function 'int main()':
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#import <iostream>
#import <math.h>
using namespace std;
 
int main() {
 
long a;
cin >> a;
 
long long int b;
long long int realtotal = 1;
bool yes = false;
for(int i = 0; i<a; i++){
  cin >> b;
  if(1e18/b < a){
    cout << -1;
    break;
  }
  realtotal = realtotal*b;
  if(realtotal == 0){
    break;
  	}
  if(i = a %% realtotal != 0){
   	yes = true; 
  }
  }
 
 
  if(true){
    cout << realtotal; 
  }
 
}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import <iostream>
      |  ^~~~~~
a.cc:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    2 | #import <math.h>
      |  ^~~~~~
a.cc: In function 'int main()':
a.cc:23:13: error: expected primary-expression before '%' token
   23 |   if(i = a %% realtotal != 0){
      |             ^
Language: C++

#import <iostream>
#import <math.h>
using namespace std;
 
int main() {
 
int a;
cin >> a;
 
unsigned long b;
unsigned long long total = 1;
bool error = false;
for(int i = 0; i<a; i++){
  cin >> b;
  total = total*b;
  if(total > pow(10, 18)){
     error = true;
    break;
  }
  
}  
  
if (error)
{
  for (;i<a; i++)
  {
    cin >> b;
    if(b == 0)
      total = 0;
  }
}
if(total <= pow(10, 18)){
  cout << total;
}
else{
 cout << -1; 
}
}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import <iostream>
      |  ^~~~~~
a.cc:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    2 | #import <math.h>
      |  ^~~~~~
a.cc: In function 'int main()':
a.cc:25:9: error: 'i' was not declared in this scope
   25 |   for (;i<a; i++)
      |         ^
Language: C++

#import <iostream>
#import <math.h>
using namespace std;
 
int main() {
 
int a;
cin >> a;
 
unsigned long b;
unsigned long long total = 1;
for(int i = 0; i<a; i++){
  cin >> b;
  total = total*b;
 
  }
}  
if(total <= pow(10, 18)){
  cout << total;
}
else{
 cout << -1; 
}
}	


Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import <iostream>
      |  ^~~~~~
a.cc:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    2 | #import <math.h>
      |  ^~~~~~
a.cc:18:1: error: expected unqualified-id before 'if'
   18 | if(total <= pow(10, 18)){
      | ^~
a.cc:21:1: error: expected unqualified-id before 'else'
   21 | else{
      | ^~~~
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#import <iostream>
#import <math.h>
using namespace std;
 
int main() {
 
int a;
cin >> a;
 
unsigned long b;
unsigned long long total = 1;
for(int i = 0; i<a; i++){
  cin >> b;
  total = total*b;
 
  }
}  
if(total <= pow(10, 18))
  cout << total;
else{
 cout << -1; 
}
	
}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import <iostream>
      |  ^~~~~~
a.cc:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    2 | #import <math.h>
      |  ^~~~~~
a.cc:18:1: error: expected unqualified-id before 'if'
   18 | if(total <= pow(10, 18))
      | ^~
a.cc:20:1: error: expected unqualified-id before 'else'
   20 | else{
      | ^~~~
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#import <iostream>
#import <math.h>
using namespace std;
 
int main() {
 
int a;
cin >> a;
if(a > pow (10, 5)){
 	cout << -1;
  	return;
}

unsigned long b;
unsigned long long total = 1;
for(int i = 0; i<a; i++){
  cin >> b;
  if(b > pow (10, 18)){
   	cout << -1;
  	return;
  }
  total = total*b;
}  
if(total < pow(10, 18)){
   cout << total;
	}
else{
  cout << -1;
	}
}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import <iostream>
      |  ^~~~~~
a.cc:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    2 | #import <math.h>
      |  ^~~~~~
a.cc: In function 'int main()':
a.cc:11:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   11 |         return;
      |         ^~~~~~
a.cc:20:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   20 |         return;
      |         ^~~~~~
Language: C++

#import <iostream>
#import <math.h>
using namespace std;
 
void main() {
 
int a;
cin >> a;
if(a > pow (10, 5)){
 	cout << -1;
  	return;
}

double b;
double total = 1;
for(int i = 0; i<a; i++){
  cin >> b;
  total = total*b;
}  
if(total < pow(10, 18)){
   cout << total;
	}
else{
  cout << -1;
	}
}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import <iostream>
      |  ^~~~~~
a.cc:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    2 | #import <math.h>
      |  ^~~~~~
a.cc:5:1: error: '::main' must return 'int'
    5 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:11:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   11 |         return;
      |         ^~~~~~
Language: C++

#import <iostream>
#import <math.h>
using namespace std;
 
int main() {
 
int a;
cin >> a;
if(a > pow (10, 5)){
 	cout << -1;
  	return;
}

double b;
double total = 1;
for(int i = 0; i<a; i++){
  cin >> b;
  total = total*b;
}  
if(total < pow(10, 18)){
   cout << total;
	}
else{
  cout << -1;
	}
}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import <iostream>
      |  ^~~~~~
a.cc:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    2 | #import <math.h>
      |  ^~~~~~
a.cc: In function 'int main()':
a.cc:11:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   11 |         return;
      |         ^~~~~~
Language: C++

#import <iostream>
#import <math.h>
using namespace std;
 
int main() {
 
int a;
cin >> a;
 
int b;
long long total = 1;
for(int i = 0; i<a; i++){
  cin >> b;
  total = total*b;
}  
if(total < pow(10, 18){
   cout << total;
	}
else{
  cout << -1;
	}
}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import <iostream>
      |  ^~~~~~
a.cc:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    2 | #import <math.h>
      |  ^~~~~~
a.cc: In function 'int main()':
a.cc:16:23: error: expected ')' before '{' token
   16 | if(total < pow(10, 18){
      |   ~                   ^
      |                       )
a.cc:22:1: error: expected primary-expression before '}' token
   22 | }
      | ^
Language: C++

#import <iostream>
#import <math.h>
using namespace std;
 
int main() {
 
int a;
cin >> a;
 
int b;
long long total = 1;
for(int i = 0; i<a; i++){
  cin >> b;
  total = total*b;
}  
if(total < pow(10, 18){
   cout << total;
	}
else(){
  cout << -1;
	}
}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import <iostream>
      |  ^~~~~~
a.cc:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    2 | #import <math.h>
      |  ^~~~~~
a.cc: In function 'int main()':
a.cc:16:23: error: expected ')' before '{' token
   16 | if(total < pow(10, 18){
      |   ~                   ^
      |                       )
a.cc:22:1: error: expected primary-expression before '}' token
   22 | }
      | ^
Language: Java

import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.BigInteger;
/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{try {
	    
	
	    Scanner k=new Scanner(System.in);
		int n=k.nextInt();
		BigInteger f=new BigInteger("1");	BigInteger ff=new BigInteger("1000000000000000000");
		for(int i=0;i<n;i++)
		{
		    long p=k.nextLong();
		    BigInteger ii=BigInteger.valueOf(p);
		    f=f.multiply(BigInteger.valueOf(p));
		}
		if(f.compareTo(ff)==1)
		System.out.print("-1");
		else
			System.out.print(f);}
			catch(Exception e) {
	return;}
		
	}
}


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

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef unsigned long long int ull;
#define vi vector<int>
#define vpi vector<pair<int,int> >
#define mpi map<int,int>
#define  si set<int>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define reP(i,a,n) for(int i=a;i<=n;i++)
#define YES cout<<"YES\n";
#define NO cout<<"NO\n";
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define st string
#define sz size()
#define case(i,n) Case<<" "<<i<<": "<<n<<endl;
#define tc ll t;cin>>t;while(t--)
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n;
    ll ans=1;
    cin>>n;
    vector<ll> a(n);
    rep(i,n){
        cin>>a[i];
    }
    sort(a.begin(),a.end());
    if(a[0]==0){
        cout<<"0"<<endl;
        return 0;
    }
    rep(i,n){
        if(a[i]>1000000000000000000/ans){
            cout<<"-1"<<endl;
            return 0;
        }
        ans=ans*a[i];
    }
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc:31:12: error: macro "rep" requires 3 arguments, but only 2 given
   31 |     rep(i,n){
      |            ^
a.cc:10:9: note: macro "rep" defined here
   10 | #define rep(i,a,n) for(int i=a;i<n;i++)
      |         ^~~
a.cc:39:12: error: macro "rep" requires 3 arguments, but only 2 given
   39 |     rep(i,n){
      |            ^
a.cc:10:9: note: macro "rep" defined here
   10 | #define rep(i,a,n) for(int i=a;i<n;i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:31:5: error: 'rep' was not declared in this scope
   31 |     rep(i,n){
      |     ^~~
a.cc:39:8: error: expected ';' before '{' token
   39 |     rep(i,n){
      |        ^    ~
      |        ;
Language: C++

#include<iostream>
#define ll long long
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: expected ';' before 'i'
    9 |   for(int i=0; i<n i++) {
      |                   ^~
      |                   ;
Language: C++

#include<iostream>
#define (ll) long long
using namespace std;

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


Compiler output:
a.cc:2:9: error: macro names must be identifiers
    2 | #define (ll) long long
      |         ^
a.cc: In function 'int main()':
a.cc:8:3: error: 'll' was not declared in this scope
    8 |   ll a[n],p=1;
      |   ^~
a.cc:9:19: error: expected ';' before 'i'
    9 |   for(int i=0; i<n i++) {
      |                   ^~
      |                   ;
a.cc:10:16: error: 'a' was not declared in this scope
   10 |         cin >> a[i];
      |                ^
a.cc:11:5: error: 'p' was not declared in this scope
   11 |     p*=a[i];
      |     ^
a.cc:13:6: error: 'p' was not declared in this scope
   13 |   if(p>(ll)1e18) cout << -1 << endl;
      |      ^
a.cc:13:12: error: expected ')' before numeric constant
   13 |   if(p>(ll)1e18) cout << -1 << endl;
      |     ~      ^~~~
      |            )
Language: C++

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'll' was not declared in this scope
    7 |   ll a[n],p=1;
      |   ^~
a.cc:8:19: error: expected ';' before 'i'
    8 |   for(int i=0; i<n i++) {
      |                   ^~
      |                   ;
a.cc:9:16: error: 'a' was not declared in this scope
    9 |         cin >> a[i];
      |                ^
a.cc:10:5: error: 'p' was not declared in this scope
   10 |     p*=a[i];
      |     ^
a.cc:12:6: error: 'p' was not declared in this scope
   12 |   if(p>(ll)1e18) cout << -1 << endl;
      |      ^
a.cc:12:12: error: expected ')' before numeric constant
   12 |   if(p>(ll)1e18) cout << -1 << endl;
      |     ~      ^~~~
      |            )
Language: Java

import java.util.*; 
import java.io.*;

public class C_02_Multiplication2 {
    static StringTokenizer st;
    static BufferedReader br;  
    static PrintWriter out;
 
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));

        int N = nextInt();
    
        long ans = nextLong();

        for (int i=1; i<N; i++) {
            ans = ans * nextLong();
            if(ans>(long)1e18 || ans < 0){
                System.out.println(-1);
                return;
            }
        }

        System.out.println(ans);
 
    }
    
      
    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    public static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    public static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    }
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  ios_base::sync_with_stdio(false);cin.tie(0);
  long long int N;
  long long double sum = 1;
  cin>>N;
  long long int arr[N];
  for(long long int i = 0;i < N;i++){
    cin>>arr[i];
  }
  for(int i = 0;i < N;i++){
    sum *= arr[i];
  }
  if(sum <= 1000000000000000000 || sum < 0){
    cout<<sum<<'\n';
  }else{
    cout<<-1<<'\n';
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: 'long long' specified with 'double'
    6 |   long long double sum = 1;
      |        ^~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 'a' was not declared in this scope
   15 |     cin >> a[i];
      |            ^
a.cc:22:36: error: 'a' was not declared in this scope
   22 |     if(1000000000000000000 / ans < a[i]){
      |                                    ^
a.cc:26:12: error: 'a' was not declared in this scope
   26 |     ans *= a[i];
      |            ^
Language: C++

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

    vector<long long> v(n);
    for (int i=0; i<n; i++){
        long long a;
        cin >> a;
        v.at(i) = a;
        if(a == 0){
            cout << 0 << endl;
            return 0;
        }
    }
    sort(v.begin(), v.end());
    long long ans=1;
    for (int i=0; i<n; i++){
       ans *= v.at(i);
       if(ans > 10e18){
           cout << -1 << endl;
           return 0;
       }
    }
    cout << ans << endl;
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   18 |     sort(v.begin(), v.end());
      |     ^~~~
      |     short
Language: C

#include<stdio.h>
int main(){
  int n,i;
  int a=1;
  scanf("%d",&n);
  int b[n];
  for(i=0;i<n;i++){
    scanf("%d",&b[i]);
    a =a*b[i];
  }
  if(a>10**18){
    printf("-1");
  }
  else{
    printf("%d",a);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:11: error: invalid type argument of unary '*' (have 'int')
   11 |   if(a>10**18){
      |           ^~~
Language: C

#include<stdio.h>
int main(){
  int n,i;
  int a=1;
  scanf("%d",n);
  int b[n];
  for(i=0;i<n;i++){
    scanf("%d",b[i]);
    a =a*b[i];
  }
  if(a>10**18){
    printf("-1");
  }
  else{
    printf("%d",a);

Compiler output:
main.c: In function 'main':
main.c:11:11: error: invalid type argument of unary '*' (have 'int')
   11 |   if(a>10**18){
      |           ^~~
main.c:15:5: error: expected declaration or statement at end of input
   15 |     printf("%d",a);
      |     ^~~~~~
main.c:15:5: error: expected declaration or statement at end of input
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	vector <int> a(n);
	ans=1;
	while (n--) {
		int f;
		cin >> f;
		ans*=f;
	}
	const long long t = pow(10,18);
	if (ans>t) cout << -1;
	else cout << ans;
	return 0;
}

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

def main ():
	N = int(input())
	A = list(map(int,input(). split ()))
	if 0 in A:
		print(0)
		return
  prod = 1
  for a in A:
  	prod *= a
  	if prod > 1000000000000000000:
  		print(-1)
  		return
          
  print(prod)
main ()

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def main ():
      | ^~~
Language: C

#include<bits/stdc++.h>
#include<stdio.h>
#define ll long long
ll a[10010];

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)
    {
       printf("0\n");
       return 0;
    }


    ll prod=1;
    for(int i=0;i<n;i++)
    {
        if(a[i ] <=1000000000000000000/ prod)
        {
            prod *=a[i];
        }
        else
        {
           printf("-1\n");
           return 0;
        }
    }

    printf("%lld\n",prod );

}


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.*;
import java.lang.*;

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

    long sum = 1;
    long [] c = new long[a];
    for (int i=0;i<a;i++){
      long b = scan.nextLong();
      if (b==0){
        System.out.println(0);
        return;
      }
      c[i] = b;
    }

    for (int j=0;j<a;j++){
      if (Math.log10(sum)+Math.log10(c[j])>18){
        System.out.println(-1);
        return;
      }
      sum*=c[j];
    }
    System.out.println(sum);
  }
}


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

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

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

    int sum = 1;
    for (int i=0;i<a;i++){
      int b = scan.nextInt();
      if (b==0){
        System.out.println("0");
        return;
      }
      sum*=b;
    }
    int limit = Math.pow(10,18);
    if (sum>limit){
      System.out.println("-1");
      return;
    }
    System.out.println(sum);
  }
}


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

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

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int sum = 1;
    for (int i=0;i<a;i++){
      int b = scan.nextInt();
      sum*=b;
    }
    if (sum>Math.pow(18)){
      System.out.println("-1");
      return;
    }
    System.out.println(sum);
  }
}


Compiler output:
Main.java:13: error: method pow in class Math cannot be applied to given types;
    if (sum>Math.pow(18)){
                ^
  required: double,double
  found:    int
  reason: actual and formal argument lists differ in length
1 error
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int sum = 1;
    for (int i=0;i<a;i++){
      int b = scan.nextInt();
      sum*=b;
    }
    if (sum>math.pow(18)){
      System.out.println("-1");
      return;
    }
    System.out.println(sum);
  }
}


Compiler output:
Main.java:12: error: cannot find symbol
    if (sum>math.pow(18)){
            ^
  symbol:   variable math
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int sum = 1;
    for (i=0;i<a;i++){
      int b = scan.nextInt();
      sum*=b;
    }
    if (sum>math.pow(18)){
      System.out.println("-1");
      return;
    }
    System.out.println(sum);
  }
}


Compiler output:
Main.java:8: error: cannot find symbol
    for (i=0;i<a;i++){
         ^
  symbol:   variable i
  location: class Main
Main.java:8: error: cannot find symbol
    for (i=0;i<a;i++){
             ^
  symbol:   variable i
  location: class Main
Main.java:8: error: cannot find symbol
    for (i=0;i<a;i++){
                 ^
  symbol:   variable i
  location: class Main
Main.java:12: error: cannot find symbol
    if (sum>math.pow(18)){
            ^
  symbol:   variable math
  location: class Main
4 errors
Language: C++

#include<bits/stdc++.h>
#define ll long long

using namespace std;

int main()
{
    int n;
    ll x,zb = 1;
    cin >> n;

    vector<ll> V;
    for(int i=0;i<n;i++)
    {
        cin >> x;
        V.push_back(x);
        if(x == 0)
        {
            cout << 0 << endl;
            return;
        }
    }

    for(int i=0;i<n;i++)
    {
        x = V[i];
        if(1000000000000000000> zb)
        {
            cout << -1;
            return 0;
        }
        zb *= x;
    }

    cout << zb;
    return 0;
}


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

#include<bits/stdc++.h>
#define ll long long

using namespace std;

int main()
{
    int n;
    llx,zb = 1;
    cin >> n;

    vector<ll> V;
    for(int i=0;i<n;i++)
    {
        cin >> x;
        V.push_back(x);
        if(x == 0)
        {
            cout << 0 << endl;
            return;
        }
    }

    for(int i=0;i<n;i++)
    {
        x = V[i];
        if(1000000000000000000> zb)
        {
            cout << -1;
            return 0;
        }
        zb *= x;
    }

    cout << zb;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'llx' was not declared in this scope; did you mean 'll'?
    9 |     llx,zb = 1;
      |     ^~~
      |     ll
a.cc:9:9: error: 'zb' was not declared in this scope
    9 |     llx,zb = 1;
      |         ^~
a.cc:15:16: error: 'x' was not declared in this scope
   15 |         cin >> x;
      |                ^
a.cc:20:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   20 |             return;
      |             ^~~~~~
a.cc:26:9: error: 'x' was not declared in this scope
   26 |         x = V[i];
      |         ^
Language: C++

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

int main(){
  int N, kazu, result;
  cin >> N;
  
  for(int i = 0; i < N; i++){
    cin >> kazu.at(i);
  }
  
   for(int i = 0; i < N; i++){
    
  }
  
  
  
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: request for member 'at' in 'kazu', which is of non-class type 'int'
    9 |     cin >> kazu.at(i);
      |                 ^~
a.cc:14:4: error: expected '}' at end of input
   14 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using in6 = int64_t;
using ind = double;
using pii = pair<int,int>;
using psi = pair<string,int>;
using vpi = vector<pii>;
using vps = vector<psi>;
#define rep(i, n) for (in6 i = 0; i < (in6)(n); i++)
#define repa(i,a,n) for(in6 i = a; i < (in6)(n); i++)
#define repdown(i,n) for(in6 i = n; i > 0; i--)
#define kyun ios::sync_with_stdio(false)
#define hinata cout << "\n"
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define inf 2147483647
#define dset(n) cout << fixed << setprecision(n)

void yes() {
  cout << "Yes";
}

void no() {
  cout << "No";
}

int main() {
  kyun;
  in6 n;
  cin >> n;
  vi data(n);
  bool zero = 0;
  rep(i,n) {
    in6 a;
    cin >> a;
    if(a == 0) zero = 1;
    data.pb(a);
  }
  if(zero) cout << 0;
  in6 ans = 1;
  else {
    rep(i,n) {
      ans *= data[i];
      if(ans > pow(10,18)) {
        ans = -1;
        break;
      }
    }
    cout << ans;
  }
  hinata;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:3: error: 'else' without a previous 'if'
   44 |   else {
      |   ^~~~
Language: C++

#include <math.h>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
	int n = 0;
	cin >> n;
	long long res = 1;
	long long max = pow(10, 18);
	vector <long long> vect(n);
	for (int i = 0; i < n; i++)
	{
		cin >> vect[i];
	}
	sort(vect.begin(), vect.end());
	if (vect[0] == 0)
	{
		cout << "0" << endl;
		return 0;
	}
	else
	{
		for (int i = 0; i < n; i++)
		{
			res = res * vect[i];
			if (res > max)
			{
				cout << "-1" << endl;
				return 0;
			}
		}
	}
	cout << res << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin >> n;
      |         ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <algorithm>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:19:17: error: 'cout' was not declared in this scope
   19 |                 cout << "0" << endl;
      |                 ^~~~
a.cc:19:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:32: error: 'endl' was not declared in this scope
   19 |                 cout << "0" << endl;
      |                                ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include <algorithm>
  +++ |+#include <ostream>
    4 | using namespace std;
a.cc:29:33: error: 'cout' was not declared in this scope
   29 |                                 cout << "-1" << endl;
      |                                 ^~~~
a.cc:29:33: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:29:49: error: 'endl' was not declared in this scope
   29 |                                 cout << "-1" << endl;
      |                                                 ^~~~
a.cc:29:49: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:34:9: error: 'cout' was not declared in this scope
   34 |         cout << res << endl;
      |         ^~~~
a.cc:34:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:24: error: 'endl' was not declared in this scope
   34 |         cout << res << endl;
      |                        ^~~~
a.cc:34:24: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

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

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



  



Compiler output:
a.cc:7:1: error: expected ',' or ';' before 'int'
    7 | int main() {
      | ^~~
Language: C++

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

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



  



Compiler output:
a.cc:24:17: warning: multi-character character constant [-Wmultichar]
   24 |   if(ng) cout <<'-1' <<endl;
      |                 ^~~~
a.cc:7:1: error: expected ',' or ';' before 'int'
    7 | int main() {
      | ^~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
const long long int INF = 1e18;
int main()
{
    long long int result = 1;
    bool flag = true;
    int n; cin >> n;
    vector< long long int > v(n);
    for(int i=0;i<n;i++) cin >> v[i];

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

    long long int result = 1;
    for(int x : v)
    {
        result*=x;
        if(result>INF)
        {
            result=-1;
            break;
        }
    }


    cout << result << endl;

    #ifdef TarekHasan
        main();
    #endif // TarekHasan

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |     sort(v.begin(),v.end());
      |     ^~~~
      |     short
a.cc:15:19: error: redeclaration of 'long long int result'
   15 |     long long int result = 1;
      |                   ^~~~~~
a.cc:7:19: note: 'long long int result' previously declared here
    7 |     long long int result = 1;
      |                   ^~~~~~
Language: C++

#include<bits/stdc++.h>
#define     ll          long long
#define     MOD         10e9+7
#define     pb          push_back
#define     vll         vector<long long>
#define     vi          vector<int>
#define     vl          vector<long>
#define     pii         pair<int, int>
#define     pll         pair<ll,ll>
#define     mp          make_pair
#define     all(a)      (a).begin(),(a).end()
#define     rep(i,a,b)  for(int i=a;i<b;i++)
#define     MAX         100002 
#define     ios	      ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;



int main() {
    
    ios
    long double n,m=1,zero=0;
    cin >> n;
    v<long double> a(n);
    for(ll i=0;i<n;i++){
        cin >> a[i];
        if(a[i]==0)zero++;
    }
    if(zero)cout << "0\n";
    else{  
        for(ll i=0;i<n;i++){
            if(m*a[i]<=1000000000000000000)m*=a[i];    
            else{
                cout << "-1\n";
                return 0;
            }
        }
        cout << m << "\n";    

    }
    

    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: 'v' was not declared in this scope
   24 |     v<long double> a(n);
      |     ^
a.cc:24:7: error: expected primary-expression before 'long'
   24 |     v<long double> a(n);
      |       ^~~~
a.cc:26:16: error: 'a' was not declared in this scope
   26 |         cin >> a[i];
      |                ^
a.cc:32:18: error: 'a' was not declared in this scope
   32 |             if(m*a[i]<=1000000000000000000)m*=a[i];
      |                  ^
Language: C++

#include<bits/stdc++.h>
#define     ll          long long
#define     MOD         10e9+7
#define     pb          push_back
#define     vll         vector<long long>
#define     vi          vector<int>
#define     vl          vector<long>
#define     pii         pair<int, int>
#define     pll         pair<ll,ll>
#define     mp          make_pair
#define     all(a)      (a).begin(),(a).end()
#define     rep(i,a,b)  for(int i=a;i<b;i++)
#define     MAX         100002 
#define     ios	      ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;



int main() {
    
    ios
    long long double n,m=1,check=0,zero=0;
    cin >> n;
    vll a(n);
    for(ll i=0;i<n;i++){
        cin >> a[i];
        if(a[i]==0)zero++;
    }
    if(zero)cout << "0\n";
    else{  
        for(ll i=0;i<n;i++){
            if(m*a[i]<=1000000000000000000)m*=a[i];    
            else{
                cout << "-1\n";
                return 0;
            }
        }
        cout << m << "\n";    

    }
    

    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: 'long long' specified with 'double'
   22 |     long long double n,m=1,check=0,zero=0;
      |          ^~~~
a.cc:22:10: error: 'long long' specified with 'double'
a.cc:22:10: error: 'long long' specified with 'double'
a.cc:22:10: error: 'long long' specified with 'double'
Language: C++

int c;
    cin >> c;
    unsigned long long a = 1;
    int t;
    for (int i =0; i < c; i++){
        cin>> t  ;
        a *= t;
    }
    if ( a <= pow(10,18))  cout << a;
    else cout << "-1";

Compiler output:
a.cc:2:5: error: 'cin' does not name a type
    2 |     cin >> c;
      |     ^~~
a.cc:5:5: error: expected unqualified-id before 'for'
    5 |     for (int i =0; i < c; i++){
      |     ^~~
a.cc:5:20: error: 'i' does not name a type
    5 |     for (int i =0; i < c; i++){
      |                    ^
a.cc:5:27: error: 'i' does not name a type
    5 |     for (int i =0; i < c; i++){
      |                           ^
a.cc:9:5: error: expected unqualified-id before 'if'
    9 |     if ( a <= pow(10,18))  cout << a;
      |     ^~
a.cc:10:5: error: expected unqualified-id before 'else'
   10 |     else cout << "-1";
      |     ^~~~
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(double 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;
    double arr[n], res=1;

    loop(i, 1, n){
        cin>>arr[i];
        res = res * arr[i];
    }

    if(res <= 1e18)
        cout<<res;
    else
        cout<<"-1";


}





























Compiler output:
a.cc: In function 'int main()':
a.cc:32:17: error: invalid types 'double [n][double]' for array subscript
   32 |         cin>>arr[i];
      |                 ^
a.cc:33:24: error: invalid types 'double [n][double]' for array subscript
   33 |         res = res * arr[i];
      |                        ^
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(double 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;

    double n;

    cin>>n;
    double arr[n], res=1;

    loop(i, 1, n){
        cin>>arr[i];
        res = res * arr[i];
    }

    if(res <= 1e18)
        cout<<res;
    else
        cout<<"-1";


}





























Compiler output:
a.cc: In function 'int main()':
a.cc:29:16: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   29 |     double arr[n], res=1;
      |                ^
a.cc:29:16: error: could not convert 'n' from 'double' to 'long unsigned int'
   29 |     double arr[n], res=1;
      |                ^
      |                |
      |                double
a.cc:29:16: error: size of array 'arr' has non-integral type 'double'
a.cc:32:17: error: invalid types 'double [1][double]' for array subscript
   32 |         cin>>arr[i];
      |                 ^
a.cc:33:24: error: invalid types 'double [1][double]' for array subscript
   33 |         res = res * arr[i];
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
  int sum=1;
  cin>>a;
  while(a--){
  cin>>b;
    sum*=b;
  }
  if(sum>pow(10.0,18.0) 
     cout<<"-1";
  else 
     cout<<sum;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: expected ';' before 'cout'
   11 |   if(sum>pow(10.0,18.0)
      |                        ^
      |                        ;
   12 |      cout<<"-1";
      |      ~~~~               
a.cc:13:3: error: expected primary-expression before 'else'
   13 |   else
      |   ^~~~
a.cc:12:17: error: expected ')' before 'else'
   12 |      cout<<"-1";
      |                 ^
      |                 )
   13 |   else
      |   ~~~~           
a.cc:11:5: note: to match this '('
   11 |   if(sum>pow(10.0,18.0)
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
  int sum=1;
  cin>>a;
  while(a--){
  cin>>>b;
    sum*=b;
  }
  if(sum>pow(10.0,18.0) )
     cout<<"-1";
  else 
     cout<<sum;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: expected primary-expression before '>' token
    8 |   cin>>>b;
      |        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
  int sum=1;
  cin>>a;
  while(a--){
  cin>>b;
    sum*=b;
  }
  if(sum>pow(10.0,18.0) cout<<"-1";
  else cout<<sum;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: expected ';' before 'cout'
   11 |   if(sum>pow(10.0,18.0) cout<<"-1";
      |                        ^~~~~
      |                        ;
a.cc:12:3: error: expected primary-expression before 'else'
   12 |   else cout<<sum;
      |   ^~~~
a.cc:11:36: error: expected ')' before 'else'
   11 |   if(sum>pow(10.0,18.0) cout<<"-1";
      |     ~                              ^
      |                                    )
   12 |   else cout<<sum;
      |   ~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
  int sum=1;
  cin>>a;
  while(a--){
  cin>>>b;
    sum*=b;
  }
  if(sum>pow(10.0,18.0) cout<<"-1";
  else cout<<sum;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: expected primary-expression before '>' token
    8 |   cin>>>b;
      |        ^
a.cc:11:24: error: expected ';' before 'cout'
   11 |   if(sum>pow(10.0,18.0) cout<<"-1";
      |                        ^~~~~
      |                        ;
a.cc:12:3: error: expected primary-expression before 'else'
   12 |   else cout<<sum;
      |   ^~~~
a.cc:11:36: error: expected ')' before 'else'
   11 |   if(sum>pow(10.0,18.0) cout<<"-1";
      |     ~                              ^
      |                                    )
   12 |   else cout<<sum;
      |   ~~~~