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

#include<stdio.h>

int main(void){
  int N;
  int a=1;
  scanf("%d",&N);
  int n[N-1];
  for(int i=0:i<=N:i++)
  {
    scanf("%d",&n[i]);
    a=a*n[i];
  }
  if(a>=10^18){
    a=-1;
  }
  printf("%d/n",a);
  return 0;
  
}


Compiler output:
main.c: In function 'main':
main.c:8:14: error: expected ',' or ';' before ':' token
    8 |   for(int i=0:i<=N:i++)
      |              ^
main.c:13:3: error: expected expression before 'if'
   13 |   if(a>=10^18){
      |   ^~
main.c:17:3: error: expected expression before 'return'
   17 |   return 0;
      |   ^~~~~~
main.c:19:1: error: expected expression before '}' token
   19 | }
      | ^
Language: C

#include <stdio.h>

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

        if (a[i] == 0){
            printf("0");
            return 0;
        }
    }


for (i = 0;i < n;i++){
if(a[i]<=1000000000000000000/c){
  c*=a[i];}
  else printf("-1\n");
            return 0;
    }}
    
    printf("%lld\n",c);
    
    return 0;
}



Compiler output:
main.c:27:12: error: expected declaration specifiers or '...' before string constant
   27 |     printf("%lld\n",c);
      |            ^~~~~~~~
main.c:27:21: error: unknown type name 'c'
   27 |     printf("%lld\n",c);
      |                     ^
main.c:29:5: error: expected identifier or '(' before 'return'
   29 |     return 0;
      |     ^~~~~~
main.c:30:1: error: expected identifier or '(' before '}' token
   30 | }
      | ^
Language: Java

import java.util.Scanner;
public class MainB {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int N = scan.nextInt();
		double[] A = new double[N];
		double ans = 1;
		
		for(int i=0;i<N;i++) {
			A[i] = scan.nextDouble();
			ans = ans * A[i];
		}
		if(ans >= Math.pow(10, 18)) {
			System.out.println(-1);
		}else {
			System.out.println((int)ans);
		}
	}

}

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

#include<stdio.h>
 
int main(){
  int N;
  long long int A[N];
  int i;
  while(scanf("%d",&N)==0);
  long long int K=1;
  
  for(i=0;i<N;i++){
    while(scanf("%lld",&A[i])==0);
    
      if((K*A[i])>1000000000000000000){
    K=-1;
        break;
      }
  else if(A[i]==0){
    K=0;
    break;
  }else
    K=K*A[i];
  }
  
  A[N]='\n';
  
printf("%lld\n",K);
  
  return 0;
}
#include<stdio.h>
 
int main(){
  int N;
  int A[N];
  int i;
  while(scanf("%d",&N)==0);
  int K=1;
  
  for(i=0;i<N;i++){
    while(scanf("%d",&A[i])==0);
    
      if((K*A[i])>1000000000000000000){
    K=-1;
        break;
      }
  else if(A[i]==0){
    K=0;
    break;
  }else
    K=K*A[i];
  }
  
  A[N]='\n';
  
printf("%d\n",K);
  
  return 0;
}

Compiler output:
main.c:32:5: error: redefinition of 'main'
   32 | int main(){
      |     ^~~~
main.c:3:5: note: previous definition of 'main' with type 'int()'
    3 | int main(){
      |     ^~~~
Language: C

#include <stdio.h>
#include <math.h>
 
int main(){
  int N;
  int temp = 1;
  int A[256] = {};
  if(scanf("%d",&N)){};
  for (int i=1;i <= N;i++){
    if(scanf("%d",&A[i])){};
  }
  for (int i=0;i < N;i++){
    if (A[i] == 0){
      printf("0");
      return 0;
  for (int i=0;i <= N;i++){
    temp *= A[i];
  }
  if (temp >= (int)pow(10.0,18.0)){
    printf("-1");
  }else{
    printf("%d",temp);
  }
  return 0;
}

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

#include <stdio.h>
#include <math.h>
 
int main(){
  int N;
  int temp = 1;
  int A[256] = {};
  if(scanf("%d",&N)){};
  for (int i=1;i <= N;i++){
    if(scanf("%d",&A[i])){};
  }
  for (int i=0;i <= N;i++){
    temp *= A[i];
  }
  if (temp >= (int)pow(10.0,18.0)){
    printf("-1");
  }else{
    printf("%d",temp);
  }
  return 0;
}
#include <stdio.h>
#include <math.h>
 
int main(){
  int N;
  int temp = 1;
  int A[] = {};
  if(scanf("%d",&N)){};
  for (int i=1;i <= N;i++){
    if(scanf("%d",&A[i])){};
  }
  for (int i=0;i <= N;i++){
    temp *= A[i];
  }
  if (temp >= (int)pow(10.0,18.0)){
    printf("-1");
  }else{
    printf("%d",temp);
  }
  return 0;
}

Compiler output:
main.c:25:5: error: redefinition of 'main'
   25 | int main(){
      |     ^~~~
main.c:4:5: note: previous definition of 'main' with type 'int()'
    4 | int main(){
      |     ^~~~
Language: C

#include <stdio.h>
#include <math.h>
 
int main(){
  int N;
  int temp;
  int A[999999] = {};
  if(scanf("%d",&N)){};
  for (int i=0;i <= N;i++){
    if(scanf("%d",&A[i])){};
  }
  for (int i=0;i <= N;i++){
    temp *= A[i];
  }
  if (int(pow(10.0,18.0)) <= temp){
    printf("-1");
  }else{
    printf("%d",temp);
  }
}

Compiler output:
main.c: In function 'main':
main.c:15:7: error: expected expression before 'int'
   15 |   if (int(pow(10.0,18.0)) <= temp){
      |       ^~~
Language: C

#include <stdio.h>
#include <math.h>
 
int main(){
  int N;
  int temp;
  int A[999999] = {};
  if(scanf("%d",&N)){};
  for (int i=0;i <= N;i++){
    if(scanf("%d",&A[i])){};
  }
  for (int i=0;i <= N;i++){
    temp *= A[i];
  }
  if (temp >= int(pow(10.0,18.0))){
    printf("-1");
  }else{
    printf("%d",temp);
  }
}

Compiler output:
main.c: In function 'main':
main.c:15:15: error: expected expression before 'int'
   15 |   if (temp >= int(pow(10.0,18.0))){
      |               ^~~
Language: C

#include <stdio.h>
#include <math.h>
 
int main(){
  int N;
  int temp;
  int A[999999] = {};
  if(scanf("%d",&N)){};
  for (int i=0;i <= N;i++){
    if(scanf("%d",&A[i])){};
  }
  for (int i=0;i <= N;i++){
    temp *= A[i];
  }
  if (temp >= int(pow(10.0,18.0)){
    printf("-1");
  }else{
    printf("%d",temp);
  }
}

Compiler output:
main.c: In function 'main':
main.c:15:15: error: expected expression before 'int'
   15 |   if (temp >= int(pow(10.0,18.0)){
      |               ^~~
main.c:20:1: error: expected expression before '}' token
   20 | }
      | ^
Language: C

#include <stdio.h>
#include <math.h>
 
int main(){
  int N;
  int temp;
  int A[999999] = {};
  if(scanf("%d",&N)){};
  for (int i=0;i <= N;i++){
    if(scanf("%d",&A[i])){};
  }
  for (int i=0;i <= N;i++){
    temp *= A[i];
  }
  if (temp >= int(pow(10,18.0)){
    printf("-1");
  }else{
    printf("%d",temp);
  }
}

Compiler output:
main.c: In function 'main':
main.c:15:15: error: expected expression before 'int'
   15 |   if (temp >= int(pow(10,18.0)){
      |               ^~~
main.c:20:1: error: expected expression before '}' token
   20 | }
      | ^
Language: C

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

Compiler output:
main.c: In function 'aiueo':
main.c:28:3: error: expected declaration or statement at end of input
   28 |   return temp;
      |   ^~~~~~
Language: C

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

Compiler output:
main.c:3:5: warning: conflicting types for built-in function 'pow'; expected 'double(double,  double)' [-Wbuiltin-declaration-mismatch]
    3 | int pow(int,int);
      |     ^~~
main.c:2:1: note: 'pow' is declared in header '<math.h>'
    1 | #include <stdio.h>
  +++ |+#include <math.h>
    2 | 
main.c: In function 'pow':
main.c:28:3: error: expected declaration or statement at end of input
   28 |   return temp;
      |   ^~~~~~
Language: C

#include <stdio.h>

int pow(int,int);
 
int main(){
  int N;
  int temp;
  int A[999999] = {};
  if(scanf("%d",&N)){};
  for (int i=0;i <= N;i++){
    if(scanf("%d",&A[i])){};
  }
  for (int i=0;i <= N;i++){
    temp *= A[i];
  }
  if (temp >= pow(10,18){
    printf("-1");
  }else{
    printf("%d",temp);
  }
}

int pow(int x,int y){
  int temp;
  for (int i=0;i <= y;i++){
    temp *= x;
  }
  return temp;
}

Compiler output:
main.c:3:5: warning: conflicting types for built-in function 'pow'; expected 'double(double,  double)' [-Wbuiltin-declaration-mismatch]
    3 | int pow(int,int);
      |     ^~~
main.c:2:1: note: 'pow' is declared in header '<math.h>'
    1 | #include <stdio.h>
  +++ |+#include <math.h>
    2 | 
main.c: In function 'main':
main.c:16:25: error: expected ')' before '{' token
   16 |   if (temp >= pow(10,18){
      |      ~                  ^
      |                         )
main.c:21:1: error: expected expression before '}' token
   21 | }
      | ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:15:15: error: expected expression before 'int'
   15 |   if (temp == int(pow(10,18))){
      |               ^~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:8:14: error: expected declaration specifiers or '...' before string constant
    8 |   void(scanf("%d",&N));
      |              ^~~~
main.c:8:19: error: expected declaration specifiers or '...' before '&' token
    8 |   void(scanf("%d",&N));
      |                   ^
main.c:10:16: error: expected declaration specifiers or '...' before string constant
   10 |     void(scanf("%d",&A[i]));
      |                ^~~~
main.c:10:21: error: expected declaration specifiers or '...' before '&' token
   10 |     void(scanf("%d",&A[i]));
      |                     ^
main.c:15:15: error: expected expression before 'int'
   15 |   if (temp == int(pow(10,18))){
      |               ^~~
Language: C++

//written by: rishav2416
#include <bits/stdc++.h>
#define ll long  long
#define lli long long int
#define ld long double
#define mod 1000000007
#define max_char 128
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define lbd lower_bound
#define ubd upper_bound
#define PI 3.141592653589793238
#define pf push_front
#define all(x) x.begin(),x.end()
#define input(arr,n) for(ll c1=0;c1<n;c1++)cin>>arr[c1];
#define arrinit(arr,n,k) for(ll c1=0;c1<n;c1++) arr[i]=k;
#define rep(i,a,n) for( ll i=a ; i<n ; i++)
#define revrep(i,a,n) for(ll i=a; i>=n ; i--)
#define mems(x, y) memset(x, y, sizeof(x))
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
#define INF 1e18a
 
 
 
ll power(ll base,ll pow)
{
   ll res=1;
   while(pow)
   {
        if (pow%2!=0)  res=(res*base);
        base=(base*base);
        pow/=2;
   }
   return res;
}
 
ll inv(ll i){//mod must be prime and i must be coprime with mo
	return power(i,mod-2,mod);
}
 
std::string str="All Good Till Here";
 
/////////////////////////////////////////////////////////////////////////////////
 
void solve()
{
  ll i,j,x,n;
  cin>>n;
  lli p=1,a[n];
  input(a,n);
  rep(i,0,n)
  {
    p*=a[i];
    if(p>=power(10,18))
    {
      cout<<"-1\n";
      break;
    }
  }
}
int32_t main()
{
    fastio
	ll tt;
	// cin>>tt;
  tt=1;
	while(tt--)
	{
    solve();
	}
    return 0;
}

Compiler output:
a.cc: In function 'long long int inv(long long int)':
a.cc:41:21: error: too many arguments to function 'long long int power(long long int, long long int)'
   41 |         return power(i,mod-2,mod);
      |                ~~~~~^~~~~~~~~~~~~
a.cc:28:4: note: declared here
   28 | ll power(ll base,ll pow)
      |    ^~~~~
Language: C


    
    //written by: rishav2416
#include <bits/stdc++.h>
#define ll long  long
#define lli long long int
#define ld long double
#define mod 1000000007
#define max_char 128
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define lbd lower_bound
#define ubd upper_bound
#define PI 3.141592653589793238
#define pf push_front
#define all(x) x.begin(),x.end()
#define input(arr,n) for(ll c1=0;c1<n;c1++)cin>>arr[c1];
#define arrinit(arr,n,k) for(ll c1=0;c1<n;c1++) arr[i]=k;
#define rep(i,a,n) for( ll i=a ; i<n ; i++)
#define revrep(i,a,n) for(ll i=a; i>=n ; i--)
#define mems(x, y) memset(x, y, sizeof(x))
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
#define INF 1e18a



ll power(ll base,ll pow)
{
   ll res=1;
   while(pow)
   {
        if (pow%2!=0)  res=(res*base);
        base=(base*base);
        pow/=2;
   }
   return res;
}

ll inv(ll i){//mod must be prime and i must be coprime with mo
	return power(i,mod-2,mod);
}

std::string str="All Good Till Here";

/////////////////////////////////////////////////////////////////////////////////

void solve()
{
  ll i,j,x,n;
  cin>>n;
  lli p=1,a[n];
  input(a,n);
  rep(i,0,n)
  {
    p*=a[i];
    if(p>=power(10,18))
    {
      cout<<"-1\n";
      break;
    }
  }
}
int32_t main()
{
    fastio
	ll tt;
	// cin>>tt;
  tt=1;
	while(tt--)
	{
    solve();
	}
    return 0;
}


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

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

int main(){
  int N;
  int temp;
  int A[] = {};
  scanf("%d",&N);
  for (int i=0;i <= N;i++){
    scanf("%d",&A[i]);
  }
  for (int i=0;i <= N;i++){
    temp *= A[i];
  }
  if (temp == int(pow(10,18))){
    printf("-1");
  }else{
    printf("%d",temp);
  }
}

Compiler output:
main.c: In function 'main':
main.c:15:15: error: expected expression before 'int'
   15 |   if (temp == int(pow(10,18))){
      |               ^~~
Language: C

#include <stdio.h>
#include <stdlib.h>

int main(void) {
  int n;
  int i;

  unsigned long long int r = 1;

  scanf("%d", &n);

  for (i = 0; i < n; i++) {
    unsigned long long int a;
    scanf("%d", &a);
    r *= a[i];
    if (r > 1000000000000000000ull) {
      printtf("-1\n");
      return 0;
    }
  }
  printf("%llu\n", r);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:11: error: subscripted value is neither array nor pointer nor vector
   15 |     r *= a[i];
      |           ^
main.c:17:7: error: implicit declaration of function 'printtf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   17 |       printtf("-1\n");
      |       ^~~~~~~
      |       printf
Language: C

#include <stdio.h>

int main(){
    int n,i;
     long long a[100000],c=1;
    scanf("%d", &n);
  
for (i = 0;i < n;i++){
        if (A[i] == 0){
            printf("0");
            return 0;
        }
    }

 for(i=0; i<n; i++){
  scanf("%lld",a[i]);
      c=c*a[i];}
for (i = 0;i < n;i++){
if(a[i]>1000000000000000000){
   printf("-1\n");
            return 0;}
    c*=a[i];}
    
    printf("%lld\n",c);
    
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:13: error: 'A' undeclared (first use in this function)
    9 |         if (A[i] == 0){
      |             ^
main.c:9:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define int long long
#define endl "\n"
#define pii pair<int,int> 
#define ff first
#define ss second
#define mii map<int,int>
#define si set<int>
#define sti stack<int>
#define qi queue<int>
#define vi vector<int>
#define pq priority_queue<int>
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int M=1e9+7;

void solve(){
	/*int n;
	cin>>n;
	int ans=1;
	int res=1e18;
	int flag=0;
	for(int i=0;i<n;i++){
		int x; cin>>x;
		if(x==0){ans=0;flag=1;}
		if(x>res&&!flag){ans=-1;flag=1;}
		if(!flag){
			ans*=x;
			res=1e18/ans;
		}
	}
	cout<<ans<<endl;*/
	int n;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++) cin>>a[i];
	sort(a,a+n);
	if(a[0]==0) cout<<0<<endl;
	else{
		int mx=1e18;
		int ans=1;
		int flag=0;
		for(int i=0;i<n&&!flag;i++){
			if(mx/ans<a[i]){
				ans=-1;
				return 0;
			}
			else{
				ans*=a[i];
			}
		}
		cout<<ans<<endl;
	}
}

int32_t main(){
	IOS;
	int t=1;
	//cin>>t;
	while(t--){
		solve();	
	}
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:47:40: error: return-statement with a value, in function returning 'void' [-fpermissive]
   47 |                                 return 0;
      |                                        ^
Language: C

#include<stdio.h>
longlong a[100010];
int main(){int n;scanf("%d",&n);for(int i=0;i<n;i++)scanf("%lld",&a[i]);int zero=0;
for(int i=0;i<n;i++)if(a[i]==0)zero++;if(zero >0){printf("0\n");return 0;}long long prod=1;for(inti=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:2:1: error: unknown type name 'longlong'
    2 | longlong a[100010];
      | ^~~~~~~~
main.c: In function 'main':
main.c:4:96: error: 'inti' undeclared (first use in this function); did you mean 'int'?
    4 | 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(inti=0;i<n;i++){if(a[i]<=1000000000000000000/prod){prod*=a[i];}else{printf("-1\n");return 0;}}printf("%lld\n",prod);}
      |                                                                                                ^~~~
      |                                                                                                int
main.c:4:96: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:103: error: 'i' undeclared (first use in this function)
    4 | 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(inti=0;i<n;i++){if(a[i]<=1000000000000000000/prod){prod*=a[i];}else{printf("-1\n");return 0;}}printf("%lld\n",prod);}
      |                                                                                                       ^
Language: C++

#include<iostream>
using namespace std;
int main(void){
    int n;
    cin>>n;
    long long int arr[n];
    long long int ans=1;
    for(int i=0;i<n;i++){
        cin>>arr[i];
        if(arr[i]==0 || ans=0)
            ans=0;
        else if(ans!=-1){
            if(arr[i]<=1000000000000000000/ans)
                ans*=arr[i];
            else
                ans=-1;
        }
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: lvalue required as left operand of assignment
   10 |         if(arr[i]==0 || ans=0)
      |            ~~~~~~~~~~^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1e18
int main()
{
  ll n;
  cin>>n;
  ll a[n],mul =1;
  for(ll i=0;i<n;i++)
  cin>>a[i];
  for(ll i=0;i<n;i++)
  {
    if(mul>MOD)
    {
      cout<<"-1";
      break;
    }
    mul = mul*a[i];
  }
  cout<<mul;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: 'MOD' was not declared in this scope
   14 |     if(mul>MOD)
      |            ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  long long int n;
  cin>>n;
  long long int arr[n]
  long long int ans=1;
  int flag=0;
  for(int i=0;i<n;i++){
   cin>>arr[i];
    long long int temp =ans;
    ans*=arr[i];
    if(temp!=0 && ans/temp!=arr[i]){
     	flag=1; 
    }
  }
  if(!flag){
    cout<<ans<<endl;
  }
  else{
   	cout<<-1<<endl; 
  }
 return 0; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'long'
    7 |   long long int ans=1;
      |   ^~~~
a.cc:10:9: error: 'arr' was not declared in this scope
   10 |    cin>>arr[i];
      |         ^~~
a.cc:11:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |     long long int temp =ans;
      |                         ^~~
      |                         abs
a.cc:18:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |     cout<<ans<<endl;
      |           ^~~
      |           abs
Language: C++

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

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sax(x) cout << "!!!!!!!!!!! " << #x << " = " << x << '\n'
#define inf (sizeof(int) == 4 ? (int)1E9 : (int)1E18)
#define one(x) x.insert(x.begin(), 0);
#define TCT template <class T>
#define TCT12 template <class T1, class T2>

//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
//typedef tree<int,null_type,less_equal<int>,rb_tree_tag,
//tree_order_statistics_node_update> imsi;

TCT12 istream& operator>>(istream &I, pair<T1,T2>& p) {return I >> p.first >> p.second;}
TCT12 ostream& operator<<(ostream &O, const pair<T1,T2>& p) {return O << '(' << p.first << ' ' << p.second << ')';}
TCT istream& operator>>(istream &I, vector<T>& v) {for (T &e: v) I >> e; return I;}
TCT ostream& operator<<(ostream &O, const vector<T>& v) {for (const T &e: v) O << e << ' '; return O;}
TCT ostream& operator<<(ostream &O, const unordered_set<T>& v) {for (const T &e: v) O << e << ' '; return O;}
TCT ostream& operator<<(ostream &O, const set<T>& v) {for (const T &e: v) O << e << ' '; return O;}
TCT ostream& operator<<(ostream &O, const unordered_multiset<T>& v) {for (const T &e: v) O << e << ' '; return O;}
TCT ostream& operator<<(ostream &O, const multiset<T>& v) {for (const T &e: v) O << e << ' '; return O;}
TCT12 ostream& operator<<(ostream &O, const unordered_map<T1,T2>& v) {for (const auto &e: v) O << e << ' '; return O;}
TCT12 ostream& operator<<(ostream &O, const map<T1,T2>& v) {for (const auto &e: v) O << e << ' '; return O;}
TCT istream& operator>>(istream &I, deque<T>& v) {for (T &e: v) I >> e; return I;}
TCT ostream& operator<<(ostream &O, const deque<T>& v) {for (const T &e: v) O << e << ' '; return O;}
typedef pair<int,int> pii;
typedef vector<int> vi;







void _main() {
        int n; cin >> n;
        vi vec(n); cin >> vec;
        if (count(all(vec), 0LL)) {
                cout << 0;
        }

        int ans = 1;
        for (int i = 0; i < vec.size(); i++) {
                if (vec[i ] <=1000000000000000000/ ans )) {
                        cout << -1;
                        return;
                }

                ans *= vec[i];
        }

        cout << ans;
}



signed main() {
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        int _t = 1;
//        cin >> _t;
        while (_t--) _main();
        return 0;
}

Compiler output:
a.cc: In function 'void _main()':
a.cc:48:57: error: expected primary-expression before ')' token
   48 |                 if (vec[i ] <=1000000000000000000/ ans )) {
      |                                                         ^
Language: C++

#include<iostream>
using namespace std;
#define ll long long int 
int main(){
  ll n;
  cin>>n;
  ll arr[n]
  ll ans=1;
  int flag=0;
  for(int i=0;i<n;i++){
   cin>>arr[i];
    int temp =ans;
    ans*=arr[i];
    if(temp!=0 && ans/temp!=arr[i]){
     	flag=1; 
    }
  }
  if(!flag){
    cout<<ans<<endl;
  }
  else{
   	cout<<-1<<endl; 
  }
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:12: error: expected initializer before 'long'
    3 | #define ll long long int
      |            ^~~~
a.cc:8:3: note: in expansion of macro 'll'
    8 |   ll ans=1;
      |   ^~
a.cc:11:9: error: 'arr' was not declared in this scope
   11 |    cin>>arr[i];
      |         ^~~
a.cc:12:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |     int temp =ans;
      |               ^~~
      |               abs
a.cc:19:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |     cout<<ans<<endl;
      |           ^~~
      |           abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  ll ret=1;
  double comp=1;
  int n; cin>>n;
  for (int i=0; i<n; i++) {
    ll x; cin>>x;
    ret*=x;
  	comp*=x;
  }
  if(comp>1e18) {
    cout<<-1<<"\n";
    return 0;
  }
  cout<<((ret<=1e18) ? ret : -1)<<"\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'll' was not declared in this scope
    4 |   ll ret=1;
      |   ^~
a.cc:8:7: error: expected ';' before 'x'
    8 |     ll x; cin>>x;
      |       ^~
      |       ;
a.cc:8:16: error: 'x' was not declared in this scope
    8 |     ll x; cin>>x;
      |                ^
a.cc:9:5: error: 'ret' was not declared in this scope
    9 |     ret*=x;
      |     ^~~
a.cc:16:11: error: 'ret' was not declared in this scope
   16 |   cout<<((ret<=1e18) ? ret : -1)<<"\n";
      |           ^~~
Language: C++

#include <iostream>
using namespace std;
long long a,b=1,c;
int main (){
  cin>>a;
  for(int i=0;i<n;i++){
    cin>>c;
    b=b*c;
  if(b<0) b=-1;}
  cout<<b;}
  

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

#include <iostream>
using namespace std;
long long a,b=1,c;
main (){
  cin>>a;
  for(int i=0;i<n;i++){
    cin>>c;
    b=b*c;
  if(b<0) {b=-1;break;}}
  cout<<b;}
  
    
    
  
  

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main (){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:17: error: 'n' was not declared in this scope
    6 |   for(int i=0;i<n;i++){
      |                 ^
Language: C++

#include <iostream>
#include <vector>
#include <unordered_set>
#include <unordered_map>

using namespace std;

int main()
{
    int n;
    cin >> n;
    long long int x;
    vector<long long int> arr;
    bool zero = false;
    for (int i = 0; i < n; i++) {
        cin >> x;
        arr.push_back(x);
        if (x == 0) {
            zero = true;
            break;
        }
    }

    bool done = false;
    long long int MAX = pow(10, 18);
    long long int tot = 1;

    if (zero) {
        cout << 0 << endl;
    }
    else {
        for (long long int x : arr) {
            tot *= x;
            if (tot > MAX) {
                cout << -1 << endl;
                done = true;
                break;
            }
        }
        if (!done) {
            cout << tot << endl;
        }
    }



}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:25: error: 'pow' was not declared in this scope
   25 |     long long int MAX = pow(10, 18);
      |                         ^~~
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main(){
    int i, n;
    long int sum = 1, a, sum1;
    bool flag = false;

    cin >> n;
    for(i=0;i<n;i++){
        cin >> a;
        if(a == 0){
            cout << 0 << endl;
            flag = true;
            break;
        }
    }
    if(flag == false){
        for(i=0;i<n;i++){
            sum1 = sum;
            sum = sum*a;
            if(sum/a != sum1){
            cout << -1 << endl;
            flag = true;
            break;
        }
    }
    if(flag == false){
        cout << sum << endl;
    }

    return 0;
}

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

_ = int(input())
a = [int(i) for i in input().split()]

isOverflow = False

mul = 1
for ai in a:
    mul *= ai

print(-1 if mul > 1000000000000000000 else mul)

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

#include <bits/stdc++.h>
 
using namespace std;
 
int main(){
  long long a,b,c;
  cin>>a>>b;
  c = a*b;
  if(c> 10**18){
    cout<<"-1";
  }else{
    cout<<c;
  }
  
    return 0;
}

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

#include"bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp> 
using namespace __gnu_pbds; 
using namespace std;

#define double long double
#define int long long
#define pb push_back 
#define eb emplace_back
#define Z(c) (int)(c).size()
#define L(c) c[Z(c)-1]
#define F first
#define S second
#define nl "\n"
#define mii map<int,int>
#define sp fixed<<setprecision 
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define rep(i,iv,n) for(int (i)=(iv);(i)<(n);++(i))
#define FO fflush(stdout) 
#define D1(x) cerr <<"At line "<<__LINE__<<" "<<#x<<"="<<x<<nl
#define D2(x,y) cerr <<"At line "<<__LINE__<<" "<<#x<<"="<<x<<" "<<#y<<"="<<y<<nl
#define D3(x,y,z) cerr <<"At line "<<__LINE__<<" "<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<nl
#define tr(it,ct) for(auto &(it) : (ct))
#define pi acos(-1)
#define prt(ct) for(auto &(it) : (ct)) cerr<<it<<" "; cerr<<nl
#define prtp(ct) for(auto &(it) : (ct)) cerr<<it.F<<" "<<it.S<<nl; cerr<<nl

typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair< int,int > pii;
typedef pair<pii,pii> ppp;
typedef vector< pii > vp;
typedef tree<pii, null_type, less<pii>, rb_tree_tag, 
             tree_order_statistics_node_update> baap;

template<typename T> 
void swap(T &a,T &b)
{ auto tm=a; a=b; b=tm; }

template<typename T> 
void mina(T& a, T b) { 
    a = min(a, b); 
}
template<typename T>
void maxa(T& a, T b) { 
    a = max(a, b); 
}

  const int mod=1000000009;
  const int mod2=998244353;
  const int INF=1e18;
  const int N=2e5+25;  
  const int M=1e5+1;           


 void doit()
 { 
   int n,c=1; cin>>n;

   rep(i,0,n){
     cin>>x;
     int t=INF/c+1;
     if(x>t) {
       cout<<-1; return;
     }
     c*=x;
   }

   cout<<c;
 }

signed main()
{ 
   ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

   int tc=1;                         
   // cin>>tc;

  rep(i,1,tc+1)
  { // cout<<"Case #"<<i<<": ";
  
   doit();
   if(i<tc)
   cout<<nl;
  }
  

 return 0; 
}

Compiler output:
a.cc: In function 'void doit()':
a.cc:62:11: error: 'x' was not declared in this scope
   62 |      cin>>x;
      |           ^
Language: C

#include<stdio.h>
long long a[100010];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
        scanf("%lld",&a[i]);
    int zero=0;
    for(int i=0;i<n;i++)
        if(a[i]==0)zero++;
    if(zero >0)
        {
            printf("0\n");
            return0;
        }
            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;
    }
        }
        printf("%lld",prod);
}


Compiler output:
main.c: In function 'main':
main.c:15:13: error: 'return0' undeclared (first use in this function)
   15 |             return0;
      |             ^~~~~~~
main.c:15:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
long long a[100010];
int main()
{
    int n;
    scanf("%d",&n);
    for(inti=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");
            return0;
        }
            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;
    }
        }
        printf("%lld",prod);
}


Compiler output:
main.c: In function 'main':
main.c:7:9: error: 'inti' undeclared (first use in this function); did you mean 'int'?
    7 |     for(inti=0;i<n;i++)
      |         ^~~~
      |         int
main.c:7:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:16: error: 'i' undeclared (first use in this function)
    7 |     for(inti=0;i<n;i++)
      |                ^
main.c:15:13: error: 'return0' undeclared (first use in this function)
   15 |             return0;
      |             ^~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
using ll = long long;

int a[100001];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'else' without a previous 'if'
   25 |         else
      |         ^~~~
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main{

  public static void main(String[] args){
   
    Scanner sc = new Scanner(System.in);
    long n,prod,check;
    long[] a = new long[n];
	n = sc.nextInt();
    
    check = (long) Math.pow(10,18);
    prod = 1;
    
    for(int i=0;i<n;i++){
      if(prod>check){
      	System.out.println(-1);
        return;
      }
      a[i] = sc.nextLong();
      p = p*a[i];
    }
    
    System.out.println(p);
    
    
  }
  
}


Compiler output:
Main.java:10: error: incompatible types: possible lossy conversion from long to int
    long[] a = new long[n];
                        ^
Main.java:22: error: cannot find symbol
      p = p*a[i];
      ^
  symbol:   variable p
  location: class Main
Main.java:22: error: cannot find symbol
      p = p*a[i];
          ^
  symbol:   variable p
  location: class Main
Main.java:25: error: cannot find symbol
    System.out.println(p);
                       ^
  symbol:   variable p
  location: class Main
4 errors
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main{

  public static void main(String[] args){
   
    Scanner sc = new Scanner(System.in);
    long n,prod,check;
    long[] a = new long[];
	n = sc.nextInt();
    
    check = (long) Math.pow(10,18);
    prod = 1;
    
    for(int i=0;i<n;i++){
      if(prod>check){
      	System.out.println(-1);
        return;
      }
      a[i] = sc.nextLong();
      p = p*a[i];
    }
    
    System.out.println(p);
    
    
  }
  
}

Compiler output:
Main.java:10: error: array dimension missing
    long[] a = new long[];
                         ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define SORT(c) sort((c).begin(),(c).end());
#define pb push_back
#define MP make_pair
#define pii pair<int,int>
#define pcc pair<char,char>
#define pic pair<int,char>
#define pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define pi 3.141592653589793
#define ll long long
#define ull unsigned long long
#define w(x) int x;cin>>x;while(x--)
#define fast ios_base::sync_with_stdio(0)
#define sz size()
#define cu cout<<
#define en endl
#define sp " "
#include<cstdio>
#include<cstring>
typedef unsigned long long UL;
template<typename T>inline T  S(T a)
{
    return a*a;
}
template<class T>inline string tostring(T a)
{
    ostringstream os("");
    os << a;
    return os.str();
}
template<typename T>inline ll tolong(T a)
{
    ll res;
    istringstream os(a);
    os>>res;
    return res;
}
template<typename T>inline T gcd(T a, T b)
{
    if (b == 0)return a;
    else return gcd(b, a % b);
}
template<typename T>inline T bigmod(T a, T b, T m)
{
    if (b == 0)return 1;
    else if (b % 2 == 0)return S(bigmod(a, b / 2, m)) % m;
    else return (a % m*bigmod(a, b - 1, m)) % m;
}
const int inf = (int)1e9 + 5;
const ll linf = (ll)1e16 + 5;
const ll modd = (ll)1e9 + 7;
const int mod = 10000007;
/*#define N 20000009
bool prime[N];
vector<ll> prm;
void seive ()
{

    memset(prime, true, sizeof(prime));

    for( ll i=2; i*i<=N; i++)
    {
        if (prime[i] == true)
        {
            prm.pb(i);
            for (ll j=i*i; j<=N; j += i)
                pe[j] = false;
        }
    }
}*/
void pr (int f)
{
    if(f==1)
        cout<<"YES\n";
    else
        cout<<"NO\n";
}
/*bool isprime(ll n)
{
    if(n<2) return 0;
    if(n==2) return 1;
    else
    {
        for(int i=2; i*i<=n; i++)
            if(n%i==0) return 0;
    }
    return 1;
}*/
map<int , int >mp;
set<int  > st;
multiset<string> :: iterator it;
deque <char> q ;
int vis [10000000];

pair<int,int> a[2020];
int main()
{
    fast ;
    ll n;
    cin >> n;
    ll a,m=1;
      ar[n];
     for ( int i=0;i<n;i++) cin >> ar[i];
     for ( int i=0;i<n;i++)
    {
        m*=ar[i];
        if(m> 1000000000000000000)
        {
            cout <<-1<<endl;
            return 0;
        }
    }
    cout << m <<endl;

}





Compiler output:
a.cc: In function 'int main()':
a.cc:105:7: error: 'ar' was not declared in this scope; did you mean 'a'?
  105 |       ar[n];
      |       ^~
      |       a
Language: C++

#include<bits/stdc++.h>
#define THRESH 1e18
typedef long long int ll;
using namespace std;
int main()
{
ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ll n;
  ll res=1;
  while(n--)
  {
 	ll a;
    cin>>a;
    res*a>=THRESH?return -1:res=res*a;
  }
	cout<<res;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: expected primary-expression before 'return'
   16 |     res*a>=THRESH?return -1:res=res*a;
      |                   ^~~~~~
a.cc:16:19: error: expected ':' before 'return'
   16 |     res*a>=THRESH?return -1:res=res*a;
      |                   ^~~~~~
      |                   :
a.cc:16:19: error: expected primary-expression before 'return'
   16 |     res*a>=THRESH?return -1:res=res*a;
      |                   ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n; cin >> n;
  vector<unsigned long> data(n);
  for(int i=0; i<n; i++) cin >> data.at(i);
  sort(data.begin(),data.end());
  
  unsigned long count = 1;
  for(int i=0; i<n; i++){
    if(data.at(i) == 0){
      cout << 0 << endl;
      retrun 0;
    }
    count *= data.at(i);
    if(data.at(i) > 1000000000000000000){
      cout << '-1' << endl;
      return 0;
    }
  }
  cout << count << endl;
}
     

Compiler output:
a.cc:18:15: warning: multi-character character constant [-Wmultichar]
   18 |       cout << '-1' << endl;
      |               ^~~~
a.cc: In function 'int main()':
a.cc:14:7: error: 'retrun' was not declared in this scope
   14 |       retrun 0;
      |       ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using vi = vector<int>;
using vii = vector<vi>;

int main() {
    int N;
    cin >> N;
    bool a = false;
    vector<ll> A(N);
    for(int i = 0; i < N; i++) {
        cin >> A[i];
        if(A[i] == 0) {
            cout << 0 << endl;
            return 0;
        }
    }
    ll ans = 1;
    for(int i = 0; i < N; i++) {
        ans*=A[i];
        if(ans >= 1e18) {
            a = true;
        }
    if(a) {
        cout << -1 << endl;
    }
    else {
        cout << ans << endl;
        return 0;
    }
}

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

#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using vi = vector<int>;
using vii = vector<vi>;

int main() {
    int N;
    cin >> N;
    vector<ll> A(N);
    for(int i = 0; i < N; i++) {
        cin >> A[i];
        if(A[i] == 0) {
            cout << 0 << endl;
            return 0;
        }
    }
    ll ans = 1;
    for(int i = 0; i < N; i++) {
        ans*=A[i];
        if(ans >= 1e18) {
            cout << -1 << endl;
            return 0;
            }
    cout << ans << endl;
    return 0;
}

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

#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using vi = vector<int>;
using vii = vector<vi>;

int main() {
    int N;
    cin >> N;
    vector<ll> A(N);
    bool a = false;
    for(int i = 0; i < N; i++) {
        cin >> A[i];
        if(A[i] == 0) {
            a = true;
        }
    }
    if(a) {
        cout << 0 << endl;
    }
    else {
        ll ans = 1;
        for(int i = 0; i < N; i++) {
        ans*=A[i];
        if(ans >= 1e18) {
            ans = -1;
            break;
            }
        }
        if(ans == -1) {
            cout << -1 << endl;
        }
        else {
            cout << ans << endl;
        }
        return 0;
}

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

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

const ll MX = 1e18;

int main()
{
    int n;
    cin >> n;
    ll ans = 1;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    sort(a.begin(), a.end());
    rep(i, n) {
        if((MX + 1) / ans < a[i] || ans * a[i] > MX){
            cout << -1 << endl;
            return 0;
        }
        ans *= a[i];
    }
    cout << ans << endl;
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:27:14: error: expected '}' at end of input
   27 |     return 0;
      |              ^
a.cc:12:1: note: to match this '{'
   12 | {
      | ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define REP1(i, n) for(int i = 1; i <= (n); i++)
#define REPD(i,a,b) for (int i=(a);i<(b);i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef set<int> si;
typedef vector<si> vsi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<int, int> pi;
typedef queue<int> qi;
typedef queue<pi> qpi;
typedef pair<ll, ll> pll;
typedef queue<pll> qpll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
const int mod = 1000000007;
const int INF = 1001001001;
// 小数点　<< fixed << setprecision(0) <<
// sort降順　sort(ALL(),greater<int>());
// 円周率　M_PI
// 文字判定　isupper islower
// 文字変換　
// 順列　do {} while(next_permutation(ALL(X)));
// 最大値　LLONG_MAX
// a内でx以上　auto iter = lower_bound(ALL(a), x);
// a内でxより大きい　auto iter = upper_bound(ALL(a), x);
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
struct edge {
    int from; //出発点
    int to;   //到達点
    int cost; //移動コスト
};
typedef struct edge se;
typedef vector<edge> ve;
unsigned euclidean_gcd(unsigned a, unsigned b) {
  if(a < b) return euclidean_gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

int main() {
  ll n;
  cin >> n;
  vll a(n);
  ll zero=0;
  bool flg=true;
  REP(i,n) {
    cin >> a[i];
    if(a[i]==0) zero++;
    if(a[i]>1000000000000000000) flg=false;
  }
  if(zero!=0) {
    cout << "0" << endl;
  } else if(!flg) {
    cout << "-1" << endl;
  }
  } else {
    ll ans=1;
    REP(i,n) {
      ans*=a[i];
      if(ans>1000000000000000000) {
        flg=false;
        break;
      }
    }
    if(flg) {
      cout << ans << endl;
    } else {
      cout << "-1" << endl;
    }
  }
  return 0;
}


Compiler output:
a.cc:70:5: error: expected unqualified-id before 'else'
   70 |   } else {
      |     ^~~~
a.cc:85:3: error: expected unqualified-id before 'return'
   85 |   return 0;
      |   ^~~~~~
a.cc:86:1: error: expected declaration before '}' token
   86 | }
      | ^
Language: C++

/**
*    author:  Dooloper
*    created: 01.06.2020 22:44:40
**/

#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>
#include <cmath>
#include <functional>
#include <cassert>


using namespace std;
typedef unsigned long long ull;
typedef long long ll;

int main() {
    cin.tie(0);
    int N;cin>>N;
    vector<ll> A(N);
    ull num = 1;
    ll ans =  1;
    for(int i = 0; i < N; i++){
        cin>>A[i];
    }

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

    for(int a:A){
        if(log10(a) > 18 - log10(num)){
            ans = -1;
            break;
        }
        num *= a;
    }

    if(ans <= 0){
        cout<<ans<<endl;
    }else if(num > pow(10,18)){
        cout<<-1<<endl;
    }else {
        cout<<num<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:14: error: 'i' was not declared in this scope
   35 |         if(A[i] == 0){
      |              ^
Language: C++

/**
*    author:  Dooloper
*    created: 01.06.2020 22:44:40
**/

#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>
#include <cmath>
#include <functional>
#include <cassert>


using namespace std;
typedef unsigned long long ull;
typedef long long ll;

int main() {
    cin.tie(0);
    int N;cin>>N;
    vector<ll> A(N);
    ull num = 1;
    ll ans =  pow(10,9);
    for(int i = 0; i < N; i++){
        cin>>A[i];
        if(A[i] == 0){
            ans = 0;
        }
    }

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

    for(int a:A){
        if(log10(a) + log10(num) > 18 && ans){
            ans = -1;
            break;
        }
        num *= a;
    }

    if(ans <= 0){
        cout<<ans<<endl;
    }else if(num > pow(10,18)){
        cout<<-1<<endl;
    }else {
        cout<<num<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:28: error: expected ';' before ')' token
   37 |     sort(A.begin(),A.end()));
      |                            ^
      |                            ;
Language: C++

/**
*    author:  Dooloper
*    created: 01.06.2020 22:44:40
**/

#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>
#include <cmath>
#include <functional>
#include <cassert>


using namespace std;
typedef unsigned long long ull;
typedef long long ll;

int main() {
    cin.tie(0);
    int N;cin>>N;
    vector<ll> A(N);
    ull num = 1;
    ll ans =  pow(10,9);
    for(int i = 0; i < N; i++){
        cin>>A[i];
        if(A[i] == 0){
            ans = 0;
        }
    }

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

    for(int a:A){
        if(log10(a) + log10(num) > 18 && ans){
            ans = -1;
            break;
        }
        num *= a;
    }

    if(ans <= 0){
        cout<<ans<<endl;
    }else if(num > pow(10,18)){
        cout<<-1<<endl;
    }else {
        cout<<num<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:12: error: 'class std::vector<long long int>' has no member named 'betin'; did you mean 'begin'?
   37 |     sort(A.betin(),A.end()));
      |            ^~~~~
      |            begin
Language: C++

#include <bits/stdc++.h>
#include <numeric>
#include <iomanip>
#define ll long long
#define intm INT_MAX
#define llm LLONG_MAX

using namespace std;
int MOD = 998244353;
const int mxN = 2e9 + 9;




int main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
	int N;
	cin >> N;
	vector<ll> v1;
	ll tmp;
	for(int i=1; i <= N; i++){
        cin >> tmp;
        v1.push_back(tmp);
	}
	ll ans = 1;
	bool minusone = false;
	sort(v1.begin(), v1.end());
	if( v1[0] == 0 ){
        cout << 0;
        return;
	}
	else{
	for(int i=1; i <= N; i++){
        tmp = v1[i-1];
        ll result = ((ll) 1e18)/ ans;
        if( tmp > result || ans < 0 ){
            minusone = true;
            cout << -1;
        }
        else{
            ans *= tmp;
        }
	}
	if( !minusone ) cout << ans;
	}



}


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