Language: C++

//   Rishabh Agarwal
#include <bits/stdc++.h>
#define F first
#define S second
#define MAX 10000003
using namespace std;

typedef long double ll;
const ll mod = 1e18;
long double PI=3.1415926;

ll power(ll a,ll b){
    if(b==0){
        return 1;
    }
    ll temp=power(a,b/2)%mod;
    if(b%2==0){
        return (temp*temp)%mod;
    }
    else{
        return ((a*temp)%mod*temp)%mod;
    }
}

ll gcd(ll a, ll b) 
{ 
    if (b == 0) 
        return a; 
    return gcd(b, a % b);  
      
} 

vector<ll>v;
vector<ll>::iterator it;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll t;
    //cin>>t;
    t=1;
    //ll c=1;
    while(t--){
        ll n;
        cin>>n;
        ll a[n];
        for(ll x=0; x<n; x++){
            cin>>a[x];
        }
        ll ans=1;
        for(ll x=0; x<n; x++){
            if(a[x]==0){
                ans=0;
            }
            if(ans>1000000000000000000||ans<0){
                ans=-1;
            }
            if(ans!=-1){
                ans=ans*a[x];
            }
        }
        cout<<(long long int)ans<<"\n";
        v.clear();
        //cout<<"Case #"<<c<<": "<<ans<<"\n";
        //c++;
    }
    return 0;
}

Compiler output:
a.cc: In function 'll power(ll, ll)':
a.cc:16:25: error: invalid operands of types 'll' {aka 'long double'} and 'const ll' {aka 'const long double'} to binary 'operator%'
   16 |     ll temp=power(a,b/2)%mod;
      |             ~~~~~~~~~~~~^~~~
      |                  |       |
      |                  |       const ll {aka const long double}
      |                  ll {aka long double}
a.cc:17:9: error: invalid operands of types 'll' {aka 'long double'} and 'int' to binary 'operator%'
   17 |     if(b%2==0){
      |        ~^~
      |        | |
      |        | int
      |        ll {aka long double}
a.cc:18:27: error: invalid operands of types 'll' {aka 'long double'} and 'const ll' {aka 'const long double'} to binary 'operator%'
   18 |         return (temp*temp)%mod;
      |                ~~~~~~~~~~~^~~~
      |                     |      |
      |                     |      const ll {aka const long double}
      |                     ll {aka long double}
a.cc:21:25: error: invalid operands of types 'll' {aka 'long double'} and 'const ll' {aka 'const long double'} to binary 'operator%'
   21 |         return ((a*temp)%mod*temp)%mod;
      |                 ~~~~~~~~^~~~
      |                   |      |
      |                   |      const ll {aka const long double}
      |                   ll {aka long double}
a.cc: In function 'll gcd(ll, ll)':
a.cc:29:21: error: invalid operands of types 'll' {aka 'long double'} and 'll' {aka 'long double'} to binary 'operator%'
   29 |     return gcd(b, a % b);
      |                   ~ ^ ~
      |                   |   |
      |                   |   ll {aka long double}
      |                   ll {aka long double}
a.cc: In function 'int main()':
a.cc:48:14: error: conversion from 'll' {aka 'long double'} to 'long unsigned int' in a converted constant expression
   48 |         ll a[n];
      |              ^
a.cc:48:14: error: could not convert 'n' from 'll' {aka 'long double'} to 'long unsigned int'
   48 |         ll a[n];
      |              ^
      |              |
      |              ll {aka long double}
a.cc:48:14: error: size of array 'a' has non-integral type 'll' {aka 'long double'}
a.cc:50:19: error: invalid types 'll [1] {aka long double [1]}[ll {aka long double}]' for array subscript
   50 |             cin>>a[x];
      |                   ^
a.cc:54:17: error: invalid types 'll [1] {aka long double [1]}[ll {aka long double}]' for array subscript
   54 |             if(a[x]==0){
      |                 ^
a.cc:61:26: error: invalid types 'll [1] {aka long double [1]}[ll {aka long double}]' for array subscript
   61 |                 ans=ans*a[x];
      |                          ^