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

#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n]= {0}, max = 1e18, 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:6:25: error: variable-sized object may not be initialized except with an empty initializer
    6 |   long long int arr[n]= {0}, max = 1e18, prod = 1, flag = 0, zero = 0;
      |                         ^
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>

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n]=0, max = 1e18, 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:6:24: error: variable-sized object may not be initialized except with an empty initializer
    6 |   long long int arr[n]=0, max = 1e18, prod = 1, flag = 0, zero = 0;
      |                        ^
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>
#include <string.h>
#define ll long long			//TIPS!!! biar gausah tulis longlong
int main(){
	
	int a;
	scanf("%lld",&a);				//scan dulu input biar arr[a] bisa tahu ada berapa isinya
	
	ll int arr[a]={0} ;			//SCAAN 0!!!
	ll int sum=1 ;				//Biar jika dikali, gak akan 0
	ll int max=1000000000000000000;	//syarat buat tidak -1
	for(int i=0;i<a;i++)		//testcase
	{
		scanf("%lld",&arr[i]); 		//tulisnya A B C D..........
		sum *= arr[i];				//Kalau Index ke i ada 0, kali loop
		
	}
	
	(sum > max || sum < 0)? printf("-1"):printf("%lld", sum);

Compiler output:
a.cc: In function 'int main()':
a.cc:19:66: error: expected '}' at end of input
   19 |         (sum > max || sum < 0)? printf("-1"):printf("%lld", sum);
      |                                                                  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C

#include <stdio.h>

int main() {
  long long int n;
  scanf("%lld", &n);
  long long int arr[n];
  long long int 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", &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:17:37: error: lvalue required as left operand of assignment
   17 |     (arr[i]) ? max /= arr[i] : zero = 1;
      |                                     ^
Language: C

#include <stdio.h>

int main() {
  long long int n;
  long long int arr[n];
  long long int max = 1e18;
  long long int prod = 1;
  long long int flag = 0;
  long long int zero = 0;
  
  scanf("%lld", &n);
  
  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:17:37: error: lvalue required as left operand of assignment
   17 |     (arr[i]) ? max /= arr[i] : zero = 1;
      |                                     ^
Language: C

#include <stdio.h>

int main() {
  int n;
  long long int arr[n];
  long long int max = 1e18;
  long long int prod = 1;
  long long int flag = 0;
  long long int zero = 0;
  
  scanf("%lld", &n);
  
  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:17:37: error: lvalue required as left operand of assignment
   17 |     (arr[i]) ? max /= arr[i] : zero = 1;
      |                                     ^
Language: C

#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n];
  long long int max = 1e18;
  int 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("%d\n", prod));
  return 0;
}

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

#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n];
  long long int max = 1e18;
  int 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:14:37: error: lvalue required as left operand of assignment
   14 |     (arr[i]) ? max /= arr[i] : zero = 1;
      |                                     ^
Language: C++

#include <stdio.h>
#include <string.h>
#define ll long long			//TIPS!!! biar gausah tulis longlong
int main(){
	
	ll a;
	scanf("%lld",&a);				//scan dulu input biar arr[a] bisa tahu ada berapa isinya
	
	ll int arr[a]={0} ;			//SCAAN 0!!!
	ll int sum=1 ;				//Biar jika dikali, gak akan 0
	ll int max=1000000000000000000;	//syarat buat tidak -1
	for(int i=0;i<a;i++)		//testcase
	{
		scanf("%lld",&arr[i]); 		//tulisnya A B C D..........
		sum *= arr[i];				//Kalau Index ke i ada 0, kali loop
		
	}
	
	(sum > max || sum < 0)? printf("-1"):printf("%lld\n", sum);

Compiler output:
a.cc: In function 'int main()':
a.cc:19:68: error: expected '}' at end of input
   19 |         (sum > max || sum < 0)? printf("-1"):printf("%lld\n", sum);
      |                                                                    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C

#include <stdio.h>

int main() {
  int a;
  scanf("%d", &a);
  long long int arr[a], max = 1000000000000000000, prod = 1, flag = 0, zero = 0;
  
  for (int i = 0; i < a; 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>

int main() {
  int a;
  scanf("%d", &a);
  long long int arr[a], max = 1e18, prod = 1, flag = 0, zero = 0;
  
  for (int i = 0; i < a; 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>

int main() {
  int Z;
  scanf("%d", &Z);
  long long int arr[Z], max = 1e18, prods = 1, flags = 0, zeroo = 0;
  
  for (int i = 0; i < Z; i++) {

    scanf("%lld", &arr[i]);
    flag = (arr[i] > max) ? 1 : flags;
    prods *= arr[i];
    (arr[i]) ? max /= arr[i] : zeroo = 1;

  }

  (zeroo) ? puts("0") : ((flags) ? puts("-1") : printf("%lld\n", prods));
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'flag' was not declared in this scope; did you mean 'flags'?
   11 |     flag = (arr[i] > max) ? 1 : flags;
      |     ^~~~
      |     flags
Language: C++

#include <stdio.h>

int main() {
  int Z;
  scanf("%d", &Z);
  long long int arr[Z], max = 1e18, prods = 1, flags = 0, zero = 0;
  
  for (int i = 0; i < Z; i++) {

    scanf("%lld", &arr[i]);
    flag = (arr[i] > max) ? 1 : flags;
    prod *= arr[i];
    (arr[i]) ? max /= arr[i] : zero = 1;

  }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'flag' was not declared in this scope; did you mean 'flags'?
   11 |     flag = (arr[i] > max) ? 1 : flags;
      |     ^~~~
      |     flags
a.cc:12:5: error: 'prod' was not declared in this scope; did you mean 'prods'?
   12 |     prod *= arr[i];
      |     ^~~~
      |     prods
Language: C++

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

int main(){
    int N;
    cin >> N;
    vector<unsigned long long int> A(N);
    int i;
    unsigned long long int multi = 1;
    int zero = 0;
    for(i=0; i<N; i++){
        cin >> A.at(i);
        if(A.at(i) == 0){
            zero++;
        }
    }

    if(zero != 0){
        cout << 0 << endl;
        return 0;
    }

    for(i=0; i<N; i++){
        multi *= A.at(i);
        if(multi > 1000000000000000000)
            cout << -1 << endl;
            return 0;
        }
    }
        
    cout << multi << endl;
    
}

Compiler output:
a.cc:31:5: error: 'cout' does not name a type
   31 |     cout << multi << endl;
      |     ^~~~
a.cc:33:1: error: expected declaration before '}' token
   33 | }
      | ^
Language: C

#include <stdio.h>

int main() {
  int a;
  scanf("%d", &a);
  long long int arr[a], max = 1e18, 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:8:23: error: 'n' undeclared (first use in this function)
    8 |   for (int i = 0; i < n; i++) {
      |                       ^
main.c:8:23: note: each undeclared identifier is reported only once for each function it appears in
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>

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

#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n], max = 1e18, 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:
a.cc: In function 'int main()':
a.cc:36:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   36 | int main() {
      |         ^~
a.cc:36:9: note: remove parentheses to default-initialize a variable
   36 | int main() {
      |         ^~
      |         --
a.cc:36:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:36:12: error: a function-definition is not allowed here before '{' token
   36 | int main() {
      |            ^
a.cc:50:2: error: expected '}' at end of input
   50 | }
      |  ^
a.cc:3:13: note: to match this '{'
    3 | int main () {
      |             ^
Language: C++

//#include <stdio.h>

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

#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n], max = 1e18, 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:
a.cc:51:1: error: expected declaration before '}' token
   51 | }
      | ^
Language: C++

#include <stdio.h>

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

#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n], max = 1e18, 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:
a.cc: In function 'int main()':
a.cc:36:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   36 | int main() {
      |         ^~
a.cc:36:9: note: remove parentheses to default-initialize a variable
   36 | int main() {
      |         ^~
      |         --
a.cc:36:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:36:12: error: a function-definition is not allowed here before '{' token
   36 | int main() {
      |            ^
Language: C++

#include<stdio.h>
int main(){
	long long n;
	long long result = 1;
	
	scanf("%lld", &n);
	long long input[n];
	for(int i = 0 ; i < n ; i++){
		scanf("%lld", &input[i]);
	}
	for(int i = 0 ; i < n ; i++){
		if(input[i] == 0){
			printf("0\n");
			return 0;
		}
	}
	for(int i = 0 ; i < n ; i++){
		if(input[i] <= 1000000000000000000/hasil){
			hasil *= input[i];
		}else{
			printf("-1\n");
			return 0;
		}
	}
	printf("%lld\n" hasil);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:52: error: 'hasil' was not declared in this scope
   18 |                 if(input[i] <= 1000000000000000000/hasil){
      |                                                    ^~~~~
a.cc:25:24: error: expected ')' before 'hasil'
   25 |         printf("%lld\n" hasil);
      |               ~        ^~~~~~
      |                        )
Language: C++

#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n], max = 1e18, 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:
a.cc:18:1: error: '\U0000feff' does not name a type
   18 | ﻿
      |
Language: C++

#include <stdio.h>
int main (){
    long long int n; 
    long long int t=1;//biar kalo dikali ga 0 dan dibagi ga 0;
    
    scanf("%lld",&n);
    long long int A[n]; 
    
    for(int i=0; i<n; i++){
        scanf("%lld", &A[i]);
    }
    
    for(int j=0; j<n; j++){
        if(A[j] == 0){  
            printf("0");
            return 0;
        }
    }
    
    for(int k=0; k<n; k++){
        if(A[k] <= 1000000000000000000/t){
            t = t*A[k];
        } 
		else {
            printf("-1");
            return 0;
        }
    }
    
    printf("%lld", total);
    
    
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:20: error: 'total' was not declared in this scope
   30 |     printf("%lld", total);
      |                    ^~~~~
Language: C++

#include <stdio.h>

int main(){
    
    int flag = 0, kloadaNol = 0;
    long long a;
    long long b, temp;
    long long ans = 1;
    scanf("%lld", &a);

    long long arr[100000];
    for (long long i=0; i<a; i++){
        scanf("%lld", &arr[i]);
        if (arr[i] == 0){
            kloadaNol = 1;
        }
    }
    
    if (kloadaNol == 0){
        for(long long i = 0 ; i < a ; i++){
			if(arr[i]<=1000000000000000000/ans){
				ans*=arr[i];
			}
            else{
            	printf("-1\n");
            	return 0;
			}
        }
        printf("%lld", ans);
    return 0;
}

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

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

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

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

Compiler output:
main.c: In function 'main':
main.c:7:20: error: 'arr' undeclared (first use in this function)
    7 |     scanf("%lld", &arr[i]);
      |                    ^~~
main.c:7:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: 'arr' was not declared in this scope
    7 |     scanf("%lld", &arr[i]);
      |                    ^~~
Language: C++

#include <stdio.h>

int main(){

    long long int angka;
    long long int total = 1;
    long long int N[100005];
    bool lanjut = true;
    bool printtotal = true;
    scanf("%lld, &angka);
    
    for (long long int i = 1; i <= angka; i++){
        scanf("%lld", &N[i]);
        if(N[i]==0){
            printf("0\n");
            lanjut = false;
            break;
        }
    }
      if(lanjut){
          for(int i = 1; i<=angka;i++){
              //printf("%lld\n",total);
              if(1000000000000000000/total >= N[i]){
                  total *= N[i];
            }
            else{
                printf("-1\n");
                printtotal = false;
                break;
            }    
        }    
        if(printtotal){
            printf("%lld\n",total);
        }
    }
    return 0;
}

Compiler output:
a.cc:10:11: warning: missing terminating " character
   10 |     scanf("%lld, &angka);
      |           ^
a.cc:10:11: error: missing terminating " character
   10 |     scanf("%lld, &angka);
      |           ^~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:12:5: error: expected primary-expression before 'for'
   12 |     for (long long int i = 1; i <= angka; i++){
      |     ^~~
a.cc:12:31: error: 'i' was not declared in this scope
   12 |     for (long long int i = 1; i <= angka; i++){
      |                               ^
Language: C

#include <stdio.h>

int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n], max = 1e18, 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>
int main (){
    long long int N; //test case
    long long int total=1;
    
    scanf("%lld",&N);
    long long int A[N]; //input nilainya
    
    for(int i=0;i<N;i++){
        scanf("%lld", &A[i]);
    }
    for(int j=0;j<N;j++){
        if(A[j] == 0){  //mirip seperti ?: (ternary operator)
            printf("0"); //angka berapapun kalo dikali 0, hasilnya tetap 0
            return 0;
        }
    }
    for(int k=0;k<N;k++){
        if(A[k]<=1000000000000000000/total){
            total = total*A[k];
            // apakah angka yang dikalikan itu < 10^18
       // apakah input <= 10^18/total
        } else {
            printf("-1");
            return 0;
        }
    }
    printf("%lld", total);
    
    
return 0;


Compiler output:
main.c: In function 'main':
main.c:31:1: error: expected declaration or statement at end of input
   31 | return 0;
      | ^~~~~~
Language: C

#include <stdio.h>
int main (){
    long long int N; 
    long long int total=1;
    
    scanf("%lld",&N);
    long long int A[N]; 
    
    for(int i=0;i<N;i++){
        scanf("%lld", &A[i]);
    }
    for(int j=0;j<N;j++){
        if(A[j] == 0){  
            printf("0"); 
            return 0;
        }
    }
    for(int k=0;k<N;k++){
        if(A[k]<=1000000000000000000/total){
            total = total*A[k];
            
       
        } else {
            printf("-1");
            return 0;
        }
    }
    printf("%lld", total);
    
    
return 0;


Compiler output:
main.c: In function 'main':
main.c:31:1: error: expected declaration or statement at end of input
   31 | return 0;
      | ^~~~~~
Language: C++

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

Compiler output:
a.cc:17:21: warning: integer constant is too large for its type
   17 |         if (A[i] <= 1000000000000000000000000/hasil) {
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:17:15: error: 'i' was not declared in this scope
   17 |         if (A[i] <= 1000000000000000000000000/hasil) {
      |               ^
Language: C++

#include <stdio.h>

int main () 
{
	
	int a; int nol = 0 ; int min = -1;
	long long int c[100000];
	long long int result = 1;
	long long int kali = 1000000000000000000;
	
	
	 scanf ("%d", &a);
	 
	 for (int b = 0; b<a ; b++){
		 scanf ("%lld", &c[b]);	
		result = result * c[b]; }


		
	if (result == 0) {
		printf ("%d",nol);
	}	 	
	
	else if (result>kali || result < 0)
	{ printf ("%d\n", min);}
	
	else {
	printf ("%lld", result);
	}

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

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

    long long int berapaKali;
    scanf("%lld", &berapaKali);
    long long int a1[10001];
    long long int a2 = 1;
    long long int max = 1000000000000000000;
    long long int hasil ;

    for(int j=0;j<berapaKali;j++){
        scanf("%lld", &a1[j]);
    }

    for(int h=0;h<berapaKali;h++){

        if(a1[h]==0){
            printf("0");
            return 0;
        }
    }
    for(int i=0;i<berapaKali;i++){
        if(a1[1]<=max/a2){
        a2*= a1[i];
        }else{
        printf("-1");
        return 0;
        }
    }

    printf("%lld", a2);

    return 0;

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

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

    long long int berapaKali;
    scanf("%lld", &berapaKali);
    long long int a1[berapaKali];
    long long int a2 = 1;
    long long int max = 1000000000000000000;
    long long int hasil ;

    for(int j=0;j<berapaKali;j++){
        scanf("%lld", &a1[j]);
    }

    for(int h=0;h<berapaKali;h++){

        if(a1[h]==0){
            printf("0");
            return 0;
        }
    }
    for(int i=0;i<berapaKali;i++){
        if(a1[i] <= max/a2){
        	a2 *= a1[i]; 
		}else{
    		printf("-1\n");
			return 0;	
		}
		a2*= a1[i];
    }
    hasil = a2;
    printf("%lld", hasil);
    
    }
    return 0;
}

Compiler output:
a.cc:35:5: error: expected unqualified-id before 'return'
   35 |     return 0;
      |     ^~~~~~
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

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

    long long int berapaKali;
    scanf("%lld", &berapaKali);
    long long int a1[berapaKali];
    long long int a2 = 1;
    long long int max = 1000000000000000000;
    long long int hasil ;

    for(int j=0;j<berapaKali;j++){
        scanf("%lld", &a1[j]);
    }

    for(int h=0;h<berapaKali;h++){

        if(a1[h]==0){
            printf("0");
            return 0;
        }
    }
    for(int i=0;i<berapaKali;i++){
        if(a1[i] <= max/a2){
        	a2 *= a[i]; 
		}else{
    		printf("-1\n");
			return 0;	
		}
		a2*= a1[i];
    }
    hasil = a2;
    printf("%lld", hasil);
    
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:23: error: 'a' was not declared in this scope
   24 |                 a2 *= a[i];
      |                       ^
a.cc: At global scope:
a.cc:35:5: error: expected unqualified-id before 'return'
   35 |     return 0;
      |     ^~~~~~
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

#include <stdio.h>
int main(){
	//soal F
	long long int N; //test case
	long long int g = 1; //buat hasil perkalian
	scanf("%lld", &N);
	long long int h[N]={}; //array buat menampung angka

		for(long long int i=0;i<N;i++){
			scanf("%lld", &h[i]);  
		} 
		for(int j=0;j<N;j++){
			if (h[j] == 0){
	 			printf("0");
 				return 0;
			}
		}
		for(int k=0;k<tN;k++){
 			if (h[k] > 1000000000000000000/g){
 			g *= h[k];
		} else {
			printf("-1");
			return 0;
		}
		
		printf("%lld",g);
	return 0;
}
/*
cek inputan sekarang dia > 10^18
inputan ->10^18 / total

long long tc;
long long hasil = 1;
scanf("%lld", &n);

long long input[tc];
for (int i=0;i<tc;i++){
scanf("%lld", input)
}

for(int i=0;i<tc;i++){
 if (input[i] == 0){
 		printf("0");
 		return 0;
}
for(int i=0;i<tc;i++){
 if (input[i] > 1000000/hasil){
 		hasil *= input[i]
} else {
	}

*/

Compiler output:
a.cc: In function 'int main()':
a.cc:18:31: error: 'tN' was not declared in this scope; did you mean 'N'?
   18 |                 for(int k=0;k<tN;k++){
      |                               ^~
      |                               N
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C++

#include <stdio.h>

int main(){

    long long int ang;
    long long int ttl = 1;
    long long int N[100005];
    bool lanjut = true;
    bool printtotal = true;
    scanf("%lld", &ang);
    
    for (long long int i = 1; i <= ang; i++){
        scanf("%lld", &N[i]);
        if(N[i]==0){
            printf("0\n");
            lnjt = false;
            break;
        }
    }
    
      if(lanjut){
          for(int i = 1; i<=ang;i++){
                if(1000000000000000000/ttl >= N[i]){
                  ttl *= N[i];
            }
            else{
                printf("-1\n");
                printtotal = false;
                break;
            }    
        }    
        if(printtotal){
            printf("%lld\n",ttl);
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: 'lnjt' was not declared in this scope; did you mean 'lanjut'?
   16 |             lnjt = false;
      |             ^~~~
      |             lanjut
Language: C++

#include <stdio.h>

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

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

#include <stdio.h>

int main () {
	
	int a; int nol = 0 ; int min = -1;
	long long int c;
	long long int result = 1;
	long long int kali = 1000000000000000000;
	
	
	 scanf ("%d", &a);
	 
	 for (int b = 0; b<a ; b++){
		 scanf ("%lld", &c);
		result = result * c;}
	 	
	if (result == 0) {
		printf ("%d",nol)3;
	}	 	
	else{
	result > kali ? printf ("%d", min) : printf ("%lld\n", result);}

	
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:34: error: expected ';' before numeric constant
   18 |                 printf ("%d",nol)3;
      |                                  ^
      |                                  ;
Language: C++

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
	//soal F
	long long int N; //test case
	long long int f; //mencari 0 atau >10^18
	long long int g = 1; //buat hasil perkalian
	long long int h[10000]={}; //array buat menampung angka
	int length = 1; //panjang char
  	char buffer [20]; //int -> char
	scanf("%lld", &N);
	getchar();
		for(long long int i=0;i<N;i++){
			scanf("%lld", &h[i]);
			printf("print = %lld\n", h[i]);
			if(h[i]==0){
				f=0;
				break;
			} else if(h[i]>1000000000000000000){
				f=-1;
				break;
			} else{
				g *= h[i];
				itoa (g,buffer,10);
				length = strlen(buffer);
				printf("numbers length = %d\n", length);
				if(length > 18){
					f = -1;
					break;
				}
			}
		} 

		if(f == 0){
			printf("0");	
		} else if (f == -1){
			printf("-1");
		} else {
			printf("%lld",g);
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:33: error: 'itoa' was not declared in this scope
   25 |                                 itoa (g,buffer,10);
      |                                 ^~~~
Language: C++

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
	//soal F
	int N; //test case
	long long int f; //mencari 0 atau >10^18
	long long int g = 1; //buat hasil perkalian
	int h[10000]={}; //array buat menampung angka
	int length = 1; //panjang char
  	char buffer [20]; //int -> char
	scanf("%d", &N);
	getchar();
		for(long long int i=0;i<N;i++){
			scanf("%d", &h[i]);
			printf("print = %d\n", h[i]);
			if(h[i]==0){
				f=0;
				break;
			} else if(h[i]>1000000000000000000){
				f=-1;
				break;
			} else{
				g *= h[i];
				itoa (g,buffer,10);
				length = strlen(buffer);
				printf("numbers length = %d\n", length);
				if(length > 18){
					f = -1;
					break;
				}
			}
		} 

		if(f == 0){
			printf("0");	
		} else if (f == -1){
			printf("-1");
		} else {
			printf("%lld",g);
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:33: error: 'itoa' was not declared in this scope
   25 |                                 itoa (g,buffer,10);
      |                                 ^~~~
Language: C++

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
	//soal F
	int N; //test case
	long long int f; //mencari 0 atau >10^18
	long long int g = 1; //buat hasil perkalian
	int h[10000]={}; //array buat menampung angka
	int length = 1; //panjang char
  	char buffer [20]; //int -> char
	scanf("%d", &N);
	getchar();
		for(long long int i=0;i<N;i++){
			scanf("%lld", &h[i]);
			printf("print = %lld\n", h[i]);
			if(h[i]==0){
				f=0;
				break;
			} else if(h[i]>1000000000000000000){
				f=-1;
				break;
			} else{
				g *= h[i];
				itoa (g,buffer,10);
				length = strlen(buffer);
				printf("numbers length = %d\n", length);
				if(length > 18){
					f = -1;
					break;
				}
			}
		} 

		if(f == 0){
			printf("0");	
		} else if (f == -1){
			printf("-1");
		} else {
			printf("%lld",g);
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:33: error: 'itoa' was not declared in this scope
   25 |                                 itoa (g,buffer,10);
      |                                 ^~~~
Language: C++

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
	//soal F
	long long int N; //test case
	long long int f; //mencari 0 atau >10^18
	long long int g = 1; //buat hasil perkalian
	long long int h[10000]={}; //array buat menampung angka
	int length = 1; //panjang char
  	char buffer [20]; //int -> char
	(void)scanf("%lld", &N);
	getchar();
		for(long long int i=0;i<N;i++){
			(void)scanf("%lld", &h[i]);
			printf("print = %lld\n", h[i]);
			if(h[i]==0){
				f=0;
				break;
			} else if(h[i]>1000000000000000000){
				f=-1;
				break;
			} else{
				g *= h[i];
				itoa (g,buffer,10);
				length = strlen(buffer);
				printf("numbers length = %d\n", length);
				if(length > 18){
					f = -1;
					break;
				}
			}
		} 

		if(f == 0){
			printf("0");	
		} else if (f == -1){
			printf("-1");
		} else {
			printf("%lld",g);
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:33: error: 'itoa' was not declared in this scope
   25 |                                 itoa (g,buffer,10);
      |                                 ^~~~
Language: C++

#include <stdio.h>
int main()
{ 
	long long int N;
	long long int result = 1;
	
	scanf("%lld\n",&N);
	long long int A[N];
	for (int index = 0; index < N; index++) {
		scanf("%lld",&A[index]);
		result = result * A[index];
	}
	cek < 0 ? printf("-1\n") : printf("%lld\n",result);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'cek' was not declared in this scope
   13 |         cek < 0 ? printf("-1\n") : printf("%lld\n",result);
      |         ^~~
Language: C++

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
	//soal F
	long long int N; //test case
	long long int f; //mencari 0 atau >10^18
	long long int g = 1; //buat hasil perkalian
	long long int h[10000]={}; //array buat menampung angka
	int length = 1; //panjang char
  	char buffer [20]; //int -> char
	scanf("%lld", &N);
	getchar();
		for(long long int i=0;i<N;i++){
			scanf("%lld", &h[i]);
			printf("print = %lld\n", h[i]);
			if(h[i]==0){
				f=0;
				break;
			} else if(h[i]>1000000000000000000){
				f=-1;
				break;
			} else{
				g *= h[i];
				itoa (g,buffer,10);
				length = strlen(buffer);
				printf("numbers length = %d\n", length);
				if(length > 18){
					f = -1;
					break;
				}
			}
		} 

		if(f == 0){
			printf("0");	
		} else if (f == -1){
			printf("-1");
		} else {
			printf("%d",g);
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:33: error: 'itoa' was not declared in this scope
   25 |                                 itoa (g,buffer,10);
      |                                 ^~~~
Language: C++

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
	//soal F
	long long int N; //test case
	long long int f; //mencari 0 atau >10^18
	long long int g = 1; //buat hasil perkalian
	long long int h[10000]={}; //array buat menampung angka
	int length = 1; //panjang char
  	char buffer [20]; //int -> char
	scanf("%d", &N);
	getchar();
		for(long long int i=0;i<N;i++){
			scanf("%d", &h[i]);
			printf("print = %d\n", h[i]);
			if(h[i]==0){
				f=0;
				break;
			} else if(h[i]>1000000000000000000){
				f=-1;
				break;
			} else{
				g *= h[i];
				itoa (g,buffer,10);
				length = strlen(buffer);
				printf("numbers length = %d\n", length);
				if(length > 18){
					f = -1;
					break;
				}
			}
		} 

		if(f == 0){
			printf("0");	
		} else if (f == -1){
			printf("-1");
		} else {
			printf("%d",g);
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:33: error: 'itoa' was not declared in this scope
   25 |                                 itoa (g,buffer,10);
      |                                 ^~~~
Language: C++

#include <stdio.h>
int main(){
	//soal F
	long long int N; //test case
	long long int f; //mencari 0 atau >10^18
	long long int g = 1; //buat hasil perkalian
	long long int h[10000]={}; //array buat menampung angka
	scanf("%d", &N);
	getchar();
		for(long long int i=0;i<N;i++){
			scanf("%d", &h[i]);
			if(h[i]==0){
				f=0;
				break;
			} else if(h[i]>10000000000000000){
				f=-1;
				break;
			} else{
				g *= h[j];
				if(g > 10000000000000000){
					f = -1;
					break;
				}
			}
		} 
		if(f == 0){
			printf("0");	
		} else if (f == -1){
			printf("-1");
		} else {
			printf("%d",g);
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:40: error: 'j' was not declared in this scope
   19 |                                 g *= h[j];
      |                                        ^
Language: C++

#include<stdio.h>

int main()
{
	long long n;
	long long ctr = 1;
	scanf("%lld", &n);
	long long num[n];
	
	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/ctr){
			sum *= num[i];
		}else{
			printf("-1\n");
			return 0;
		}
	}
	printf("%lld\n", ctr);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:25: error: 'sum' was not declared in this scope; did you mean 'num'?
   22 |                         sum *= num[i];
      |                         ^~~
      |                         num
Language: C++

#include <stdio.h>

int main(){
 	int N, janganprint = 0;
 	scanf("%d", &N);
 	long long A[N], sum = 1;
 	
 	for(int i=0; i<N; i++){
 		scanf("%lld", &A[i]);
 		if(A[i] == 0){
 			printf("0");
 			janganprint++;
 			break;
		 }
		if(A[i] > 1000000000000000000){
			printf("-1");
 			janganprint++;
 			break;
		 }
	}
	for(int i=0; i<N-1; i++){
		if(A[i+1] > (1000000000000000000/A[i]){
			printf("-1");
 			janganprint++;
 			break;
 		} 
 	}
 	
 	for(int i=0; i<N; i++){
 		sum = sum*A[i];
	}
	
	if(janganprint == 0){
		printf("%lld\n", sum);
	}
 	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:55: error: expected ')' before '{' token
   22 |                 if(A[i+1] > (1000000000000000000/A[i]){
      |                   ~                                   ^
      |                                                       )
a.cc:27:9: error: expected primary-expression before '}' token
   27 |         }
      |         ^
Language: C

#include<stdio.h>
int main()	
{
	long long tc;
	scanf("%lld",&tc);
	long long input[tc+1];
	long long total = 1;
	int flag = 1;
	int flag2 = 0;
	long long sementara;
	int countO = 0,countzero = 0;
	for(int i = 0;i<tc;i++)
	{
		scanf("%lld",&input[i]);
		total *= input[i];
		sementara = input[i];
		while(sementara != 0)
		{
			if(sementara < 9 && sementara > 1) counterzero++;
			if(sementara % 10 == 0) countO++;
			if(sementara > 9) countzero++;
			sementara /= 10;
		}
		if(total >1000000000000000000 || total < 0)
		{
		 	flag = 0;
		}
		if(countO > 18 || countzero >= 18)
		{
			flag = 0;
		}
		if(input[i] == 0)
		{
			flag2 = 1;
		}
	}
	if(flag2 == 1) printf("0\n");
	else if(flag == 0) printf("-1\n");
	else if(total > 1000000000000000000) printf("-1\n");
	else printf("%lld\n",total);
	return 0;
}	

Compiler output:
main.c: In function 'main':
main.c:19:60: error: 'counterzero' undeclared (first use in this function); did you mean 'countzero'?
   19 |                         if(sementara < 9 && sementara > 1) counterzero++;
      |                                                            ^~~~~~~~~~~
      |                                                            countzero
main.c:19:60: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(){
    
    int a;
    unsigned long long b;
    unsigned long long ans = 1;
    scanf("%d", &a);
    
    for(int i = 1 ; i <= a ; i++){
        scanf("%llu", &b);
        if(ans >= 1000000000000000001){
            break;  
        }else{ ans = ans * b;
		}
    }
    if (ans <=1000000000000000001) {
      printf("%llu\n", ans);
    }else {printf("-1\n")
	}
	
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:19:26: error: expected ';' before '}' token
   19 |     }else {printf("-1\n")
      |                          ^
      |                          ;
   20 |         }
      |         ~
Language: C

#include<stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:28:17: error: 'else' without a previous 'if'
   28 |                 else if (over) printf("-1\n");
      |                 ^~~~
Language: C

#include<stdio.h>

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

int main()
{
	int n;
	scanf("%d", &n);
	long long result = 1;
	int over = 0, zero = 0;
	int a[n];
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &a[i]);
		if (a[i] == 0) zero = 1;
	}
	if (zero) printf("0\n");
	else 
	{
		for(int i = 0; i < n; i++)
		{
			if(result * a[i] > 1000000000000000000)
			{
				check = 1;
				break;
			}
			result *= a[i];
		}
		else if (over) printf("-1\n");
		else printf("%lld\n", result);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:47:33: error: 'check' undeclared (first use in this function)
   47 |                                 check = 1;
      |                                 ^~~~~
main.c:47:33: note: each undeclared identifier is reported only once for each function it appears in
main.c:52:17: error: 'else' without a previous 'if'
   52 |                 else if (over) printf("-1\n");
      |                 ^~~~
Language: C

#include <stdio.h>
int main()
{
  int n, zero = 0;
  long long arr[100000];
  long long temp = 1;
  scanf("%d",&n);
  for(int i = 0; i < n ;i++)
  {
    scanf("%lld", &arr[i]);
  }
  for(int i = 0; i < n;i++)
  {
    if(arr[i] == 0)
	{
      zero=zero+1;
    }
    if(zero > 0)
	{
      printf("0\n");
      return 0;
    }
  }
  
  for(int i = 0; i < n;i++)
  {
    if(arr[i]<=1000000000000000000/temp)
	{
      temp = temp * arr[i];
    }
    else
	{
      printf("-1\n");
      return 0;
    }
  }
  printf("%lld",s);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:37:17: error: 's' undeclared (first use in this function)
   37 |   printf("%lld",s);
      |                 ^
main.c:37:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main()
{
  int n, zero = 0;
  long long arr[100000];
  long long temp = 1;
  scanf("%d",&n);
  for(int i = 0; i < n ;i++)
  {
    scanf("%lld", &arr[i]);
  }
  for(int i = 0; i < n;i++)
  {
    if(arr[i] == 0)
	{
      zero=zero+1;
    }
    if(zero > 0)
	{
      printf("0\n");
      return 0;
    }
  }
  
  for(int i = 0; i < n;i++)
  {
    if(a[i]<=1000000000000000000/temp)
	{
      temp = temp * a[i];
    }
    else
	{
      printf("-1\n");
      return 0;
    }
  }
  printf("%lld",s);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:8: error: 'a' undeclared (first use in this function)
   27 |     if(a[i]<=1000000000000000000/temp)
      |        ^
main.c:27:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:37:17: error: 's' undeclared (first use in this function)
   37 |   printf("%lld",s);
      |                 ^
Language: C

#include<stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:15:25: error: expected ';' before '{' token
   15 |                 (x == 0)
      |                         ^
      |                         ;
   16 |                 {
      |                 ~
Language: C

#include<stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:9:29: error: 'tc' undeclared (first use in this function)
    9 |         for (int i = 0; i < tc; i++)
      |                             ^~
main.c:9:29: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
#define ll long long int
#define rep(i,a,b) for(long long i=a; i<b; i+=1)
#define repr(i,a,b) for(long long i=a; i<=b; i+=1)
#define vec vector<ll>
#define map map<char,int>
#define repa(p,A) for(auto p:A)
#define pb push_back
#define sort(a) sort(a.begin(),a.end())
#define reverse(a) reverse(a.begin(),a.end())
const double PI=acos(-1);
using namespace std;

int main( ) {
    ll N;
    cin>>N;
    ll count=1;
    vec A(N);
    rep(i,0,N) {
        cin>>A[i];
        if(A[i]==0) {
            cout<<"0"<<endl;
            return 0;
            }
        }
    sort(A);
    rep(i,0,N) {
        if(A[i]<=1000000000000000000/count) {
          count*=A[i];
        }
        else {
            cout<<"-1"<<endl;
            return 0;
        }
          cout<<count<<endl;
       
        }

Compiler output:
a.cc: In function 'int main()':
a.cc:37:10: error: expected '}' at end of input
   37 |         }
      |          ^
a.cc:14:13: note: to match this '{'
   14 | int main( ) {
      |             ^