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

#include<iostream>
#include<math.h>
using namespace std;

int main(){
  int N;
  cin >> N;
  int A[N];
  for(int i=0;i<N;i++){
    cin >> A[i];
  }
  
  flag = false;
  
  for(int i=0;i<N;i++){
    if(A[i] == 0){
      cout << "0" << endl;
      flag_0 = true;
    }
  }
  
  unsigned long long mul = 1;
  bool flag = false;
  
  if(!flag_0){
    for(int i=0;i<N;i++){
      if(mul>=1e18/A[i]){
        flag = true;
        break;
      }else{
        mul*=A[i];
      }
    }
    if(flag) cout << "-1" << endl;
    else cout << mul << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'flag' was not declared in this scope
   13 |   flag = false;
      |   ^~~~
a.cc:18:7: error: 'flag_0' was not declared in this scope
   18 |       flag_0 = true;
      |       ^~~~~~
a.cc:25:7: error: 'flag_0' was not declared in this scope
   25 |   if(!flag_0){
      |       ^~~~~~
Language: C++

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

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

}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: expected primary-expression before '>' token
   14 |         if(ans => 1000000000000000000){
      |                 ^
Language: C++

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

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

}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: expected ',' or ';' before 'for'
   12 |     for(int i =0;i < n;i++){
      |     ^~~
a.cc:12:18: error: 'i' was not declared in this scope
   12 |     for(int i =0;i < n;i++){
      |                  ^
Language: C++

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

int main (){
    int n = 0;
    cin >> n;
    vector<int> a(n);
    for(int i=0;i < n;i++){
        cin >> a.at(i);
    }
    int ans = a.at(0)
    for(int i =0;i < n;i++){
        ans *= a.at(i);
        if(ans => 1000000000000000000){
            cout << '-1' << endl;
            return 0;
        }
    }
    cout << ans << endl;
    return 0;

}


Compiler output:
a.cc:15:21: warning: multi-character character constant [-Wmultichar]
   15 |             cout << '-1' << endl;
      |                     ^~~~
a.cc: In function 'int main()':
a.cc:12:5: error: expected ',' or ';' before 'for'
   12 |     for(int i =0;i < n;i++){
      |     ^~~
a.cc:12:18: error: 'i' was not declared in this scope
   12 |     for(int i =0;i < n;i++){
      |                  ^
Language: C++

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

int main {
    int n = 0;
    cin >> n;
    vector<int> a(n);
    for(int i=0;i < n;i++){
        cin >> a.at(i);
    }
    int ans = a.at(0)
    for(int i =0;i < n;i++){
        ans *= a.at(i);
        if(ans => 1000000000000000000){
            cout << '-1' << endl;
            return 0;
        }
    }
    cout << ans << endl;
    return 0;

}


Compiler output:
a.cc:15:21: warning: multi-character character constant [-Wmultichar]
   15 |             cout << '-1' << endl;
      |                     ^~~~
a.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main {
      |     ^~~~
a.cc:5:5: error: expected primary-expression before 'int'
    5 |     int n = 0;
      |     ^~~
a.cc:5:5: error: expected '}' before 'int'
a.cc:4:10: note: to match this '{'
    4 | int main {
      |          ^
a.cc:6:5: error: 'cin' does not name a type
    6 |     cin >> n;
      |     ^~~
a.cc:7:19: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |     vector<int> a(n);
      |                   ^
      |                   yn
a.cc:8:5: error: expected unqualified-id before 'for'
    8 |     for(int i=0;i < n;i++){
      |     ^~~
a.cc:8:17: error: 'i' does not name a type
    8 |     for(int i=0;i < n;i++){
      |                 ^
a.cc:8:23: error: 'i' does not name a type
    8 |     for(int i=0;i < n;i++){
      |                       ^
a.cc:12:5: error: expected ',' or ';' before 'for'
   12 |     for(int i =0;i < n;i++){
      |     ^~~
a.cc:12:18: error: 'i' does not name a type
   12 |     for(int i =0;i < n;i++){
      |                  ^
a.cc:12:24: error: 'i' does not name a type
   12 |     for(int i =0;i < n;i++){
      |                        ^
a.cc:19:5: error: 'cout' does not name a type
   19 |     cout << ans << endl;
      |     ^~~~
a.cc:20:5: error: expected unqualified-id before 'return'
   20 |     return 0;
      |     ^~~~~~
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
  int n; cin >> n;
  int64 a[n];
  for(int i = 0; i < n; i++)
    cin >> a[i];
  
  __int128_t res = 1, inf = 3e15;
  for(ll i = 0; i < n; i++)
  {
    res *= a[i];
    if(a[i] == 0)
      return !(cout << 0 << endl);
    
    if(res > (1e18))
      return !(cout << -1 << endl);
  }
  
  cout << (int64) res << endl;
  return 0;
}
    
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'int64' was not declared in this scope
    8 |   int64 a[n];
      |   ^~~~~
a.cc:10:12: error: 'a' was not declared in this scope
   10 |     cin >> a[i];
      |            ^
a.cc:13:7: error: 'll' was not declared in this scope
   13 |   for(ll i = 0; i < n; i++)
      |       ^~
a.cc:13:17: error: 'i' was not declared in this scope
   13 |   for(ll i = 0; i < n; i++)
      |                 ^
a.cc:15:12: error: 'a' was not declared in this scope
   15 |     res *= a[i];
      |            ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#typedef unsigned long long ll;

int main()
{
  ll n; cin >> n;
  bool flg = true;
  ll m = 1;
  for(int i = 0; i < n; i++)
  {
    ll x; cin >> x;
    m *= x;
    if(m > ll(1e18))
      flg = false;
  }
  if(flg)
    cout << m << endl;
  else cout << -1 << endl;
  return 0;
}

Compiler output:
a.cc:5:2: error: invalid preprocessing directive #typedef
    5 | #typedef unsigned long long ll;
      |  ^~~~~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'll' was not declared in this scope
    9 |   ll n; cin >> n;
      |   ^~
a.cc:9:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |   ll n; cin >> n;
      |                ^
      |                yn
a.cc:11:5: error: expected ';' before 'm'
   11 |   ll m = 1;
      |     ^~
      |     ;
a.cc:14:7: error: expected ';' before 'x'
   14 |     ll x; cin >> x;
      |       ^~
      |       ;
a.cc:14:18: error: 'x' was not declared in this scope
   14 |     ll x; cin >> x;
      |                  ^
a.cc:15:5: error: 'm' was not declared in this scope
   15 |     m *= x;
      |     ^
a.cc:20:13: error: 'm' was not declared in this scope; did you mean 'tm'?
   20 |     cout << m << endl;
      |             ^
      |             tm
Language: C++

#include <bis/stdc++.h>

using namespace std;

#typedef unsigned long long ll;

int main()
{
  ll n; cin >> n;
  bool flg = true;
  ll m = 1;
  for(int i = 0; i < n; i++)
  {
    ll x; cin >> x;
    m *= x;
    if(m > ll(1e18))
      flg = false;
  }
  if(flg)
    cout << m << endl;
  else cout << -1 << endl;
  return 0;
}

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

#include<bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define repo(i, n) for(int i=1; i<=n; i++)
#define INF 1001001001
#define INFll 100100100100100
// debug用
#define PrintVec(x) for (auto elementPrintVec: x) { cout << elementPrintVec << " "; } cout << endl;

using namespace std;
using ull = unsigned long long;
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;

int main(){
  int n;
  cin >> n;
  vector<ull> a(n);
  ull ans=1, MX=1e18;
  rep(i, n){
    cin >> a[i];
    if(a[i]==0){
      cout << "0" << endl;
      return 0;
    }
  }
  rep(i, n){
    if(ans>MX/a[i] || ans*a[i]>MX){
      cout << "-1" << endl;
      return 0;
    } else{
      ans*=a[i]
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:16: error: expected ';' before '}' token
   32 |       ans*=a[i]
      |                ^
      |                ;
   33 |     }
      |     ~
Language: C++

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

int main(){
  long long int   N;
  string S;
  cin >> N;
  ventor<long long int> A(N);
  for(long long int i = 0; i < N; i++) cin >> A[i];
  
  for(long long int i = 0; i < N; i++){
    if(A[i] == 0){
      cout << 0 << endl;
      return 0;
    }
  }
  
  long long int prod = 1;
  for(long long int i = 0; i < N; i++){
    if(A[i] < 1000000000000000000 / prod) prod *= A[i];
    else {
      cout << -1 << endl;
      return 0;
    }
  }
  
  cout << prod << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'ventor' was not declared in this scope
    8 |   ventor<long long int> A(N);
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'long'
    8 |   ventor<long long int> A(N);
      |          ^~~~
a.cc:9:47: error: 'A' was not declared in this scope
    9 |   for(long long int i = 0; i < N; i++) cin >> A[i];
      |                                               ^
a.cc:12:8: error: 'A' was not declared in this scope
   12 |     if(A[i] == 0){
      |        ^
a.cc:20:8: error: 'A' was not declared in this scope
   20 |     if(A[i] < 1000000000000000000 / prod) prod *= A[i];
      |        ^
Language: C++


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

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

  vector<long long> vec(N);

  for (int i = 0; i < N; i++){ 
    cin >> vec.at(i);
    if (vec.at(i) == 0){
      cout << 0 << endl;
      return 0;
    }

  }

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

  long long multi = 1;

  for (int i = 0; i < N; i++){
    multi *= vec.at(i);
    else if (multi / 1000000000000000000)
    {
      cout << "-1" << endl;
      return 0;
    }
  }

  cout << multi << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: 'else' without a previous 'if'
   28 |     else if (multi / 1000000000000000000)
      |     ^~~~
Language: C++

v#include <bits/stdc++.h>
#define rep(i,N) for (int i = 0; i < (N); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(void){
  int N;
  cin >> N;
  vector <ll> A(N);
  rep(i,N) cin >> A.at(i);

  ll prod = 1;

  for (int i : A){
    if (i == 0) cout << 0 << endl;
    return 0;
  }

  rep(i,N) {
    if (A.at(i) <= 1000000000000000000 / prod){
      prod *= A.at(i);
    }else{
      cout << -1 << endl;
      return 0;
    }
  }
  cout << prod << endl;
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include <bits/stdc++.h>
      | ^
a.cc:6:11: error: 'pair' does not name a type
    6 | using P = pair<int, int>;
      |           ^~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin >> N;
      |   ^~~
a.cc:10:3: error: 'vector' was not declared in this scope
   10 |   vector <ll> A(N);
      |   ^~~~~~
a.cc:10:13: error: expected primary-expression before '>' token
   10 |   vector <ll> A(N);
      |             ^
a.cc:10:15: error: 'A' was not declared in this scope
   10 |   vector <ll> A(N);
      |               ^
a.cc:16:17: error: 'cout' was not declared in this scope
   16 |     if (i == 0) cout << 0 << endl;
      |                 ^~~~
a.cc:16:30: error: 'endl' was not declared in this scope
   16 |     if (i == 0) cout << 0 << endl;
      |                              ^~~~
a.cc:24:7: error: 'cout' was not declared in this scope
   24 |       cout << -1 << endl;
      |       ^~~~
a.cc:24:21: error: 'endl' was not declared in this scope
   24 |       cout << -1 << endl;
      |                     ^~~~
a.cc:28:3: error: 'cout' was not declared in this scope
   28 |   cout << prod << endl;
      |   ^~~~
a.cc:28:19: error: 'endl' was not declared in this scope
   28 |   cout << prod << endl;
      |                   ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,N) for (int i = 0; i < (N); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(void){
  int N;
  cin >> N;
  vector <ll> A(N);
  rep(i,N) cin >> A.at(i);

  ll prod = 1;

  for (i : A){
    if (i == 0) cout << 0 << endl;
    return 0;
  }

  rep(i,N) {
    if (A.at(i) <= 1000000000000000000 / prod){
      prod *= A.at(i);
    }else{
      cout << -1 << endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: found ':' in nested-name-specifier, expected '::'
   15 |   for (i : A){
      |          ^
      |          ::
a.cc:15:8: error: 'i' has not been declared
   15 |   for (i : A){
      |        ^
a.cc:2:18: error: expected primary-expression before 'for'
    2 | #define rep(i,N) for (int i = 0; i < (N); ++i)
      |                  ^~~
a.cc:20:3: note: in expansion of macro 'rep'
   20 |   rep(i,N) {
      |   ^~~
a.cc:18:4: error: expected ';' before 'for'
   18 |   }
      |    ^
      |    ;
a.cc:2:18: error: expected primary-expression before 'for'
    2 | #define rep(i,N) for (int i = 0; i < (N); ++i)
      |                  ^~~
a.cc:20:3: note: in expansion of macro 'rep'
   20 |   rep(i,N) {
      |   ^~~
a.cc:18:4: error: expected ')' before 'for'
   18 |   }
      |    ^
      |    )
a.cc:15:7: note: to match this '('
   15 |   for (i : A){
      |       ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,N) for (int i = 0; i < (N); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(void){
  int N;
  cin >> N;
  vector <ll> A(N);
  rep(i,N) cin >> A.at(i);

  ll ans = 1;
  bool outAns = true;
  rep(i,N) {
    ans *= A.at(i);
    if (ans > 1000000000000000000){
      cout << -1 << endl;
      outAns = false;
      break;
    }
  }
  if (outAns) cout << ans << endl;
  }

}


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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
 int N;
 cin N;
 vector<long long>V(N);
 bool zero=false;
 bool big=false;
 long double sum;
 int res;
 rep(i,N){
   cin>>V[i];
   if(V[i]==0){
     zero==true;
   }
 }
 if(zero)cout<<0<<endl;
 sum+=V[0]; 

 for(int i=1;i<N;i++){
  sum*=V[i];
  if(sum>100000000000000000){
    big=true;
    break;
  }
 }
 if(sum){
   cout<<"-1"<<endl;
 }
 else {
   res=sum;
   cout<<ans<<endl;
 }
 }



Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected ';' before 'N'
    6 |  cin N;
      |     ^~
      |     ;
a.cc:33:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |    cout<<ans<<endl;
      |          ^~~
      |          abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
 int N;
 cin N;
 vector<long long>V(N);
 bool zero=false;
 bool big=false;
 long double sum;
 int res;
 rep(i,n){
   cin>>V[i]
   if(V[i]==0){
     zero==true;
   }
 }
 if(zero)cout<<0<<endl;
 sum+=V[0]; 

 for(int i=1;i<N;i++){
  sum*=V[i];
  if(sum>100000000000000000){
    big=true;
    break;
  }
 }
 if(sum){
   cout<<"-1"<<endl;
 }
 else {
   res=sum;
   cout<<ans<<endl;
 }
 }



Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected ';' before 'N'
    6 |  cin N;
      |     ^~
      |     ;
a.cc:12:8: error: 'n' was not declared in this scope
   12 |  rep(i,n){
      |        ^
a.cc:3:45: note: in definition of macro 'rep'
    3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                                             ^
a.cc:13:13: error: expected ';' before 'if'
   13 |    cin>>V[i]
      |             ^
      |             ;
   14 |    if(V[i]==0){
      |    ~~        
a.cc:33:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |    cout<<ans<<endl;
      |          ^~~
      |          abs
Language: C++

N = int(input())
i = 0
ans = 1
for i < 0:
    a = int(input())
    ans = ans*a
    i = i+1
if ans > 1000000000000000000:
    print(-1)
else:
    print(ans)

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  ll arr[n];
  ll ans = 1;
  bool t = 1;
  for (int i = 0;i<n;i++){
    cin >> arr[i];
    if (arr[i]==0){
      ans = 0;
      break;
    }
    else if (arr[i]*ans<=1e18)
      ans*=arr[i];
    else{
      t = 0;
      ans = -1;
      break;
    }
	cout << ans << '\n';
}

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

#include<stdio.h>
int main(void)
{
	long long int i,x=1,N,A[100001];
	
	scanf("%lld",&N);
	
	for(i=0;i<N;i++){
		scanf("%lld",&A[i]);
	}
	
	for(i=0;i<N;i++){
		if(A[i]==0){
			x=0;
            continue;
		}
		
		else{
			x=x*A[i];
		}
	}
	
	if(x/powl(10,18)>1){
		puts("-1");
	}
	else{
		printf("%lld",x);
	}
	
	return 0;

Compiler output:
main.c: In function 'main':
main.c:23:14: error: implicit declaration of function 'powl' [-Wimplicit-function-declaration]
   23 |         if(x/powl(10,18)>1){
      |              ^~~~
main.c:2:1: note: include '<math.h>' or provide a declaration of 'powl'
    1 | #include<stdio.h>
  +++ |+#include <math.h>
    2 | int main(void)
main.c:23:14: warning: incompatible implicit declaration of built-in function 'powl' [-Wbuiltin-declaration-mismatch]
   23 |         if(x/powl(10,18)>1){
      |              ^~~~
main.c:23:14: note: include '<math.h>' or provide a declaration of 'powl'
main.c:30:9: error: expected declaration or statement at end of input
   30 |         return 0;
      |         ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define ret return
using namespace std;
int main() {
	int n;cin>>n;
	ll seq[n];
	memset(seq,0ll, sizeof(seq));
	ll num;
	for(int i=0;i<n;i++){
		cin>>num;
		if(num==0ll) {
			cout<<
		}
		seq[i]=num;
		
	}
	ll product=seq[0];
	for(int i=1;i<n;i++){
		product*=seq[i];
		if(product>(ll)1e18||product<(ll)0)  {
			cout<<-1<<endl;
			ret 0;
		}
	}
	cout<<product<<endl;
	ret 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: expected primary-expression before '}' token
   15 |                 }
      |                 ^
Language: Java

import java.util.*;

public class Main {
  
  public static void main(String[] args) {
    
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long[] A = new long[N];
    long sum = 1;
    
    for (int i = 0; i < N; i++) {
      A[i] = sc.nextLong();
      if (A[i] == 0) {
        sum = 0;
        break;
      } else if (a[i] > (1000000000000000000L / sum)) {
        sum = -1;
      } else {
        sum *= A[i];
      }
    } 
      System.out.println(sum);
                 
      sc.close();
  }
}


Compiler output:
Main.java:17: error: cannot find symbol
      } else if (a[i] > (1000000000000000000L / sum)) {
                 ^
  symbol:   variable a
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main {
  
  public static void main(String[] args) {
    
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long[] A = new long[N];
    long sum = 1;
    
    for (int i = 0; i < N; i++) {
      A[i] = sc.nextLong();
      if (A[i] == 0) {
        sum = 0;
        break;
      } else if (a[i] > (1000000000000000000L / sum) {
        sum = -1;
      } else {
        sum *= A[i];
      }
    } 
      System.out.println(sum);
                 
      sc.close();
  }
}


Compiler output:
Main.java:17: error: ')' expected
      } else if (a[i] > (1000000000000000000L / sum) {
                                                    ^
1 error
Language: Java

import java.util.*;

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


Compiler output:
Main.java:17: error: cannot find symbol
        sum *= a[i];
               ^
  symbol:   variable a
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long[] A = new long[N];
    long sum = 0;
    for (long i = 0; i < N; i++) {
      A[i] = sc.nextLong();
      if (i == 0) {
        sum = A[i];
      } else {
        sum = sum * A[i];
      }
    }
    if (sum <= 1000000000000000000L) {
      System.out.println(sum);
    } else {
      System.out.println("-1");
    }
  }
}


Compiler output:
Main.java:7: error: incompatible types: possible lossy conversion from long to int
    long[] A = new long[N];
                        ^
Main.java:10: error: incompatible types: possible lossy conversion from long to int
      A[i] = sc.nextLong();
        ^
Main.java:12: error: incompatible types: possible lossy conversion from long to int
        sum = A[i];
                ^
Main.java:14: error: incompatible types: possible lossy conversion from long to int
        sum = sum * A[i];
                      ^
4 errors
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long[] A = new long[N];
    int sum = 0;
    for (i = 0; i < N; i++) {
      A[i] = sc.nextLong();
      if (i == 0) {
        sum = A[i];
      } else {
        sum = sum * A[i];
      }
    }
    if (sum <= 1000000000000000000L) {
      System.out.println(sum);
    } else {
      System.out.println("-1");
    }
  }
}


Compiler output:
Main.java:7: error: incompatible types: possible lossy conversion from long to int
    long[] A = new long[N];
                        ^
Main.java:9: error: cannot find symbol
    for (i = 0; i < N; i++) {
         ^
  symbol:   variable i
  location: class Main
Main.java:9: error: cannot find symbol
    for (i = 0; i < N; i++) {
                ^
  symbol:   variable i
  location: class Main
Main.java:9: error: cannot find symbol
    for (i = 0; i < N; i++) {
                       ^
  symbol:   variable i
  location: class Main
Main.java:10: error: cannot find symbol
      A[i] = sc.nextLong();
        ^
  symbol:   variable i
  location: class Main
Main.java:11: error: cannot find symbol
      if (i == 0) {
          ^
  symbol:   variable i
  location: class Main
Main.java:12: error: cannot find symbol
        sum = A[i];
                ^
  symbol:   variable i
  location: class Main
Main.java:12: error: incompatible types: possible lossy conversion from long to int
        sum = A[i];
               ^
Main.java:14: error: cannot find symbol
        sum = sum * A[i];
                      ^
  symbol:   variable i
  location: class Main
Main.java:14: error: incompatible types: possible lossy conversion from long to int
        sum = sum * A[i];
                  ^
10 errors
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long[] A = new long[N];
    int sum = 0
    for (i = 0; i < N; i++) {
      A[i] = sc.nextLong();
      if (i == 0) {
        sum = A[i];
      } else {
        sum = sum * A[i];
      }
    }
    if (sum <= 1000000000000000000L) {
      System.out.println(sum);
    } else {
      System.out.println("-1");
    }
  }
}


Compiler output:
Main.java:8: error: ';' expected
    int sum = 0
               ^
1 error
Language: C

#include <stdio.h>

int main(void){
  int n;
  long long a[100005];
  
  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;
  }
  long long prod = 1;
  for(int i=0;i<n;i++){
    if(a[i] <= 1000000000000000000/prod){
      prod *=a[i];
    }else{
      printf("-1\n");
      return 0;
    }
    
    

}


Compiler output:
main.c: In function 'main':
main.c:29:1: error: expected declaration or statement at end of input
   29 | }
      | ^
Language: C++

#include<bits/stdc++.h>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;
Bint INF = 1e18;
int main() {
    int N;
    cin >> N;
    vector<Bint>A(N);
    Bint ans = 1;
    for(int i = 0; i < N; i++) {
        cin >> A[i]; 
        if(A[i] == 0) {
            cout << 0 << endl;
            return 0;
        }
    }
    for(int i = 0; i < N; i++) {
        ans *= A[i];
        if(ans > 1e18) {
            cout << -1 << endl;
            return 0;
        }
    }
    cout << ans << endl;
}

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

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

void solve()
{
    int n;
    cin >> n;

    ll s = 1;
    ll a[n];
    for(int i = 0; i<n; i++)
    {
        cin >> a[i];
        if(a[i]==0)
        {
            cout << 0 << endl;
            return ;
        }
    }
    for(int i = 0; i<n; i++)
    {
        ll c = a[i];
        s1 = s;
        s *= c;
        if(s>1e18 || s<s1)
        {
            cout << -1 << endl;
            return ;
        }
    }
    cout << s << endl;
}


int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll t;
    solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:24:9: error: 's1' was not declared in this scope; did you mean 's'?
   24 |         s1 = s;
      |         ^~
      |         s
Language: C

#include<stdio.h>
int main()
{
	int tc;
	scanf("%d",&tc);
	long long input,max = 1e18,sum = 1;
	int zero = 0, flag = 0;
	for(int i = 0;i<tc;i++)
	{
		scanf("%lld",&input);
		flag = (input > max) ? 1 : flag;
		sum *= input;
		input == 0 ? zero = 1 : max /= input;
	}
	zero == 1 ? printf("0\n") : (flag == 1) ? printf("-1\n") : printf("%lld\n",sum);
	return 0; 
}

Compiler output:
main.c: In function 'main':
main.c:13:45: error: lvalue required as left operand of assignment
   13 |                 input == 0 ? zero = 1 : max /= input;
      |                                             ^~
Language: C

#include<stdio.h>
int main()
{
	int tc;
	scanf("%d",&tc);
	long long input,max = 1e18,sum = 1;
	int zero = 0, flag = 0;
	for(int i = 0;i<tc;i++)
	{
		scanf("%lld",&input);
		flag = (input > max) ? 1 : flag;
		sum *= input;
		(input == 0) ? zero = 1 : max /= input;
	}
	(zero == 1) ? printf("0\n") : (flag == 1) ? printf("-1\n") : printf("%lld\n",sum);
	return 0; 
}

Compiler output:
main.c: In function 'main':
main.c:13:47: error: lvalue required as left operand of assignment
   13 |                 (input == 0) ? zero = 1 : max /= input;
      |                                               ^~
Language: C++


#include<bits/stdc++.h>
#define ull unsigned long long int
using namespace std;
int main()
{
    ull t;
    cin>>t;
    ull arra[t+5];
    ull  sum=1;
    ull  x=1e18;
    ull f=0;
    for(ull i=0; i<t; i++)
    {
        cin>>arra[i];
        if(arra[i]==0)
        {
            f=1;
        }
    }
    if(f==1)
        cout<<"0"<<endl;
    else
    {
        f=0;

        for(ull i=0; i<t; i++)
        {
            if(arra[i]>x) {
              cout<<"-1"<<endl;
                f=1;
                break;
            }


            sum*=arra[i];
            else if(sum>x)
            {
                cout<<"-1"<<endl;
                f=1;
                break;

            }
        }

        if(f==0)
            cout<<sum<<endl;
    }



}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:13: error: 'else' without a previous 'if'
   37 |             else if(sum>x)
      |             ^~~~
Language: C++

#include <iostream>
#include <algorithm>

const long long LIM = 1000000000000000000;

int main()
{
  int N;
  std::cin >> N;
  long long* A = new int[N];
  for (int i=0; i<N; i++) std::cin >> A[i];
  std::sort(A, A+N);
  long long res = 1;
  bool overflow = false;
  for (int i=0; i<N; i++) {
    res *= A[i];
    if (res == 0) break;
    if (res < 0 || res > LIM) {
      overflow = true; break;
    }
  }
  if (!overflow) std::cout << res << std::endl;
  else std::cout << -1 << std::endl;
  delete[] A;
  return 0;
}

  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: cannot convert 'int*' to 'long long int*' in initialization
   10 |   long long* A = new int[N];
      |                           ^
      |                           |
      |                           int*
Language: C++

#include <iostream>
#include <algorithm>

const int LIM = 1000000000000000000;

int main()
{
  int N;
  std::cin >> N;
  long long* A = new int[N];
  for (int i=0; i<N; i++) std::cin >> A[i];
  std::sort(A, A+N);
  long long res = 1;
  bool overflow = false;
  for (int i=0; i<N; i++) {
    res *= A[i];
    if (res == 0) break;
    if (res < 0 || res > LIM) {
      overflow = true; break;
    }
  }
  if (!overflow) std::cout << res << std::endl;
  else std::cout << -1 << std::endl;
  delete[] A;
  return 0;
}

  
  

Compiler output:
a.cc:4:17: warning: overflow in conversion from 'long int' to 'int' changes value from '1000000000000000000' to '-1486618624' [-Woverflow]
    4 | const int LIM = 1000000000000000000;
      |                 ^~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:27: error: cannot convert 'int*' to 'long long int*' in initialization
   10 |   long long* A = new int[N];
      |                           ^
      |                           |
      |                           int*
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:13:14: error: implicit declaration of function 'powl' [-Wimplicit-function-declaration]
   13 |         if(x<powl(10,18)){
      |              ^~~~
main.c:2:1: note: include '<math.h>' or provide a declaration of 'powl'
    1 | #include<stdio.h>
  +++ |+#include <math.h>
    2 | int main(void)
main.c:13:14: warning: incompatible implicit declaration of built-in function 'powl' [-Wbuiltin-declaration-mismatch]
   13 |         if(x<powl(10,18)){
      |              ^~~~
main.c:13:14: note: include '<math.h>' or provide a declaration of 'powl'
main.c:17:27: error: expected ';' before 'return'
   17 |                 puts("-1")
      |                           ^
      |                           ;
   18 | 
   19 |         return 0;
      |         ~~~~~~
Language: C

#include<stdio.h>
int main(void)
{
	long int N,x,i=1;
	scanf("%d",&N);
	long int A[N];
	for(i=0;i<N;i++){
		scanf("%d",&A[i]);
	}
	for(i=0;i<N;i++){
		x=x*A[i];
	}
	if(x<powl(10,18)){
		printf("%d",x);
	}
	else
		puts("-1")
			
	return 0;	
		
}

Compiler output:
main.c: In function 'main':
main.c:13:14: error: implicit declaration of function 'powl' [-Wimplicit-function-declaration]
   13 |         if(x<powl(10,18)){
      |              ^~~~
main.c:2:1: note: include '<math.h>' or provide a declaration of 'powl'
    1 | #include<stdio.h>
  +++ |+#include <math.h>
    2 | int main(void)
main.c:13:14: warning: incompatible implicit declaration of built-in function 'powl' [-Wbuiltin-declaration-mismatch]
   13 |         if(x<powl(10,18)){
      |              ^~~~
main.c:13:14: note: include '<math.h>' or provide a declaration of 'powl'
main.c:17:27: error: expected ';' before 'return'
   17 |                 puts("-1")
      |                           ^
      |                           ;
   18 | 
   19 |         return 0;
      |         ~~~~~~
Language: C

#include<stdio.h>
int main(void)
{
	long N,x=1;
	scanf("%d",&N);
	long A[N];
	for(i=0;i<N;i++){
		scanf("%d",&A[i]);
	}
	for(i=0;i<N;i++){
		x=x*A[i];
	}
	if(x<powl(10,18)){
		printf("%d",x);
	}
	else
		puts("-1")
			
	return 0;	
		
}

Compiler output:
main.c: In function 'main':
main.c:7:13: error: 'i' undeclared (first use in this function)
    7 |         for(i=0;i<N;i++){
      |             ^
main.c:7:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:14: error: implicit declaration of function 'powl' [-Wimplicit-function-declaration]
   13 |         if(x<powl(10,18)){
      |              ^~~~
main.c:2:1: note: include '<math.h>' or provide a declaration of 'powl'
    1 | #include<stdio.h>
  +++ |+#include <math.h>
    2 | int main(void)
main.c:13:14: warning: incompatible implicit declaration of built-in function 'powl' [-Wbuiltin-declaration-mismatch]
   13 |         if(x<powl(10,18)){
      |              ^~~~
main.c:13:14: note: include '<math.h>' or provide a declaration of 'powl'
main.c:17:27: error: expected ';' before 'return'
   17 |                 puts("-1")
      |                           ^
      |                           ;
   18 | 
   19 |         return 0;
      |         ~~~~~~
Language: C

#include<iostream>
#include<algorithm>
#include<vector>
#include<tuple>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<bitset>
#include<math.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    int64_t a[n];
    int i,zero=0;
    for (i=0;i<n;i++){
        cin >> a[i];
        if(a[i]==0) zero++;
    }
    if(zero>0){
        cout << 0 << endl;
        return 0;
    }
    int64_t mul=1;
    for(i=0;i<n;i++){
        if(a[i]<= (pow(10,18)/mul)){
            mul *= a[i];
        }else{
            cout << -1 << endl;
            return 0;
        }
    }
    cout << mul << endl;
}

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

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
int main(){
    int n;
    cin>>n;
    vectpr<long long>a(n);
    rep(i,n) cin>>a.at(i);
    long long ans=1;
    rep(i,n){
        if(ans<=1000000000000000000/a.at(i)) ans*=a.at(i);
        else{
            ans=-1;
            break;
        }
    }
    rep(i,n){
        if(a.at(i)==0) ans=0;
    }
    cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'vectpr' was not declared in this scope
    7 |     vectpr<long long>a(n);
      |     ^~~~~~
a.cc:7:12: error: expected primary-expression before 'long'
    7 |     vectpr<long long>a(n);
      |            ^~~~
a.cc:8:19: error: 'a' was not declared in this scope
    8 |     rep(i,n) cin>>a.at(i);
      |                   ^
a.cc:11:37: error: 'a' was not declared in this scope
   11 |         if(ans<=1000000000000000000/a.at(i)) ans*=a.at(i);
      |                                     ^
a.cc:18:12: error: 'a' was not declared in this scope
   18 |         if(a.at(i)==0) ans=0;
      |            ^
Language: C

#include<stdio.h>

int main(){
  
  int i;
  int n;
  long long a;
  long long ans = 1;
  
  scanf("%d",&n);
  
  for(i = 0; i < n; i++){
    scanf("%lld",&a);
    ans *= a;
    printf("a = %lld ans = %lld\n",a ,ans);
    
  }
    if(ans > 1000000000000000000){
    printf("-1\n");
    return 0;
  
    printf("%lld\n",ans);
    
  return 0;
        
}

Compiler output:
main.c: In function 'main':
main.c:26:1: error: expected declaration or statement at end of input
   26 | }
      | ^
Language: C

#include<stdio.h>

int main(){
	long long int n;
	scanf("%lld", &n);
	long long int num[n]={};
	long long int hsl=1;
	for(int i = 0; i < n; i++) {
		scanf("%lld", &num[i]);
	}
	
	for(int i = 0; i < n; i++){
		if (num[i]==0){
			printf("0\n");
			return 0;
		}
		
		
	}
	for (int i = 0; i < n; i++){
		if(num[i]<=1000000000000000000/hsl){
			hsl*=num[i];
		}
		else{
			printf("-1\n");
			return 0;
		}
	}
		printf("%lld"\n, hsl);
		return 0;
}

Compiler output:
main.c: In function 'main':
main.c:29:30: error: stray '\' in program
   29 |                 printf("%lld"\n, hsl);
      |                              ^
main.c:29:30: error: expected ')' before 'n'
   29 |                 printf("%lld"\n, hsl);
      |                       ~      ^~
      |                              )
Language: C

#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n], max = 1e18, a = 1, b = 0, zero = 0;
  
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    b = (arr[i] > max) ? 1 : b;
    a *= arr[i];
    (arr[i]) ? max /= arr[i] : zero = 1;
  }

  (zero) ? puts("0") : ((b) ? puts("-1") : printf("%lld\n", a));
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:37: error: lvalue required as left operand of assignment
   12 |     (arr[i]) ? max /= arr[i] : zero = 1;
      |                                     ^
Language: C++

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

int main()
{
  int N;
  cin >> N;
  vector<int64_t> A(N);
  for (int i = 0; i < N; i++)
  {
    cin >> A.at(i);
  }
  sort(A.begin(), A.end());
  int64_t ans = 1;
  for (int i = 0; i < N; i++)
  {
    int64_t a = A.at(i), prev = ans;
    ans = prev * a;
    if (ans > 1000000000000000000 || __builtin_smulll_overflow(prev, a, &ans))
    {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:73: error: invalid conversion from 'int64_t*' {aka 'long int*'} to 'long long int*' [-fpermissive]
   19 |     if (ans > 1000000000000000000 || __builtin_smulll_overflow(prev, a, &ans))
      |                                                                         ^~~~
      |                                                                         |
      |                                                                         int64_t* {aka long int*}
<built-in>: note:   initializing argument 3 of 'bool __builtin_smulll_overflow(long long int, long long int, long long int*)'
Language: C

#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n]; max = 1000000000000000000, c = 1, a = 0, b = 0;
  
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    a = (arr[i] > max) ? 1 : a;
    c *= arr[i];
    (arr[i]) ? max /= arr[i] : b = 1;
  }

  (b) ? puts("0") : ((a) ? puts("-1") : printf("%lld\n", c));
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:25: error: 'max' undeclared (first use in this function)
    6 |   long long int arr[n]; max = 1000000000000000000, c = 1, a = 0, b = 0;
      |                         ^~~
main.c:6:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:52: error: 'c' undeclared (first use in this function)
    6 |   long long int arr[n]; max = 1000000000000000000, c = 1, a = 0, b = 0;
      |                                                    ^
main.c:6:59: error: 'a' undeclared (first use in this function)
    6 |   long long int arr[n]; max = 1000000000000000000, c = 1, a = 0, b = 0;
      |                                                           ^
main.c:6:66: error: 'b' undeclared (first use in this function)
    6 |   long long int arr[n]; max = 1000000000000000000, c = 1, a = 0, b = 0;
      |                                                                  ^
Language: C

#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n], max = 1000000000000000000, c = 1, a = 0, b = 0;
  
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    a = (arr[i] > max) ? 1 : a;
    c *= arr[i];
    (arr[i]) ? max /= arr[i] : b = 1;
  }

  (b) ? puts("0") : ((a) ? puts("-1") : printf("%lld\n", c));
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:34: error: lvalue required as left operand of assignment
   12 |     (arr[i]) ? max /= arr[i] : b = 1;
      |                                  ^
Language: C

#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n], max = 1000000000000000000, prod = 1, flag = 0, zero = 0;
  
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    flag = (arr[i] > max) ? 1 : flag;
    prod *= arr[i];
    (arr[i]) ? max /= arr[i] : zero = 1;
  }

  (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", prod));
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:37: error: lvalue required as left operand of assignment
   12 |     (arr[i]) ? max /= arr[i] : zero = 1;
      |                                     ^
Language: C++

#include <stdio.h>

// note saya masih blom ngerti ini but i will try to figure it out
int main() {
  int lines;
  scanf("%d", &lines);
  long long int arr[lines]; 
  long long int big = 1e18, end = 1, flag = 0, zero = 0;
  
  for (int i = 0; i < lines; i++) {
    scanf("%lld", &arr[i]);
    flag = (arr[i] > big) ? 1 : flag;
	// arr[1] > big itu buat tau bakal jadi -1 apa hasil total kali
    end *= arr[i];
    // ini dikaliin2 terus
    (arr[i]) ? big /= arr[i] : zero = 1;
asfd)
    //^ i dont ge tthis... wtf
  }

  (zero) ? puts("0") : ((flag) ? puts("-1") : printf("%lld\n", end));
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:1: error: 'asfd' was not declared in this scope
   17 | asfd)
      | ^~~~
Language: C++

int main() {
	int Xz;
    long long int Zx[100004], ent = 1;
    scanf("%lld", &Xz);
    for (int i = 0; i < Xz; i++) {
        scanf("%lld", &Zx[i]);
    }
    for (int i = 0; i < Xz; i++) {
        if (Zx[i] == 0) {
            printf("0");
            return 0;
        }
    }
    for (int i = 0; i < Xz; i++) {
        if (Zx[i] <= (1000000000000000000 / ent)) {
            ent *= Zx[i];
        } else {
            printf("-1");
            return 0;
        }
    }
    printf("%lld", ent);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'scanf' was not declared in this scope
    4 |     scanf("%lld", &Xz);
      |     ^~~~~
a.cc:10:13: error: 'printf' was not declared in this scope
   10 |             printf("0");
      |             ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main() {
a.cc:18:13: error: 'printf' was not declared in this scope
   18 |             printf("-1");
      |             ^~~~~~
a.cc:18:13: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:22:5: error: 'printf' was not declared in this scope
   22 |     printf("%lld", ent);
      |     ^~~~~~
a.cc:22:5: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long int array[n], max = 1e18;
  long long int prod = 1;
  long long int flag = 0;
  long long int zero = 0;
  
  for (int i = 0; i < n; i++) {
    scanf("%lld", &array[i]);
    flag = (array[i] > max) ? 1 : flag;
    prod *= array[i];
    (array[i]) ? max /= array[i] : zero = 1;
  }

  if (zero) {
    puts("0");
  } else if (flag) {
    puts("-1");
  } else {
    printf("%lld\n", prod)
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:27: error: expected ';' before '}' token
   23 |     printf("%lld\n", prod)
      |                           ^
      |                           ;
   24 |   }
      |   ~
Language: C++

#include <stdio.h>

int main(){
    long long jumlah;
    scanf("%lld", &jumlah);

    long long var[jumlah+1];
    long long result = 1;
    int flag = 1;
    int result;

    for(int i = 0; i<jumlah; i++){
        scanf("%lld", &var[i] );
        if ( var[i] == 0 ) {
            printf("0\n");
            flag = 0;
            break;
        }
    }

    if(flag){
        for(int i = 0; i<n; i++){
            if(var[i] > 1000000000000000000/result) {
                flag = 0;
                break;
            }
            result *= var[i]; 
            if ( i >= jumlah - 1 ){
                     jumlah = 1;
        }
    }

    if ( jumlah ) {
        flag ? printf("%lld\n", result) : printf("-1\n");
    }

    return 0;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: conflicting declaration 'int result'
   10 |     int result;
      |         ^~~~~~
a.cc:8:15: note: previous declaration as 'long long int result'
    8 |     long long result = 1;
      |               ^~~~~~
a.cc:22:26: error: 'n' was not declared in this scope
   22 |         for(int i = 0; i<n; i++){
      |                          ^
Language: C++

#include <stdio.h>
int main() {
	long long int N;
	
	scanf("%lld",&N);
	
	long long int A[N+1];
	long long int hasil = 1;
	int susah = 1;
	int printHasil;
	
	for (int i = 0; i < N; i++) {
		scanf("%lld",&A[i]);
		if ( A[i] == 0 ) {
			printf("0\n");
			susah = 0;
			break;
		}
	}
	if (susah) {
		for (int i = 0; i < N ; i++) {
			if (A[i] > 1000000000000000000000000/hasil) {
				susah = 0;
				break;
			}
			hasil *= A[i];
			if (i >= n-1) {
				printHasil = 1;
			}
		}
	}
	if (susah) {
		susah ? printf("%lld",hasil) : printf("-1\n");
	}
	return 0;
}

Compiler output:
a.cc:22:36: warning: integer constant is too large for its type
   22 |                         if (A[i] > 1000000000000000000000000/hasil) {
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:27:34: error: 'n' was not declared in this scope
   27 |                         if (i >= n-1) {
      |                                  ^
Language: C++

#include <stdio.h>
int main() {
	long long int N;
	
	scanf("%lld",&N);
	
	long long int A[N+1];
	long long int hasil = 1;
	int susah = 1;
	int printHasil;
	
	for (int i = 0; i < N; i++) {
		scanf("%lld",&A[i]);
		if ( A[i] == 0 ) {
			printf("0\n");
			susah = 0;
			break;
		}
	}
	if (susah) {
		for (long long int i = 0; i < N ; i++) {
			if (A[i] > 1000000000000000000000000/hasil) {
				susah = 0;
				break;
			}
			hasil *= A[i];
			if (i >= n-1) {
				printHasil = 1;
			}
		}
	}
	if (susah) {
		susah ? printf("%lld",hasil) : printf("-1\n");
	}
	return 0;
}

Compiler output:
a.cc:22:36: warning: integer constant is too large for its type
   22 |                         if (A[i] > 1000000000000000000000000/hasil) {
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:27:34: error: 'n' was not declared in this scope
   27 |                         if (i >= n-1) {
      |                                  ^