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

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

int log(int n){
  int m=0;
  while (n=>10){
    n /= 10;
    m++;
  }
  return m;
}

int main(){
  int N;
  long long A=0;
  cin >> N;
  vector<long long> v;
  for (int i=0;i<N;i++){
    long  long a;
    cin >> a;
    v.at(i)=a;
    A += log(a)
  }
  if (A=>18){
    cout << -1 << endl;
  } else {
    long long AA=1;
    for (int i=0;i<N;i++){
      AA *= v.at(i);
    }
    if (AA > 10000000000000000){
      cout << -1 << endl;
    } else {
      cout << AA << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int log(int)':
a.cc:6:12: error: expected primary-expression before '>' token
    6 |   while (n=>10){
      |            ^
a.cc: In function 'int main()':
a.cc:22:16: error: expected ';' before '}' token
   22 |     A += log(a)
      |                ^
      |                ;
   23 |   }
      |   ~             
a.cc:24:9: error: expected primary-expression before '>' token
   24 |   if (A=>18){
      |         ^
Language: C


int main(void)
{char buf[100];
    int n;
    int m;
    int multi = 1;

    fgets(buf, sizeof(buf), stdin);
    sscanf(buf, "%d", &n);
    for (int i = 0; i < n; i++) {
        fgets(buf, sizeof(buf), stdin);
        sscanf(buf, "%d", &m);
        int num[i]= m;
        multi*=num[i];
    }
    if (multi<1000000000000000000){
    printf("%d",multi);
        
    }
    else if (multi>=1000000000000000000){
    printf("-1");}
    
    
        
    }
    

Compiler output:
main.c: In function 'main':
main.c:8:5: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
    8 |     fgets(buf, sizeof(buf), stdin);
      |     ^~~~~
main.c:8:29: error: 'stdin' undeclared (first use in this function)
    8 |     fgets(buf, sizeof(buf), stdin);
      |                             ^~~~~
main.c:1:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
  +++ |+#include <stdio.h>
    1 | 
main.c:8:29: note: each undeclared identifier is reported only once for each function it appears in
    8 |     fgets(buf, sizeof(buf), stdin);
      |                             ^~~~~
main.c:9:5: error: implicit declaration of function 'sscanf' [-Wimplicit-function-declaration]
    9 |     sscanf(buf, "%d", &n);
      |     ^~~~~~
main.c:9:5: note: include '<stdio.h>' or provide a declaration of 'sscanf'
main.c:9:5: warning: incompatible implicit declaration of built-in function 'sscanf' [-Wbuiltin-declaration-mismatch]
main.c:9:5: note: include '<stdio.h>' or provide a declaration of 'sscanf'
main.c:13:21: error: variable-sized object may not be initialized except with an empty initializer
   13 |         int num[i]= m;
      |                     ^
main.c:17:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   17 |     printf("%d",multi);
      |     ^~~~~~
main.c:17:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:17:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   21 |     printf("-1");}
      |     ^~~~~~
main.c:21:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdioh.h>
#include <stdlib.h>
#include <math.h>
 
int main()
{
  int n, i;
  scanf("%d", &n);
  unsigned long a[n];
  unsigned long tmp = pow(10, 18);
  unsigned long sum = 1;
  for (i = 0; i < n; i++)
  {
    scanf("%lu", &a[i]);
    sum = sum * a[i];
  }
  if (sum > tmp)
  {
    printf("-1\n");
    return 0;
  }
  printf("%lu", sum);
}

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

#include <iostream>
using namespace std;
int main(void){
  int N;
  cin >> N;
  long long A[N];
  for(int i = 0; i < N ;i++)
  {
    cin >> A[i];
  }
  long long answer = 1;
  for(int i = 0 ; i < N; i++)
  {
    answer = answer * A[i];
  }
  long long MAX = 1000000000000000000;
  if(answer => MAX)
    cout << "-1";
  else
    cout << answer;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: expected primary-expression before '>' token
   17 |   if(answer => MAX)
      |              ^
Language: C++

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

int main() {

  long long int x = 1;
  

  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
    x = x * vec.at(i);
  }

if (x > std::pow(10, 18)){
  cout << -1 << endl;
}
  else { 
    cout << x <<endl;
}
}




Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: 'N' was not declared in this scope
    9 |   vector<int> vec(N);
      |                   ^
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
#define repr(i,a,b) for (int i=a; i<b; i++)
#define rep(i,n) for (int i=0; i<  n; i++)
 
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
 
const long long INF = 1LL << 60;
 
bool dp[100100];
 
int keta(long long A){
    int s=0;
    while(A>0){
        A/=10;
        s +=1;       
    }
    return (s-1);
 
}
 
int main () {
    int N;
    cin >> N;
 
    vector<long long>A(N);
    int aketa = 0;
    rep(i,N){
        long long s;
        cin >> s;
        aketa += keta(s);
        if(s == 0 || aketa >= 18){
            cout << 0 << endl;
            return 0;
        }else  A[i] = s;
    }
    
    unsigned long long ans = 1;     
    rep(i,N){
        ans *= A[i];
        if(ans > 1000000000000000000){
            cout << -1 << endl;
            return 0;
        }
    }
    
    cout << ans << endl;
 

Compiler output:
a.cc: In function 'int main()':
a.cc:49:25: error: expected '}' at end of input
   49 |     cout << ans << endl;
      |                         ^
a.cc:24:13: note: to match this '{'
   24 | int main () {
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int myfun(int x,int y)
{return x*y;}
int main()
{long long int n;
 cin>>n;
 vector<long long int>vec;
 for(long long int i=0;i<n;i++)
 {long long int k;
  cin>>k;
  vec.push_back(k);}
 long long int prod=accumulate(vec.begin(),vec.end(),1,mufun);
 if(prod>1000000000000000000)
   cout<<"-1";
 else
   cout<<prod;}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:56: error: 'mufun' was not declared in this scope; did you mean 'myfun'?
   13 |  long long int prod=accumulate(vec.begin(),vec.end(),1,mufun);
      |                                                        ^~~~~
      |                                                        myfun
Language: C

include<stdioh.h>
include<stdlib.h>
include<math.h>

int main()
{
  int n, i;
  scanf("%d", &n);
  unsigned long a[n];
  unsigned long tmp = pow(10, 18);
  unsigned long sum = 1;
  for (i = 0; i < n; i++)
  {
    scanf("%lu", &a[i]);
    sum = sum * a[i];
  }
  if (sum > tmp)
  {
    printf("-1\n");
    return 0;
  }
  printf("%lu", sum);
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdioh.h>
      |        ^
Language: C++

#include <iostream>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <set>
#include <queue>
#include <deque>
#include <map>
#include <stack>
#include <cmath>
using namespace std;

#define mod 1000000007
#define ten5 100005
#define ten52 200005
#define ten6 1000005
#define PI 3.1415926
#define pb(x) push_back(x)
#define all(x) x.begin(),x.end()
#define mkpr(x1,x2) make_pair(x1,x2)
typedef long long int ll;


//stack<char> stk;
//set<ll> sll;
//map<string,ll> mp,mp1;
//map<pair<ll,ll>,ll>::iterator iter;
//map<ll,ll> mp;
//deque<char> deq;
//vector<ll> vll;
ll num[ten52];
ll path[ten52];

int main(void)
{
    long long int m,n,i;
    long long int a1;
    a=a1=1;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>m;
        if(m!=0) num[i]=m;
        else
        {
            cout<<0;
            return 0;
        }
    }
    for(i=0;i<n;i++)
    {
        a1*=num[i];
        if(a1<0 || a1>1000000000000000000)
        {
            cout<<"-1";
            return 0;
        }
    }
    cout<<a1;
    return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:40:5: error: 'a' was not declared in this scope; did you mean 'a1'?
   40 |     a=a1=1;
      |     ^
      |     a1
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
typedef long long ll;
const ll MOD=1000000007;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }

int main(void){
    // Your code here!
    int n;cin >> n;
    ll ans = 1;
    vector<ll> a(n);
    sort(a.begin(),a.end(),greater<ll>);
    rep(i,n) {
        cin >> a[i];
        if(a[i]==0) {
            cout << 0 << endl;
            return 0;
        }
    }
    rep(i,n) {
        ans*=a[i];
        if(ans>1000000000000000000){
            cout << -1 << endl;
            return 0;
        }
    }
    
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:39: error: expected primary-expression before ')' token
   24 |     sort(a.begin(),a.end(),greater<ll>);
      |                                       ^
Language: Java

public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		long y = 1;
		int loop = sc.nextInt();
		for (int i = 0; i < loop; i++) {
			y *= sc.nextInt();
		}
		if (y <= Math.pow(10, 18)) {
			System.out.println(y);
		}else{
			System.out.println("-1");
		}
	}

}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <iostream>
#include <math.h>
 
using namespace std;
 
int main() {
 
  long long int n, result=1;
 
  long long int number[1000001]
 
   cin>>n;
 
  for(int i=0;i<n;i++){
 
    cin>>number[i];
 
    result*=number[i];
 
    if(log10(result)+1>=18){
 
      cout<<"-1"<<endl;
 
      return 0;
 
      }
 
   } 
 
  cout<<result<<endl;
 return 0;
  } 

Compiler output:
a.cc: In function 'int main()':
a.cc:12:4: error: expected initializer before 'cin'
   12 |    cin>>n;
      |    ^~~
a.cc:16:10: error: 'number' was not declared in this scope
   16 |     cin>>number[i];
      |          ^~~~~~
Language: C++

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

int main() {
  ll n;
  cin >> n;
  ll ans=1;
  bool flg=true;
  vll a(n);
  REP(i,n) {
    cin >> a[i];
    if(a[i]==0) ans=0;
  }
  sort(ALL(a));
  REP(i,n) {
    ans*=a[i];
    if(ans>1*pow(10,9) {
      flg=false;
    }
  }

  if(flg) {
    cout << ans <<endl;
  } else {
    cout << "-1" << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:67:23: error: expected ')' before '{' token
   67 |     if(ans>1*pow(10,9) {
      |       ~               ^~
      |                       )
a.cc:70:3: error: expected primary-expression before '}' token
   70 |   }
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll=long long int;
int main(void){
  int n;
  ll a[],mul=1;
  ll num=pow(10,18);
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  for(int i=0;i<n;i++){
    mul*=a[i];
  }
  if(mul<=num){
    cout<<mul<<endl;
  }else{
    cout<<-1<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: storage size of 'a' isn't known
    6 |   ll a[],mul=1;
      |      ^
Language: C++

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

int main() {
   
  long long int n,i;
  int flag=0;
  cin>>n;
  long double a;
  long double p=1;
  long double max=1000000000000000000;
  vector<long double> v;
  for(i=0;i<n;++i)
      { cin>>a;
        v.push_back(a);
        if(a==0)
           flag=1;
      }
      
    if(flag==1)
       cout<<"0";
       
    else
    {
      
    sort(v.begin(),v.end());
    
    for(i=v.size()-1;i>=0;--i)
      {
          p*=v[i];
          if(p>max)
             break;
             
      }
      if(i<0)
        cout<<(long long int )p;
        
      else
        cout<<"-1";
        
      
    }
      
  
      
       
	r
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:9: error: 'r' was not declared in this scope
   49 |         r
      |         ^
Language: C++

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

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

  vector<int> vec(N);
  for(int i=0; i<N; i++){
    cin >> vec.at(i);
  }

  int ans;
  ans = vec.at(0);

  for(int i=1; i<N; i++){
    ans *= vec.at(i);
  }

  if(ans > 1000000000* 1000000000){
    cout << "-1" << endl;
  }

  else{
    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:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> N;
      |   ^~~
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> vec(N);
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> vec(N);
      |          ^~~
a.cc:10:12: error: 'vec' was not declared in this scope
   10 |     cin >> vec.at(i);
      |            ^~~
a.cc:14:9: error: 'vec' was not declared in this scope
   14 |   ans = vec.at(0);
      |         ^~~
a.cc:20:22: warning: integer overflow in expression of type 'int' results in '-1486618624' [-Woverflow]
   20 |   if(ans > 1000000000* 1000000000){
      |            ~~~~~~~~~~^~~~~~~~~~~~
a.cc:21:5: error: 'cout' was not declared in this scope
   21 |     cout << "-1" << endl;
      |     ^~~~
a.cc:21:21: error: 'endl' was not declared in this scope
   21 |     cout << "-1" << endl;
      |                     ^~~~
a.cc:25:5: error: 'cout' was not declared in this scope
   25 |     cout << ans << endl;
      |     ^~~~
a.cc:25:20: error: 'endl' was not declared in this scope
   25 |     cout << ans << endl;
      |                    ^~~~
Language: Java

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

Compiler output:
Main.java:3: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
                     ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std
 
int main() {
  int n;
  unsigned long long r = 1;
  cin >> n;
  for (int i = 0; i < n; i++) {
    unsigned long long l = 0;
    cin >> l;
    if (0 < r)
    	r *= l;
    if (1000000000000000000LL < r || r < 0)
      r = -1;
  }
  cout << r << endl;
}

Compiler output:
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | 
    4 | int main() {
      | ~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  long n;
  cin>>n;
  unsigned long long int arr[n],p=1;
  for (long i=0;i<n;i++){
    cin>>arr[i];
  p=p*arr[i];
    if (p>pow(10,18)){
      cout<<"-1";
      break;}
  }}
if(p<=pow(10,18))cout<<p<<endl;return 0;
}

Compiler output:
a.cc:14:1: error: expected unqualified-id before 'if'
   14 | if(p<=pow(10,18))cout<<p<<endl;return 0;
      | ^~
a.cc:14:32: error: expected unqualified-id before 'return'
   14 | if(p<=pow(10,18))cout<<p<<endl;return 0;
      |                                ^~~~~~
a.cc:15:1: error: expected declaration before '}' token
   15 | }
      | ^
Language: C++

a = input("");
b = input("");
print(a*b)

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a = input("");
      | ^
a.cc:2:1: error: 'b' does not name a type
    2 | b = input("");
      | ^
a.cc:3:6: error: expected constructor, destructor, or type conversion before '(' token
    3 | print(a*b)
      |      ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int64_t> vec(N);
  //int64_t ans = 1;
  
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  
  for (int i = 0; i < N; i++) {
    int64_t ans = ans * vec.at(i);
  }
  
  if (ans > 1000000000000000000) {
    cout << "-1";
  }
  else {
    cout << ans;
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |   if (ans > 1000000000000000000) {
      |       ^~~
      |       abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define long long ll
int main(){
  int n; 
  cin >> n;
  int64_t a;
  int64_t ans=1;
  for(int i=0; i<n; i++){
    cin >> a;
    ans *=a;
  }

  if(ans<=pow(10, 17)){
    //cout << pow(10, 18);
    printf(ans);
  } else {
    cout << -1;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: invalid conversion from 'int64_t' {aka 'long int'} to 'const char*' [-fpermissive]
   17 |     printf(ans);
      |            ^~~
      |            |
      |            int64_t {aka long int}
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int64_t> vec(N);
  //int64_t ans = 1;
  
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  
  for (int i = 0; i < N; i++) {
    ans = ans * vec.at(i);
  }
  
  if (ans > 1000000000000000000) {
    cout << "-1";
  }
  else {
    cout << ans;
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |     ans = ans * vec.at(i);
      |     ^~~
      |     abs
a.cc:18:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |   if (ans > 1000000000000000000) {
      |       ^~~
      |       abs
Language: C++

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

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

  vector<int> vec(N);
  for(int i=0; i<N; i++){
    cin >> vec.at(i);
  }

  int ans;
  ans = vec.at(0);

  for(int i=1; i<N; i++){
    ans *= vec.at(i);
  }

  if(ans > 1000000000* 1000000000){
    cout << "-1" << endl;
  }

  else{
    cout << ans << endl;
  }
}

  int ans;
  ans = a*b;

  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:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> N;
      |   ^~~
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> vec(N);
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> vec(N);
      |          ^~~
a.cc:10:12: error: 'vec' was not declared in this scope
   10 |     cin >> vec.at(i);
      |            ^~~
a.cc:14:9: error: 'vec' was not declared in this scope
   14 |   ans = vec.at(0);
      |         ^~~
a.cc:20:22: warning: integer overflow in expression of type 'int' results in '-1486618624' [-Woverflow]
   20 |   if(ans > 1000000000* 1000000000){
      |            ~~~~~~~~~~^~~~~~~~~~~~
a.cc:21:5: error: 'cout' was not declared in this scope
   21 |     cout << "-1" << endl;
      |     ^~~~
a.cc:21:21: error: 'endl' was not declared in this scope
   21 |     cout << "-1" << endl;
      |                     ^~~~
a.cc:25:5: error: 'cout' was not declared in this scope
   25 |     cout << ans << endl;
      |     ^~~~
a.cc:25:20: error: 'endl' was not declared in this scope
   25 |     cout << ans << endl;
      |                    ^~~~
a.cc: At global scope:
a.cc:30:3: error: 'ans' does not name a type
   30 |   ans = a*b;
      |   ^~~
a.cc:32:3: error: 'cout' does not name a type
   32 |   cout << ans << endl;
      |   ^~~~
a.cc:34:1: error: expected declaration before '}' token
   34 | }
      | ^
Language: C++

include <iostream.h>
using namespace std;
int main() {
  long long int n, result=1;
  long long int number[1000001]
   cin>>n;
  for(int i=0;i<n;i++){
    cin>>number[i];
    result*=number[i];
    if(log10(result)+1>=18){
      cout<<"-1"<<endl;
      return 0;
      }
   } 
  
  cout<<result<<endl;
  
  
  
  
  return 0;
 } 

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:4: error: expected initializer before 'cin'
    6 |    cin>>n;
      |    ^~~
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin>>number[i];
      |     ^~~
a.cc:8:10: error: 'number' was not declared in this scope
    8 |     cin>>number[i];
      |          ^~~~~~
a.cc:10:8: error: 'log10' was not declared in this scope
   10 |     if(log10(result)+1>=18){
      |        ^~~~~
a.cc:11:7: error: 'cout' was not declared in this scope
   11 |       cout<<"-1"<<endl;
      |       ^~~~
a.cc:11:19: error: 'endl' was not declared in this scope
   11 |       cout<<"-1"<<endl;
      |                   ^~~~
a.cc:16:3: error: 'cout' was not declared in this scope
   16 |   cout<<result<<endl;
      |   ^~~~
a.cc:16:17: error: 'endl' was not declared in this scope
   16 |   cout<<result<<endl;
      |                 ^~~~
Language: C++

// atcoder.cpp.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
#include<stdio.h>
#include<string.h>
#include <math.h>
#include<stdlib.h>
#include<time.h>
#include<random>
using namespace std;
//std::random_device rnd;

//グロ変




int main()
{


	int n;
	cin >> n;
	//long long int a[100000];
	unsigned _int64 *a;
	a = new unsigned _int64[100000] ;

	 unsigned _int64 ans = 1;
	 int er = -1;

	 for (int t = 0; t < 100000; t++) {
		 a[t] = 1;
	 }




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



	for (int s = 0; s < n; s++) {

		ans *= a[s];
		unsigned _int64 ch = 18446744073709551615 / ans;

		if (ch < a[s + 1]) {
			cout << er;
			return 4;
		}
		

	}
	delete[] a;

	cout << ans;
	return 0;

}




Compiler output:
a.cc:48:38: warning: integer constant is so large that it is unsigned
   48 |                 unsigned _int64 ch = 18446744073709551615 / ans;
      |                                      ^~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:26:25: error: expected initializer before '*' token
   26 |         unsigned _int64 *a;
      |                         ^
a.cc:27:9: error: 'a' was not declared in this scope
   27 |         a = new unsigned _int64[100000] ;
      |         ^
a.cc:29:26: error: expected initializer before 'ans'
   29 |          unsigned _int64 ans = 1;
      |                          ^~~
a.cc:47:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   47 |                 ans *= a[s];
      |                 ^~~
      |                 abs
a.cc:48:33: error: expected initializer before 'ch'
   48 |                 unsigned _int64 ch = 18446744073709551615 / ans;
      |                                 ^~
a.cc:50:21: error: 'ch' was not declared in this scope
   50 |                 if (ch < a[s + 1]) {
      |                     ^~
a.cc:57:9: error: type '<type error>' argument given to 'delete', expected pointer
   57 |         delete[] a;
      |         ^~~~~~~~~~
a.cc:59:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   59 |         cout << ans;
      |                 ^~~
      |                 abs
Language: Java

import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Long N = sc.nextLong();
		long [] x = new long[N];
		long kekka =1;
		if((2<=N)&&(N<=Math.pow(10,15))) {
		for(int i=0;i<N;i++) {
				x[i] = sc.nextLong();
				kekka = kekka * x[i];
		}
		
			
			if(Math.pow(10,18)<kekka) {
				kekka = -1;
			}
			System.out.println(kekka);
		}
		sc.close();
	}

}


Compiler output:
Main.java:7: error: incompatible types: Long cannot be converted to int
		long [] x = new long[N];
		                     ^
1 error
Language: C++

#include <climits>
#include <math.h>
using namespace std;

int main (){
	int i, n;
	cin >> n;
  	vector<long long int> vec(n);

	for (i = 0; i < n; i++) {
  		cin >> vec.at(i);
	}
  
  	long long int ans=1;
	for (i = 0; i < n; i++) {
  		ans *= vec.at(i);
	}
      
    float thold = pow(10.0,18.0);
    if((double) ans > thold){
      	ans = -1;
		cout <<  ans<<endl;
    }else{
       	cout << ans<< endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> n;
      |         ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <math.h>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:8:9: error: 'vector' was not declared in this scope
    8 |         vector<long long int> vec(n);
      |         ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <math.h>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:8:16: error: expected primary-expression before 'long'
    8 |         vector<long long int> vec(n);
      |                ^~~~
a.cc:11:24: error: 'vec' was not declared in this scope
   11 |                 cin >> vec.at(i);
      |                        ^~~
a.cc:16:24: error: 'vec' was not declared in this scope
   16 |                 ans *= vec.at(i);
      |                        ^~~
a.cc:22:17: error: 'cout' was not declared in this scope
   22 |                 cout <<  ans<<endl;
      |                 ^~~~
a.cc:22:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:22:31: error: 'endl' was not declared in this scope
   22 |                 cout <<  ans<<endl;
      |                               ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <math.h>
  +++ |+#include <ostream>
    3 | using namespace std;
a.cc:24:9: error: 'cout' was not declared in this scope
   24 |         cout << ans<< endl;
      |         ^~~~
a.cc:24:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:23: error: 'endl' was not declared in this scope
   24 |         cout << ans<< endl;
      |                       ^~~~
a.cc:24:23: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C

#include <stdio.h>
int main(void){
    // Your code here!
    unsigned long int n;
    unsigned long int a;
    unsigned long int res = 1;
    scanf("%ld", &n);
    
    int i;
    for(i = 0; i < n; i++){
        scanf("%ld ", &a);
        if(a == 0){
            printf("0");
            return 0;;
        }
        if(a != 1){
            if(res < 500000000000000000){
                res = res * a;
            }else{
                printf("-1");
                return 0;
            }
            //if(res > 1000000000000000000){
            //    printf("-1");
            //    return 0;
            //}
        }
    }
    printf("%ld", res);
    return 0;

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

import java.util.*;

public class Main {
  static Scanner sc = new Scanner(System.in);
  public static void main(String[] args){
    int A = sc.nextInt();
    Integer[] b = new Integer[A];
    int c=1;
    double d=1000000000000000000;
    for(int i=0; i < A; i++){
      b[i] = sc.nextInt();
      c = c*b[i];
  	}
  	if(c>d){
    	System.out.println(-1);
  	}
  	else{  
   		System.out.println(c);
  	}
  }
}   


Compiler output:
Main.java:9: error: integer number too large
    double d=1000000000000000000;
             ^
1 error
Language: Java

import java.util.*;
public class Main {
 
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		long num = scan.nextLong();
		for(int i = 0; i < n - 1; i++) {
			long a = scan.nextLong();
			num = num * a;
			}
		}
		System.out.println(num);
		}
	}
 
}

Compiler output:
Main.java:13: error: <identifier> expected
		System.out.println(num);
		                  ^
Main.java:13: error: <identifier> expected
		System.out.println(num);
		                      ^
Main.java:15: error: class, interface, enum, or record expected
	}
	^
3 errors
Language: Java

import java.util.Scanner;

public class B {

	public static void main(String[] args) {

			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			long[] kazu = new long[n];
			long jyo =1;
			for(int i = 0; i < n; i++) {
				kazu[i] = sc.nextLong();
				jyo *= kazu[i];
				if(jyo > 1000000000000000000L || jyo < 0) {
					System.out.println("-1");
					break;
				}
			}
			if(jyo <= 1000000000000000000L && jyo > 0) {
				System.out.println(jyo);

			}
	}

}


Compiler output:
Main.java:3: error: class B is public, should be declared in a file named B.java
public class B {
       ^
1 error
Language: Java

/* ********************************* JAI SAI RAM ************************************* */
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double lb;
#define endl "\n"
ll P=1000000007;
ll MAX=1000000000000000000LL;
int main()
{
    ll i,j,k,l,m,n,o,p,q,r,s,t;
    cin>>n;
    ll ans=1;
    ll flag=0;
    for(i=1;i<=n;i++)
    {
        cin>>j;
        if((ans*j)>MAX||(ans*j)<0LL)
        flag=1;
        ans*=j;
        if(ans<0||ans>MAX)
        flag=1;
        if(j==0LL)
        {
            flag=0LL;
            ans=0LL;
        }
    }
    if(flag==1)
    cout<<"-1";
    else 
    cout<<ans;
    return 0;
}


Compiler output:
Main.java:2: error: illegal character: '#'
#include<bits/stdc++.h>
^
Main.java:2: error: class, interface, enum, or record expected
#include<bits/stdc++.h>
        ^
Main.java:4: error: class, interface, enum, or record expected
typedef long long int ll;
^
Main.java:5: error: class, interface, enum, or record expected
typedef long double lb;
^
Main.java:6: error: illegal character: '#'
#define endl "\n"
^
Main.java:6: error: class, interface, enum, or record expected
#define endl "\n"
        ^
Main.java:8: error: unnamed classes are a preview feature and are disabled by default.
ll MAX=1000000000000000000LL;
^
  (use --enable-preview to enable unnamed classes)
Main.java:8: error: ';' expected
ll MAX=1000000000000000000LL;
                           ^
Main.java:12: error: not a statement
    cin>>n;
       ^
Main.java:17: error: not a statement
        cin>>j;
           ^
Main.java:18: error: not a statement
        if((ans*j)>MAX||(ans*j)<0LL)
                                  ^
Main.java:23: error: not a statement
        if(j==0LL)
                ^
Main.java:25: error: not a statement
            flag=0LL;
                   ^
Main.java:26: error: not a statement
            ans=0LL;
                  ^
Main.java:30: error: not a statement
    cout<<"-1";
        ^
Main.java:32: error: not a statement
    cout<<ans;
        ^
Main.java:18: error: ';' expected
        if((ans*j)>MAX||(ans*j)<0LL)
                                   ^
Main.java:23: error: ';' expected
        if(j==0LL)
                 ^
18 errors
Language: Java

import java.util.*;

public class Main {
  static Scanner sc = new Scanner(System.in);
  public static void main(String[] args){
    int A = sc.nextInt();
    Integer[] b = new Integer[A];
    int c=1;
    int d=1000000000000000000;
    for(int i=0; i < A; i++){
      b[i] = sc.nextInt();
      c = c*b[i];
  	}
  	if(c>d){
    	System.out.println(-1);
  	}
  	else{  
   		System.out.println(c);
  	}
  }
}   


Compiler output:
Main.java:9: error: integer number too large
    int d=1000000000000000000;
          ^
1 error
Language: Java

import java.util.Scanner;

public class B {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Integer n = scanner.nextInt();
        Long[] a = new Long[n];
        Long limit = (long)Math.pow(10,18);

        if (n > 100000 | n < 2) {
            System.exit(0);
        }

        for (int i = 0; i < n; i++) {
            a[i] = scanner.nextLong();
            if (a[i] > limit) {
                System.exit(0);
            }
        }

        for (int i = 0; i < n; i++) {
            if (i != 0) {
                a[i] = a[i] * a[i-1];
            }
        }

        if (a[n-1] <= limit) {
            System.out.println(a[n - 1]);
        } else {
            System.out.println((int)Math.signum(-10));
        }
    }
}


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

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

unsigned GetDigit(unsigned num)
{
    return log10(num) + 1;
}

int main()
{
    int n;
    ll ans = 1;
    cin >> n;
    vector<ll> A(n);
    ll max = 1000000000000000000;

    rep(i, n)
    {
        ll a;
        cin >> a;
        if (a == 0)
        {
            cout << 0 << endl;
            return 0;
        }
        A[i] = a;
    }

    rep(i, n)
    {
    }

    rep(i, n)
    {
        int a = GetDigit(ans);
        int b GetDigit(A[i]);
        if (a + b >= 18)
        {
            cout << -1 << endl;
            return 0;
        }
        ans = ans * A[i];
        if (ans > max)
        {
            cout << -1 << endl;
            return 0;
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:15: error: expected initializer before 'GetDigit'
   39 |         int b GetDigit(A[i]);
      |               ^~~~~~~~
a.cc:40:17: error: 'b' was not declared in this scope
   40 |         if (a + b >= 18)
      |                 ^
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(){
#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 ;
vector<int> A(N);
  
 for(int i = 0; i < N ; i++){
cin >> A.at(i);
}
 long long int T = 1;
 
  for(int i = 0; i < N ; i++){
  T = T*A.at(i);
  }
  long long int X = 1000000000000000000;
 if(T <= X ){
 cout << T << endl;
 }
  else {
  cout << -1 << endl;
  }  
  
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   14 | int main(){
      |         ^~
a.cc:14:9: note: remove parentheses to default-initialize a variable
   14 | int main(){
      |         ^~
      |         --
a.cc:14:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:14:11: error: a function-definition is not allowed here before '{' token
   14 | int main(){
      |           ^
a.cc:35:4: error: expected '}' at end of input
   35 |   }
      |    ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long a[100010],s=1,check=1e18;
int ws(long long x)
{
	int s=0;
	while(x)
	{
		s++;
		x/=10;
	}
	return s;
}
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		if(a[i]==0)
		{
			cout<<0<<endl;
			return 0;
		}
	}
	for(int i=1;i<=n;i++)
	{
		s*=a[i];
		check/=a[i];
	}
	if(check<1)
	{
		cout<<-1<<endl;
	}
	else
	{
		cout<<ans<<endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:23: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |                 cout<<ans<<endl;
      |                       ^~~
      |                       abs
Language: C++

//======================================
//author @Amit Singh : global_const
//======================================

#pragma GCC optimize("Ofast")  
#pragma GCC target("avx,avx2,fma")
#include<iostream>
#include<cstdint>
using namespace std;
#define yeah ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long
#define vi vector<int>
#define pb push_back
#define loop(i,n) for(int i=0;i<n;++i)
signed main()
{ yeah;
  int t;
  cin>>t;
  unsigned long long int arr[t];
  unsigned long long int multi=1;
  bool flag=0;
  loop(i,t)
  {cin>>arr[i];
   if(arr[i]==0)
   {flag=1;
    break; 
   }
  }	
 if(flag==1)
 cout<<0<<endl;
 else
 {loop(i,t)
   {multi*=arr[i];
    if((ULLONG_MAX - multi)< multi||multi>1000000000000000000ULL)
    {cout<<-1<<endl;
   	return 0;
   	}
   }
   cout<<multi<<endl;
  }
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:9: error: 'ULLONG_MAX' was not declared in this scope
   35 |     if((ULLONG_MAX - multi)< multi||multi>1000000000000000000ULL)
      |         ^~~~~~~~~~
a.cc:9:1: note: 'ULLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    8 | #include<cstdint>
  +++ |+#include <climits>
    9 | using namespace std;
Language: C++


#include<bits/stdc++.h>
using namespace std;
#define int long long
const int mx = 1e18;
int n,a;
int ans = 1;
int calcws(int x){
	int cnt = -1;
	while(x)
		x/=10,cnt++;
	return cnt;
}
int g(int x){
	while(x>10) x /= 10;
}
signed main(){
	cin >> n;
	a = 1ull;
	for(int i = 1;i<=n;i++){
		int x;
		cin >> x;
		int rr = (g(a)+g(x)>10);
		if(calcws(a)+calcws(x)+rr>=18) ans = -1;
		a = a*x;
		if((a&&a<x)||a>mx)
			ans = -1;
		if(x==0) ans = 0;
	}
	if(ans==-1||ans==0) cout << ans << endl;
	else cout << a << endl;
	return 0;

Compiler output:
a.cc: In function 'long long int g(long long int)':
a.cc:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | }
      | ^
a.cc: In function 'int main()':
a.cc:32:18: error: expected '}' at end of input
   32 |         return 0;
      |                  ^
a.cc:17:14: note: to match this '{'
   17 | signed main(){
      |              ^
Language: C++

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

int main()
{
    int n;
    ll ans = 1;
    cin >> n;
    vector<ll> A(n);
    ll max = 1000000000000000000;

    unsigned GetDigit(unsigned num)
    {
        return log10(num) + 1;
    }

    rep(i, n)
    {
        ll a;
        cin >> a;
        if (a == 0)
        {
            cout << 0 << endl;
            return 0;
        }
        A[i] = a;
    }

    rep(i, n)
    {
    }

    rep(i, n)
    {
        int a = GetDigit(ans);
        int b GetDigit(A[i]);
        if (a + b >= 18)
        {
            cout << -1 << endl;
            return 0;
        }
        ans = ans * A[i];
        if (ans > max)
        {
            cout << -1 << endl;
            return 0;
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: a function-definition is not allowed here before '{' token
   16 |     {
      |     ^
a.cc:38:17: error: 'GetDigit' was not declared in this scope
   38 |         int a = GetDigit(ans);
      |                 ^~~~~~~~
a.cc:39:15: error: expected initializer before 'GetDigit'
   39 |         int b GetDigit(A[i]);
      |               ^~~~~~~~
a.cc:40:17: error: 'b' was not declared in this scope
   40 |         if (a + b >= 18)
      |                 ^
Language: C

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


int main(void) {
  int n;
  scanf("%d",&n);
 long long int a[n],p=1,v=pow(10,18);
  for(int i=0;i<n;i++)
  {
    scanf("%lld",&a[i]);
    p=p*a[i];
  }
  if(p>)
  printf("-1\n");
  else
  printf("%lld\n",p);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:8: error: expected expression before ')' token
   14 |   if(p>)
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  long long int ans = 1;
  cin >> N;
  long long int a;
  for(int i = 0;i<N;i++){
    a = 0;
	cin >> a;
  	ans *= a;
  }
  long long jud = 1000000000000000000;
  if(ans > jud){
    cout << "-1" << endl;
  }
  if(ans == 0){
    cout << 0 << endl;
  }else{
    long long ans_2 = ans;
    int digit = 0;
    while(ans! = 0){
      ans/=10;
      digit++;
    }
    int num[digit];
    for(int i = 0;i<digit;i++){
        num[i] = ans_2%10;
      	ans_2/=10;
      }
  	for(int i = digit -1;i>=0;i--){
    cout << num[i];
    }
    cout << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:14: error: expected ')' before '!' token
   23 |     while(ans! = 0){
      |          ~   ^
      |              )
a.cc:23:16: error: expected primary-expression before '=' token
   23 |     while(ans! = 0){
      |                ^
Language: C++

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


int main(){
  int n;
  cin>>n;
  vector<long long>a(n+1);
  for(int i=1;i<=n;i++){
    cin>>a[i];
  }
  int num=0;
  sort(a.begin(),a.end());
  long long at=a[1];
  for(int i=2;i<=n;i++){
    at*=a[i];
    if(at>=100&&a[i]>=10000000000000000){
      num++;
      break;
      
    }
    else if(at>=100000&&a[i]>=10000000000000){
      num++;
      break;
    }
     else if(at>=100000000&&a[i]>=10000000000){
      num++;
      break;
      
    }
     else if(at>=100000000000&&a[i]>=10000000){
      num++
      break;
  
    }
    else if(a[i]>=1000000000000000000){
      num++;
      break;
       
    }
  }
  if(num>=1){
    cout<<-1<<endl;
  }
  else cout<<at<<endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:33:12: error: expected ';' before 'break'
   33 |       num++
      |            ^
      |            ;
   34 |       break;
      |       ~~~~~
Language: C++

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

int main()
{
    int n;
    ll ans = 1;
    cin >> n;
    vector<ll> A(n);
    ll max = 1000000000000000000;

    unsigned GetDigit(unsigned num)
    {
        return log10(num) + 1;
    }

    rep(i, n)
    {
        ll a;
        cin >> a;
        if (a == 0)
        {
            cout << 0 << endl;
            return 0;
        }
        A[i] = a;
    }

    rep(i, n)
    {
    }

    rep(i, n)
    {
        int a = GetDigit(ans);
        int bGetDigit(A[i]);
        if (a + b >= 18)
        {
            cout << -1 << endl;
            return 0;
        }
        ans = ans * A[i];
        if (ans > max)
        {
            cout << -1 << endl;
            return 0;
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: a function-definition is not allowed here before '{' token
   16 |     {
      |     ^
a.cc:38:17: error: 'GetDigit' was not declared in this scope
   38 |         int a = GetDigit(ans);
      |                 ^~~~~~~~
a.cc:40:17: error: 'b' was not declared in this scope
   40 |         if (a + b >= 18)
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    long long N;
    cin >> N;
    
    long long A[N],sum=1,P=0,a=0;
    P = power(10,18);
    
    for(long long i=0; i<N; i++){
        cin >> A[i];
        if(sum<sum*A[i] && sum*A[i]<=P){
            sum = sum*A[i];
        }else if(sum*A[i]>P || sum*A[i]<sum){
            a=1;
            sum=P;
        }
    }
    
    if(a==1){
        cout << "-1" << endl;
    }else{
        cout << sum << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'power' was not declared in this scope
    8 |     P = power(10,18);
      |         ^~~~~