Language: C++

#include<bits/stdc++.h>
using namespace std;
 
// data types
#define ll long long int
#define ld long double
 
//funtion macros
 
 
// stl
#define lp(var,start,end) for (ll var = start; var <end ; ++var)
#define ilp(var,start,end) for(ll var = start; var>=end ; var--)
#define pb push_back
#define mp make_pair
#define pf push_front
#define ff first
#define ss second
#define vll vector<ll>
#define vld vector<ld>
#define pll pair<ll,ll> 
#define pld pair<ld,ld> 
#define vpll vector<pll>
#define vpld vector<pld>
#define all(X) X.begin(),X.end()
#define sz(x) ((ll)((x).size()))
 
#define mod 1000000007
 
// utility functions
ll max(ll a, ll b)
{
    if(a>b)return a;
    return b;
}
 
ll min(ll a, ll b)
{
	if(a<b)return a;
    return b;
}
 
ll power(ll x, ll y, ll m=mod)
{
	if(y<0)
    {
		x = power(x,m-2);
		y = -y;
	}
	ll ans=1;
	x = x % m;
	while(y)
    {
		if(y&1) ans = (ans*x)%m;
		y=y/2;
		x=(x*x)%m;
	}
	return ans;
}
 
 
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	ll n,a,ans=1,i;
    ll p = 1e18;
    ll flag = 1;
    cin >> n;
    ll arr[n];
    for(i=0;i<n;i++)
    {
        cin >> arr[i];
        if(arr[i]==0)
        {
            flag = 0;
            ans = 0;
            cout << "0\n";
            return 0;
        }
    }
    lp(i,0,n)
    {
        
        if(arr[i]<=p/ans)
        {
            ans = ans*arr[i];
        }
        else
        {
            cout << "-1\n";
            return 0;
        }
        
    }
    cout << ans << "\n";
	return 0;
}
#include<bits/stdc++.h>
using namespace std;

// data types
#define ll long long int
#define ld long double

//funtion macros


// stl
#define lp(var,start,end) for (ll var = start; var <end ; ++var)
#define ilp(var,start,end) for(ll var = start; var>=end ; var--)
#define pb push_back
#define mp make_pair
#define pf push_front
#define ff first
#define ss second
#define vll vector<ll>
#define vld vector<ld>
#define pll pair<ll,ll> 
#define pld pair<ld,ld> 
#define vpll vector<pll>
#define vpld vector<pld>
#define all(X) X.begin(),X.end()
#define sz(x) ((ll)((x).size()))

#define mod 1000000007

// utility functions
ll max(ll a, ll b)
{
    if(a>b)return a;
    return b;
}

ll min(ll a, ll b)
{
	if(a<b)return a;
    return b;
}

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


int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	ll n,a,ans=1,i;
    ll p = 1e18;
    ll flag = 1;
    cin >> n;
    ll arr[n];
    for(i=0;i<n;i++)
    {
        cin >> arr[i];
        if(arr[i]==0)
        {
            flag = 0;
            ans = 0;
            cout << "0\n";
            return 0;
        }
    }
    lp(i,0,n)
    {
        
        if(arr[i]<=p/ans)
        {
            ans = ans*arr[i];
        }
        else
        {
            cout << "-1\n";
            return 0;
        }
        
    }
    cout << ans << "\n";
	return 0;
}



Compiler output:
a.cc:129:4: error: redefinition of 'long long int max(long long int, long long int)'
  129 | ll max(ll a, ll b)
      |    ^~~
a.cc:31:4: note: 'long long int max(long long int, long long int)' previously defined here
   31 | ll max(ll a, ll b)
      |    ^~~
a.cc:135:4: error: redefinition of 'long long int min(long long int, long long int)'
  135 | ll min(ll a, ll b)
      |    ^~~
a.cc:37:4: note: 'long long int min(long long int, long long int)' previously defined here
   37 | ll min(ll a, ll b)
      |    ^~~
a.cc:141:4: error: redefinition of 'long long int power(long long int, long long int, long long int)'
  141 | ll power(ll x, ll y, ll m=mod)
      |    ^~~~~
a.cc:43:4: note: 'long long int power(long long int, long long int, long long int)' previously defined here
   43 | ll power(ll x, ll y, ll m=mod)
      |    ^~~~~
a.cc:160:5: error: redefinition of 'int main()'
  160 | int main()
      |     ^~~~
a.cc:62:5: note: 'int main()' previously defined here
   62 | int main()
      |     ^~~~