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

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int k=1,i;
  long long a,p=1,c=1e18;
  for(i=1;i<=n;i++)
  {
    cin>>a;
    p*=a;
    if(p>c)
    { cout<<"-1\n";k=0
    break;}
  }
  if(k)
  	cout<<p<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: expected ';' before 'break'
   14 |     { cout<<"-1\n";k=0
      |                       ^
      |                       ;
   15 |     break;}
      |     ~~~~~
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

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

    int vetor[n];
    
    long long double prod;
    
    for (int i=0; i<n; i++){
        int num;
        cin >> num;
        prod*=(sqrt(num));
    }
    
    if (prod>pow(10,9)){
        cout << 1 << endl;
    } else {
        cout << prod*prod << endl;
    }
    
    return 0;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: 'long long' specified with 'double'
   13 |     long long double prod;
      |          ^~~~
Language: C

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define INF 0x3f3f3f3f 
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)
#define ll long long int
#define pi 3.14159265358979
int main() {
    ll n,i,ans;
    cin>>n;
    ll a[n];
    for(i=0;i<n;i++)
      cin>>a[i];
    for(i=0;i<n;i++)
      ans=ans*a[i];
    if(ans>1000000000000000000)
    cout<<-1;
  else
    cout<<ans;
    return 0;
}

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

#include <string>
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <math.h>
 
using namespace std;
int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
 
	int x;
    int y = 1
	cin >> x;
    vector<int> vec(x);
    for(int i=0; i<x;i++){
      cin >> vec.at(i);
    }
    for(int j=0; j<x;j++){
      y = y*vec.at(j);
    }
  
    
     if(y > 1000000000000000000){
       cout << -1 << "\n";
     }else{
       cout << y << "\n";
     }
    
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: expected ',' or ';' before 'cin'
   16 |         cin >> x;
      |         ^~~
Language: C++

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

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>n;
      |   ^~~
a.cc:17:3: error: 'cout' was not declared in this scope
   17 |   cout<<ans<<endl;
      |   ^~~~
a.cc:17:14: error: 'endl' was not declared in this scope
   17 |   cout<<ans<<endl;
      |              ^~~~
Language: C

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

int main(void) {
  int n;
  cin >> n;
  ll ans = 1;
  for (int i = 0; i < n; i++) {
    ll tmp;
    cin >> tmp;
    ans *= tmp;
    if (ans > 1000000000000000000) {
      ans = -1;
      break;
    }
  }
  cout << ans << endl;
}

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

n=int(input())
lim=10**18
ans=1
a = input().split(' ')
for i in range(0,n):
    if int(a[i])==0:
        ans=0
for i in range(0,n):
    if int(a[i])*ans>lim:
        ans=-1
        break
    else:
        ans*=int(a[i])
        
print(ans)

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

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

int main(){
  int N ;
  cin >> N ;
  long long A ;
  long long ans =1;
  bool s = false;
  for(int i=0;i<N;i++){
    cin >> A ;
    ans *= A;
    if(ans>1000000000000000000){
      s = true;
      break;
    }
  }
  if(s) cout << -1 << endl;
  else cout << ans << endl
    
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:27: error: expected ';' before '}' token
   19 |   else cout << ans << endl
      |                           ^
      |                           ;
   20 | 
   21 | }
      | ~
Language: C++

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

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

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

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

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

cout<<p<<endl;


	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'll' was not declared in this scope
    7 | ll arr[n];
      | ^~
a.cc:9:6: error: 'arr' was not declared in this scope
    9 | cin>>arr[i];
      |      ^~~
a.cc:10:3: error: expected ';' before 'p'
   10 | ll p=1;
      |   ^~
      |   ;
a.cc:13:8: error: 'p' was not declared in this scope
   13 |     if(p*arr[i]>1e18)
      |        ^
a.cc:13:10: error: 'arr' was not declared in this scope
   13 |     if(p*arr[i]>1e18)
      |          ^~~
a.cc:24:7: error: 'p' was not declared in this scope
   24 | cout<<p<<endl;
      |       ^
Language: Java

import java.io.*;
import java.util.*;
 
public class Main
{
  public static void main(String[] args)
  {
    Scanner scan = new Scanner(System.in);
    long a = scan.nextLong();
    long b = scan.nextLong();
    long m = a*b;
    if(m<1000000000000000000)
      System.out.println(-1);
    else
    	System.out.println(a*b);
  }
}

Compiler output:
Main.java:12: error: integer number too large
    if(m<1000000000000000000)
         ^
1 error
Language: C++

#include <bits/stdc++.h>
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
using namespace std;
using lint = long long;
using pi = pair<int, int>;
const int MAXN = 200005;
 

typedef long long ll;

int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  ll n, ans  = 1;
  ll constt = 1000000000000000000;
  while(n--){
	  ll a;
	  cin >> a;
	  ans *= a;
	  if(ans > constt){
		  cout << "-1";
		  break;
	  }
	  cout << ans;
  return 0;
}

/*
         ,--"""",--.__,---[],-------._         
       ,"   __,'            \         \--""""""==;-
     ," _,-"  "/---.___     \       ___\   ,-'',"
    /,-'      / ;. ,.--'-.__\  _,-"" ,| `,'   /
   /``""""-._/,-|:\       []\,' ```-/:;-. `. /
             `  ;:::      ||       /:,;  `-.\
                =.,'__,---||-.____',.=
                =(:\_     ||__    ):)=
               ,"::::`----||::`--':::"._
             ,':::::::::::||::::::::::::'.
    .__     ;:::.-.:::::__||___:::::.-.:::\     __,
       """-;:::( O )::::>_|| _<::::( O )::::-"""
   =======;:::::`-`:::::::||':::::::`-`:::::\=======
    ,--"";:::_____________||______________::::""----.          , ,
         ; ::`._(    |    |||     |   )_,'::::\_,,,,,,,,,,____/,'_,
       ,;    :::`--._|____[]|_____|_.-'::::::::::::::::::::::::);_
      ;/ /      :::::::::,||,:::::::::::::::::::::::::::::::::::/
     /; ``''''----------/,'/,__,,,,,____:::::::::::::::::::::,"
     ;/                :);/|_;| ,--.. . ```-.:::::::::::::_,"
    /;                :::):__,'//""\\. ,--.. \:::,:::::_,"
   ;/              :::::/ . . . . . . //""\\. \::":__,"
   ;/          :::::::,' . . . . . . . . . . .:`::\
   ';      :::::::__,'. ,--.. . .,--. . . . . .:`::`
   ';   __,..--'''-. . //""\\. .//""\\ . ,--.. :`:::`
   ;    /  \\ .//""\\ . . . . . . . . . //""\\. :`::`
   ;   /       . . . . . . . . . . . . . . . . .:`::`
   ;   (          . . . . . . . . . . . . . . . ;:::`
   ,:  ;,            . . . . . . . . . . . . . ;':::`
   ,:  ;,             . . . . . . . . . . . . .;`:::
   ,:   ;,             . . . . . . . . . . . . ;`::;`
    ,:  ;             . . . . . . . . . . . . ;':::;`
     :   ;             . . . . . . . . . . . ,':::;
      :   '.          . . . . . . . .. . . .,':::;`
       :    `.       . . . . . . . . . . . ;::::;`
        '.    `-.   . . . . . . . . . . ,-'::::;
          `:_    ``--..___________..--'':::::;'`
             `._::,.:,.:,:_ctr_:,:,.::,.:_;'`
________________`"\/"\/\/'""""`\/"\/""\/"____________________________
 
*/


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

n = int(input())
li = map(int,input().split())
ans=1
for i in li:
    ans*=i
    if ans>10**18:
        ans=-1
if ans<0:
    ans=-1
print(ans)

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

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

namespace mp = boost::multiprecision;

#define each(i, c) for (auto& i : c)
#define mkp(a, b) make_pair(a, b)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> Pll;
const ll MOD = 1e9+7;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << ": " << p.second << ")"; return os; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ", "; os << ")"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; each (i, m) os << i << ", "; os << "}"; return os; }

int main() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  for (ll i = 0; i < n; ++i) {
    cin >> a[i];
  }

  for (ll i = 0; i < n; ++i) {
    if (a[i] == 0) {
      cout << 0 << endl;
      return 0;
    }
  }
  
  mp::cpp_int ans = 1;
  for (ll 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:2:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    2 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

-*- mode: compilation; default-directory: "c:/Users/yuichi/Documents/Contests/AtCoder/ABC169/B/" -*-
Compilation started at Sun May 31 21:03:55

g++14-debug B.cpp -o B

Compilation finished at Sun May 31 21:03:57


Compiler output:
a.cc:1:1: error: expected unqualified-id before '-' token
    1 | -*- mode: compilation; default-directory: "c:/Users/yuichi/Documents/Contests/AtCoder/ABC169/B/" -*-
      | ^
a.cc:1:24: error: expected unqualified-id before 'default'
    1 | -*- mode: compilation; default-directory: "c:/Users/yuichi/Documents/Contests/AtCoder/ABC169/B/" -*-
      |                        ^~~~~~~
Language: C++

#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define check system("pause")
#define all(x) (x).begin(),(x).end()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 0x3f3f3f3f
const ll mod = 1e9+7;
const int N = 1e6+20;
#define dep(i,a,b) for(int i=(a);i>=(b);i--)
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define mes(p,b) memset(p,b,sizeof(p))
#define sz(x) int(x.size())
ll a,b,n,ans=1;
int main()
{
  	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	cin>>n;
	rep(i,1,n){
		cin>>a;
		ans*=a;a
		if(ans>(ll)(1e18)||ans<0){
			cout<<-1;
			return 0;
		}
	}
	cout<<ans;
	
  	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:30:25: error: expected ';' before 'if'
   30 |                 ans*=a;a
      |                         ^
      |                         ;
   31 |                 if(ans>(ll)(1e18)||ans<0){
      |                 ~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,s,n) for(ll i = (s); i < (n); i++)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
namespace mp = boost::multiprecision;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(18);
  
  string s;
  ll n;
  cin >> n;
  
  //vector<ll> a(n);  
  mp::cpp_int m = 1;
  rep(i, 0, n) {
    mp::cpp_int a;
    cin >> a;
    if(a*m > 1e18) {
      cout << -1 << endl;
      return 0;
    }
    else m *= a;
  }
  
  cout << m << "\n";
  
  //cout << (  ?"Yes" :"No") << "\n";

}

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

#include<bits/stdc++.h>
using namespace std;
template <typename T> using vec = vector<T>;

int main()
{
    int n;
    cin >> n;
    long ans =1;
    long a;
    vool flag = true;
    while (cin>>a)
    {
        ans *= a;
        if(ans>1000000000000000000)
        {
            flag = false;
            cout << -1 << endl;
            break;
        }
    }
    if(flag)
    {
        cout << ans << endl;
    }
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'vool' was not declared in this scope; did you mean 'bool'?
   11 |     vool flag = true;
      |     ^~~~
      |     bool
a.cc:17:13: error: 'flag' was not declared in this scope
   17 |             flag = false;
      |             ^~~~
a.cc:22:8: error: 'flag' was not declared in this scope
   22 |     if(flag)
      |        ^~~~
Language: C

#include <bits/stdc++.h>

using namespace std;

#define db(x) cout << (x) << '\n';
#define all(x) x.begin(),x.end()
#define UNIQUE(x) sort(all(x)),x.resize(unique(all(x))-x.begin())
#define LB(v,x) lower_bound(all(v),x)
#define UB(v,x) upper_bound(all(v),x)
#define endl "\n"
#define F first
#define S second
#define PB push_back
#define PF push_front
#define int long long
#define trick int m = (l+r)>>1,lc=n<<1,rc=lc|1

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vii;

int dy[]={0,1,1,1,0,-1,-1,-1};
int dx[]={-1,-1,0,1,1,1,0,-1};
const int maxn = 1e5;
const int OO = 1e18;
const int mod = 1e9 + 7;
const double PI = acos(-1);

void maxself(int &a,int b)
{a=max(a,b);}
void minself(int &a,int b)
{a=min(a,b);}

int n,m,x,y,mx;
vi v;
vector<vi> g(maxn);
int a[maxn],b[maxn];
string s;

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

//	freopen("name.in","r",stdin);
//	freopen("name.out","w",stdout);

	cin >> n;
	int acum = 1;
	bool flag = 0;
	for(int i=0;i<n;i++)
	{
		int f;
		cin >> f;
		acum *= f;
		if(acum > OO)
		acum = 0,flag = 1;
	}
	if(flag == 1)
	cout << -1;
	else
	cout << acum;

	return 0;
}



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

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


int main() {
    int n;
    ll a[100100], mul = 1;
    cin >> n;

    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }

    for (int i = 0; i < n && ; ++i) {
        mul *= a[i];
        if (mul > 10e18) {
            mul = -1;
            break;
        }
    }

    cout << mul << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:30: error: expected primary-expression before ';' token
   15 |     for (int i = 0; i < n && ; ++i) {
      |                              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long a,b=1,c,d,e,f,i,g[10000001],h=999999999,j,clo1,clo2,ans,h1,h2,m1,m2,t,m,n,x=0,k,y=0,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13,y14,y15,y16,y17,y18,y19,y20,y21,y22,y23,y24,y25,x1;
    string s,s1="PD",s2='P',s3="DP",s4='D',s5,s6;
    cin>>a;
    for(i=1;i<=a;i++){
        cin>>g[i];
        b*=g[i];
    }
    if(b>1000*1000*1000*1000*10000){
        cout<<-1;
    }
    else{
        cout<<b;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:25: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    5 |     string s,s1="PD",s2='P',s3="DP",s4='D',s5,s6;
      |                         ^~~
a.cc:5:40: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    5 |     string s,s1="PD",s2='P',s3="DP",s4='D',s5,s6;
      |                                        ^~~
a.cc:11:24: warning: integer overflow in expression of type 'int' results in '-727379968' [-Woverflow]
   11 |     if(b>1000*1000*1000*1000*10000){
      |          ~~~~~~~~~~~~~~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL<<60;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rp(i,N) for(ll i = 0; i < (ll)N; i++)
#define repi(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
#define p_queue(v) priority_queue<v, vector<v>, greater<v> >
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////

void solve(){
    ll n;
    cin >> n;
    Vi a(n);
    rp(i,n) cin >> a.at(i);
    sort(all(a));
    ll ans=1;
    rp(i,n){
        ans*=a.at(i);
        if(ans==0){
            print(0);
            return;
        }
        if(ans<0||ans>1000000000000000000){
            print(-1);
            return;
        }
    }
    return;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int unsigned long long int
#define mp make_pair
#define PI 3.14159265358979

int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
    int n;
  cin>>n;
  int ans=1;
  for(int i=0;i<n;i++)
  {
    int x;
    cin>>x;
    ans=ans*x
      if(ans>1e18)
      {
        cout<<-1<<endl;
        return 0;
      }
    
  }
  cout<<ans<<endl;

}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:19:14: error: expected ';' before 'if'
   19 |     ans=ans*x
      |              ^
      |              ;
   20 |       if(ans>1e18)
      |       ~~
Language: C++

#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long

using namespace std;

const ll INF = 1e18;

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

	ll ans = 1;
	bool ok = true;
	for (int ii = 0; ii < ; ++ii){
		ll A;
		cin >> A;
		ans *= A;
		if (ans > INF){
			ok = false;
			break;
		}
	}


	if (ok){
		cout << ans << "\n";
	} else {
		cout << -1 << "\n";
	}


	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:31: error: expected primary-expression before ';' token
   16 |         for (int ii = 0; ii < ; ++ii){
      |                               ^
Language: C++

/*
    @uthor: Amit Kumar
    user -->GitHub: drviruses ; CodeChef: dr_virus_ ; Codeforces,AtCoder,Hackerearth,Hakerrank: dr_virus;
*/
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
#define ln mp::cpp_int;
#define ll    long long
#define ld    long double
#define ull   unsigned long long
#define endl "\n"
ll google_itr = 1;
#define google(x) cout<<"\Case #"<<x<<"\:"
#define pi 3.14159265358979323846264338327950L

const ll mod = 1e9+7;
const ll inf = 1e18;

ll popcount(ll num){
    num = num - ((num >> 1) & 0x55555555);
    num = (num & 0x33333333) + ((num >> 2) & 0x33333333);
    return ((num + (num >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
}


void virus(){
    ln mul = 1;;
    ll n;
    cin>>n;
    for(auto i=0;i<n;i++){
        ln t;
        cin>>t;
        mul *= t;
    }
    if(mul > (ln)pow(10,18)) cout<<"-1";
    else cout<<mul;
}


int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
  /*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif*/

    ll t=1;
   // cin>>t;
    while(t--){
           auto start = high_resolution_clock::now();
           virus();
           auto stop = high_resolution_clock::now();
           auto duration = duration_cast<seconds>(stop - start);
         //cout << "Time: "<<duration.count()<<endl;
        //your code goes here
    }
    return 0;
}

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

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

int W_Length(char *str){
	int length = 0;
	while(*str++ != '\0')
		length++;
	return length;
}

double deg(double theta){//deg to theta
return theta*(2*3.14159265359)/360;
}

int cmp( const void *p, const void *q ) {
    return -*(int*)p + *(int*)q;
}
//qsort(a,n,sizeof(int),cmp);
//char s[n][11]

int cmp_s(const void * left, const void * right)
{
	char *left_char = (char *)left;
  char *right_char = (char *)right;
  return strcmp(left_char, right_char);
}
//qsort(s,n,sizeof(s[0]),cmp_s);

int end(void){
return 0;
}


int main (void){

    int a[210000],i,n,j;
  long long int s;
	
	scanf("%d", &n);
	for(i=0; i<n;i++){
		scanf("%d", &a[i]);
      s=s*a[i];
      if(s>1000000000000000000){
        printf("-1\n");
        end;
}

printf("%lld",s);
end;
}



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

import java.util.*;

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


Compiler output:
Main.java:13: error: integer number too large
      if(sum>1000000000000000000){
             ^
1 error
Language: C

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

int main() {
    int n;
    cin >> n;
    ll ans = 1;
    rep(i,n) {
        ll a;
        cin >> a;
        ans *= a;
    }
    if(ans > 1000000000000000000L) {
        cout << -1 << endl;
    }else {
        cout << ans << endl;
    }
    return 0;
}

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

/******************************************************************************

                            Online Java Compiler.
                Code, Compile, Run and Debug java program online.
Write your code in this editor and press "Run" button to execute it.

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


Compiler output:
Main.java:17: error: integer number too large
	    long max=1000000000000000000;
	             ^
1 error
Language: C++

#pragma GCC optimize("O2") 

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

typedef long long int ll;
typedef unsigned long long int ull;

#define test(t)		int t; cin>>t; while(t--)
#define f(i, a, b)	for(int i = a; i < b; ++i)
#define all(a)		a.begin(), a.end()
#define endl 		"\n"
#define deb(x)		cout << #x << "--" << x << "--" << endl;
#define deb2(x,y)	cout << #x << "-" << x << "-" << " ~~ " <<  #y << "-" << y << "-" << endl;
#define deb3(x,y,z)	cout << #x << "-" << x << "-" << " ~~ " <<  #y << "-" << y << "-" << " ~~ " << #z << "-" << z << "-" << endl;
#define deba(arr)	cout << #arr << " ~ [ "; for(auto n: arr) cout << n << " "; cout << "]" << endl;
#define fast 		ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define mx9		1000000007
#define mx7		10000007
#define mx6		1000006
#define mx5		200005
#define inf		1<<30                                 
#define eps		1e-9
#define mod		1000000007
#define PI		3.141592653589793238462643383279502884L

void solve()
{
  ll n;
  cin >> n;
  f(i, 0, n)
    cin >> a[i];
  ll pro = 1;
  f(i, 0, n)
  {
    pro *= a[i];
    if(pro > 1e18)
    {
      cout << "-1" << endl;
      return;
    }
  }
  cout << pro << endl;
}
int main()
{
    fast;
    //test(t)
        solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:33:12: error: 'a' was not declared in this scope
   33 |     cin >> a[i];
      |            ^
a.cc:37:12: error: 'a' was not declared in this scope
   37 |     pro *= a[i];
      |            ^
Language: C++


#include <bits/stdc++.h>
     
#define pll pair <long long,long long>
#define pb push_back
#define ll long long
#define ff first
#define ss second
#define vll vector <ll>
#define NFS ios_base::sync_with_stdio(0); cin.tie(NULL);
#define endl '\n'
#define M 1000000007   
using namespace std;

void solve()
{
	int n;
	ll a;
	cin>>n;
	ll re=1;
	for(int i=0;i<n;i++)
	{
		cin>>a;
		re*=a;
		if(re>10e18)
		{
			cout<<"-1"<<return;
		}
	}
	cout<<re;
}
 
int main()
{
    NFS
 	int t=1;
 	//cin>>t;
 	while(t--)
 	{
 		solve();
 	}
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:27:37: error: expected primary-expression before 'return'
   27 |                         cout<<"-1"<<return;
      |                                     ^~~~~~
Language: C

#include<bits/stdc++.h>
using namespace std;
template <typename T> using vec = vector<T>;

int main()
{
    int n;
    cin >> n;
    long ans =1;
    long a;
    vool flag = true;
    while (cin>>a)
    {
        ans *= a;
        if(ans>1000000000000000000)
        {
            flag = false;
            cout << -1 << endl;
            break;
        }
    }
    if(flag)
    {
        cout << ans << endl;
    }
    
}

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


    #include <bits/stdc++.h>
    #include <cstdio>
    #include <cstring>
    #include <cmath>
    #include <cstring>
    #include <chrono>
    #include <complex>
    #define endl "\n"
    #define int long long int
    #define vi vector<int>
    #define vll vector<ll>
    #define vvi vector < vi >
    #define pii pair<int,int>
    #define pll pair<long long, long long>
    #define mod 1000000007
    #define inf 1000000000000000000;
    #define all(c) c.begin(),c.end()
    #define mp(x,y) make_pair(x,y)
    #define mem(a,val) memset(a,val,sizeof(a))
    #define eb emplace_back
    #define f first
    #define s second
    
    using namespace std;
int power(int base, int exp)
{
    if (exp == 0)
       return 1;
    else if (exp == 1)
       return base;
    else
    {
       int calc;
       if (exp % 2 == 0)
       {
         calc = power(base, exp/2);
         calc =(calc* calc)%mod;
       }
       else
       {
         calc = (base*power(base, exp-1))%mod;
       }
       return calc%mod;
    }
}
    int32_t main()
    {
        std::ios::sync_with_stdio(false);
        int n;
        cin>>n;
        int a[n];
        for(int i=0;i<n;i++)
            cin>>a[i];
        int x=1;
        int f=0;
        for(int i=0;i<n;i++)
        {
            x*=a[i];
            if(x>inf)
            {
                
             f=1;
             break;
            }
        }
        if(f)
            cout<<-1<<endl;
        else
            cout<<x<<endl;
        
        return 0;
    }



Compiler output:
a.cc: In function 'int32_t main()':
a.cc:60:21: error: expected primary-expression before ')' token
   60 |             if(x>inf)
      |                     ^
Language: C++

#include <bits/stdc++.h>
#include <math.h>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep_1 (i,j,n) for(int i=j;i<n;i++)
typedef long long ll;
typedef long l;
const ll l_INF = 101010101000;
const int INF = 1010101010;
const int dx[4] = {-1,0,1,0};
const int dy[4] = {0,-1,0,1};
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int,int>;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |     ans*= a[i];
      |     ^~~
      |     abs
a.cc:34:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   34 |   cout << ans;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long

using namespace std;

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

	ll ans = 1;
	bool ok = true;
	for (int ii = 0; ii < ; ++ii){
		ll A;
		cin >> A;
		ans *= A;
		if (ans > INF){
			ok = false;
			break;
		}
	}


	if (ok){
		cout << ans << "\n";
	} else {
		cout << -1 << "\n";
	}


	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:31: error: expected primary-expression before ';' token
   14 |         for (int ii = 0; ii < ; ++ii){
      |                               ^
a.cc:18:27: error: 'INF' was not declared in this scope
   18 |                 if (ans > INF){
      |                           ^~~
Language: C++

#include <bits/stdc++.h>
#include <time.h>
#include <assert.h>


using namespace std;



#define For(i,x,n)  for(long long i=x;i<n;i++)
#define rFor(i,x,n) for(long long i=x;i>=n;i--)
#define itFor(it,st)   for(auto it=st.begin() ; it!=st.end() ; it++)
#define MOD 1000000007
#define PI 3.141592653589793
#define INF 999999999999999999
#define N 1000005
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sp " "
#define cont continue
#define brk break

#define deb1(x)                cout<<#x<<": "<<x<<endl
#define deb2(x, y)             cout<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define deb3(x, y, z)          cout<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define deb4(a, b, c, d)       cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define deb5(a, b, c, d, e)    cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define deb6(a, b, c, d, e, f) cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl

using namespace std;

int main()
{
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed;
    cout<<setprecision(8);
    srand(time(NULL));

	ll n;
	cin>>n;
	ll ml = 1;
	For(i,0,n){
		cin>>a[i];
		ml *= a[i];
		if(ml < 0){
			cout<<"-1";
			return 0;
		}
	}
	cout<<ml;
    
    //cout<<"\nTime used = "<<static_cast<double>(clock())/(CLOCKS_PER_SEC)<<"s"<<endl;  // - for checking time used for a test case
    return 0;
}

//s1.substr(1,3) - return 3 characters starting from position 1 as substring of string sz1. eg sz1="shreynumh" sz1.substr(2,5)="reyan"
//num = atoi(s.c_str()); //convert string s to integer num
//n.erase(i,std::string::npos); //erase i th position in string n , decreasing string size
//s.find(b)!= std::string::npos - finds string b in string a - true if found
//cout<<"Time used = "<<static_cast<double>(clock())/(CLOCKS_PER_SEC)<<"s"<<endl;  // - for checking time used for a test case                


Compiler output:
a.cc: In function 'int main()':
a.cc:49:22: error: 'a' was not declared in this scope
   49 |                 cin>>a[i];
      |                      ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < n; i++)
#define PI 3.14159265358979323846
#define vl vector<long long>
using namespace std;
using ll = long long;
using ld = long double;

// ----本問について----
// 問題：
// 問題文URL：
// ------------------

// ----ここから本問のソースコード----


// グローバル変数（入力）
ll N;

void solve() {
  ll answer = 1;
  ll flag = 0;
  rep(i, N) {
    ll a;
    cin >> a;
    answer *= a;
    if (answer > pow(10, 18)) {
      flag = 1;
      cout << "-1" << break;
    }
  }
  if (flag == 0) { cout << answer << endl; }
}

int main() {
  cin >> N
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:29:23: error: expected primary-expression before 'break'
   29 |       cout << "-1" << break;
      |                       ^~~~~
a.cc: In function 'int main()':
a.cc:36:11: error: expected ';' before 'solve'
   36 |   cin >> N
      |           ^
      |           ;
   37 |   solve();
      |   ~~~~~
Language: C++

n=int(input())
l=list(map(int, input().split()))
dap=1
nodap=0
for i in range(n):
    dap*=l[i]
    if dap>1000000000000000000:
        nodap++
        break
if nodap:
    print("-1")
else:
    print(dap)
    

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

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <chrono>
#include <climits>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;

template <class T1, class T2>
ostream& operator << (ostream& out, const pair <T1, T2> p)
{
	out << '(' << p.first << ',' << p.second << ')';
	return out;
}

template <class T1, class T2>
istream& operator >> (istream& in, pair<T1, T2> &p)
{
	in >> p.first >> p.second;
	return in;
}

template <class T>
istream& operator >> (istream& in, vector<T> &v)
{
	for (T &x : v)
		in >> x;
	return in;
}

template <class T>
ostream& operator << (ostream& out, const vector<vector<T>> &v)
{
	for (const vector<T> &x : v)
		out << x << '\n';
	return out;
}

template <class T>
ostream& operator << (ostream& out, const vector<T> &v)
{
	for (const T &x : v)
		out << x << ' ';
	return out;
}

long long gcd (long long a, long long b)
{
	if (b > a)
		swap(a, b);
	return (b ? gcd(b, a % b) : a);
}

using ll   = long long;
using pii  = pair<int, int>;
using pll  = pair<long long, long long>;
using tiii = pair<pair<int, int>, int>;
using vi   = vector<int>;
using vl   = vector<long long>;
using vvi  = vector<vector<int>>;
using vvl  = vector<vector<long long>>;

#define F          first
#define S          second
#define First      first.first
#define Second     first.second
#define Third      second
#define mp         make_pair
#define rep(i,a,b) for (int i = (a); i < (b); i++)
#define per(i,b,a) for (int i = (b); i > (a); i--)
#define all(x)     x.begin(), x.end()
#define ret(x)     return cout << x, 0;
#define throwex    throw runtime_error ("Found the error.");

const int h = 1000000007;

signed main()
{
	ios::sync_with_stdio(false);
	#ifdef ONLINE_JUDGE
	cin.tie(nullptr);
	cout.tie(nullptr);
	cerr.setstate(ios::failbit);
	#endif

	int n;
	cin >> n;
	vl v(n);
	cin >> v;
	ll a = 1;
	for(ll x : v)
	{
		if(a > (ll)1e18) / x)
			ret(-1);
		a *= x;
	}
	ret(a);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:110:34: error: expected primary-expression before '/' token
  110 |                 if(a > (ll)1e18) / x)
      |                                  ^
Language: C++

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <string.h>
#include <cstring>
#include <math.h>
#include <cmath>
#include <iomanip>
#include <set>
#include <vector>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <cassert>

using namespace std;
using ll = long long;

#define nl "\n"
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define trav(x) for(auto& i: x)

int n;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	cin >> n;
	vector<ll> v(n);
	for(int i = 0; i < n; i++) {
		cin >> v[i];
	}
	unsigned long long int sum = 1;
	for(int i = 0; i < n; i++) {
		sum *= a[i];
	}
	if(sum > 10e18) {
		cout << -1 << nl;
	} else {
		cout << sum << nl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:24: error: 'a' was not declared in this scope
   45 |                 sum *= a[i];
      |                        ^
Language: C++

from collections import deque
import sys

def input():
    return sys.stdin.readline().rstrip()

N = int(input())
li = list(map(int, input().split()))

ans = 1
for i in li:
    ans *= i

if ans > int(1e18):
    print(-1)
else:
    print(ans)

Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from collections import deque
      | ^~~~
Language: C++

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

typedef long long int ll;

#define FOR(i,l,r) for(i=l;i<r;i++)

#define REP(i,n) FOR(i,0,n)

#define ALL(x) x.begin(),x.end()

#define P pair<ll,ll>

#define F first

#define S second

signed main(){

  ll N,i,ans=1,a;cin>>N;
  REP(i,N){
    cin>>a;ans*=a;
    if(ans>1000000000000000000){
      ans=-1;break;
    }
  }
  cout<<ans<<endl;

  return 0;

}

Compiler output:
a.cc:1:24: error: missing terminating > character
    1 | #include <bits/stdc++.h
      |                        ^
Language: C++

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <functional>
#include <stack>
#include <iomanip>
#include <limits>
using namespace std;
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
using Graph=vector<vector<int>>;
using edge= struct{int to;ll cost;};
template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}
typedef priority_queue<ll> PQ_HIGH;
typedef priority_queue<ll,VL,greater<ll>> PQ_LOW;//昇順

int main(){
  ll N;cin>>N;
  ll ans=1
  REP(i,N){
    ll t;cin>>t;
    ans*=t;
    if(ans>pow(10,18)){
      cout<<"-1"<<endl;
      return 0;
    }
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: expected ',' or ';' before 'for'
   21 | #define REP(i,n) for(int i=0; i<n; ++i)
      |                  ^~~
a.cc:44:3: note: in expansion of macro 'REP'
   44 |   REP(i,N){
      |   ^~~
a.cc:44:7: error: 'i' was not declared in this scope
   44 |   REP(i,N){
      |       ^
a.cc:21:31: note: in definition of macro 'REP'
   21 | #define REP(i,n) for(int i=0; i<n; ++i)
      |                               ^
Language: C++

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

    ll mod=998244353;

    ll fact[500001]={0};
    void func(){
        fact[0]=1;
        for(ll i=1;i<500001;i++){
            fact[i]=((fact[i-1]%mod)*(i%mod))%mod;
        }
    }

    ll power(ll x,ll y){
        ll ans=1;
        while(y>0){
            if(y%2==1)
                ans=((ans%mod)*(x%mod))%mod;
            y/=2;
            x=((x%mod)*(x%mod))%mod;
        }
        return ans%mod;
    }

    ll ncr(ll n,ll r){
        if(n<r) return 0;
        ll temp1=fact[n];
        ll temp2=((fact[n-r]%mod)*(fact[r]%mod))%mod;
        temp2=power(temp2,mod-2);
        temp1=(temp1)*(temp2);
        temp1=temp1%mod;
        return temp1;
    }


    int main(){
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        ll n,ans=1,cnt=0;
        for(ll i=0;i<n;i++){
            cin>>ar[i];
            ans*=ar[i];
            cnt+=log10(ar[i]);
        }
        if(cnt<=18 && ans<=pow(10,18))
            cout<<ans;
        else
            cout<<"-1";
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:42:18: error: 'ar' was not declared in this scope
   42 |             cin>>ar[i];
      |                  ^~
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb             push_back
#define conv(a)        bitset<30>(a).to_string() ;
#define mxpq           priority_queue <int>
#define mnpq           priority_queue<int,vector<int>,greater<int>>
#define S(v)           sort(v.begin(),v.end())
#define RS(v)          sort(v.rbegin(),v.rend())
#define R(v)           reverse(v.begin(),v.end())
#define print          printf("%.16f\n", ans)
#define inf            LLONG_MAX
#define mini           LLONG_MIN
#define T              int tc;cin>>tc;while(tc--)
#define MSET(tabl,i)   memset(tabl, i, sizeof(tabl))
#define int            long long 
#define MAXN           10000001
#define M              1000000007
#define fio            cin.sync_with_stdio(false) ; cin.tie(0);cout.tie(0) ;
#define endl           "\n"
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> Set;


void Xarr(){
     
       int n ; cin>>n ;
       int ans=1 ;
       for(int i=0;i<n;i++){
           int x; cin>>x ;
           int p=1e18 ;
           if(ans>p/x){
               cout<<-1<<Endl ;
               return ;
           }
           ans=ans*x ;
       }
       cout<<ans<<endl ;
} 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
int32_t main(){
 
    cout<<fixed<<setprecision(16);
    cin.sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
 
    #ifndef ONLINE_JUDGE
     freopen("input.txt",  "r",  stdin);
     freopen("output.txt", "w", stdout);
    #endif
    
    cout << setprecision(9) << fixed;
     clock_t z = clock();
     
     Xarr();
     cerr << "Run Time : " << ((double)(clock() - z) / CLOCKS_PER_SEC);
 
     return 0;

}

Compiler output:
a.cc: In function 'void Xarr()':
a.cc:34:26: error: 'Endl' was not declared in this scope; did you mean 'endl'?
   34 |                cout<<-1<<Endl ;
      |                          ^~~~
      |                          endl
Language: C++

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

int main() {
  int a, b = 1, N;
  cin >> N;
  for(int i = 0;i < N; i++) {
    cin >> a;
    sum *= a;
  }
  cout << b << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'sum' was not declared in this scope
    9 |     sum *= a;
      |     ^~~
Language: C++

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

int main() {
  ll ans=1;
  int n; cin >> n;
  for (int i = 0; i < n; i++) {
    ll tmp; cin >> tmp;
    ans *= tmp;
  }
  if (ans > (ll)1e18) cout << -1;
  else cout << ans;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'll' was not declared in this scope
    5 |   ll ans=1;
      |   ^~
a.cc:8:7: error: expected ';' before 'tmp'
    8 |     ll tmp; cin >> tmp;
      |       ^~~~
      |       ;
a.cc:8:20: error: 'tmp' was not declared in this scope; did you mean 'tm'?
    8 |     ll tmp; cin >> tmp;
      |                    ^~~
      |                    tm
a.cc:9:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |     ans *= tmp;
      |     ^~~
      |     abs
a.cc:11:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |   if (ans > (ll)1e18) cout << -1;
      |       ^~~
      |       abs
a.cc:11:17: error: expected ')' before numeric constant
   11 |   if (ans > (ll)1e18) cout << -1;
      |      ~          ^~~~
      |                 )
Language: C++

/**
 * Author RDP
 * 
**/
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <bitset>
#include <iomanip>
#include <assert.h>
using namespace std;
#define endl '\n'
#define bp(x) __builtin_popcount(x)
#define zf(x) __builtin_clz(x)
#define zl(x) __builtin_ctz(x)
#define par(x) __bultin_parity(x)
#define all(x) (x).begin(), (x).end()
#define FAST_IO ios::sync_with_stdio(0); std::cin.tie(0);
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) 
{
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
typedef long long ll;
/* **************************************************************************************** */

void test_case()
{
	FAST_IO 
	ll n, ex;
	vector <ll> a(n);
	for(ll &x : a) cin >> x
	ll ans = 1;
	for(ll x : a)
	{
		ans = ans * x;
		if(ans > 1e18)
		{
			cout << "-1" <<endl;
			return ;
		}
	}
	cout << ans << endl;
 	return ;
}
int main()
{
	FAST_IO
    int t = 1;
    //cin >> t;
    while(t--)
        test_case();
	return 0;
}

Compiler output:
a.cc: In function 'void test_case()':
a.cc:50:32: error: expected ';' before 'll'
   50 |         for(ll &x : a) cin >> x
      |                                ^
      |                                ;
   51 |         ll ans = 1;
      |         ~~                      
a.cc:54:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   54 |                 ans = ans * x;
      |                 ^~~
      |                 abs
a.cc:61:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   61 |         cout << ans << endl;
      |                 ^~~
      |                 abs