Language: C++

void solve() {
	int num;
	std::cin >> num;
	ll arr[N]{};
	ll st = 1e18;
	ll sum = 1;
	for (int x = 0; x < num; x++) std::cin >> arr[x];
	std::sort(arr, arr + num);
	for (int x = 0; x < num; x++) {
		if (arr[x] == 0) {
			std::cout << 0;
			return;
		}
		if (arr[x] > st / sum) {
			std::cout << -1;
			return;
		}
		sum *= arr[x];
	}
	std::cout << sum;

}

int main() {
	int t;
	/*std::cin>>t;
	while(t--)*/
	solve();
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:3:14: error: 'cin' is not a member of 'std'
    3 |         std::cin >> num;
      |              ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | void solve() {
a.cc:4:9: error: 'll' was not declared in this scope
    4 |         ll arr[N]{};
      |         ^~
a.cc:5:11: error: expected ';' before 'st'
    5 |         ll st = 1e18;
      |           ^~~
      |           ;
a.cc:6:11: error: expected ';' before 'sum'
    6 |         ll sum = 1;
      |           ^~~~
      |           ;
a.cc:7:44: error: 'cin' is not a member of 'std'
    7 |         for (int x = 0; x < num; x++) std::cin >> arr[x];
      |                                            ^~~
a.cc:7:44: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:51: error: 'arr' was not declared in this scope
    7 |         for (int x = 0; x < num; x++) std::cin >> arr[x];
      |                                                   ^~~
a.cc:8:14: error: 'sort' is not a member of 'std'
    8 |         std::sort(arr, arr + num);
      |              ^~~~
a.cc:8:19: error: 'arr' was not declared in this scope
    8 |         std::sort(arr, arr + num);
      |                   ^~~
a.cc:11:30: error: 'cout' is not a member of 'std'
   11 |                         std::cout << 0;
      |                              ^~~~
a.cc:11:30: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:30: error: 'st' was not declared in this scope; did you mean 'std'?
   14 |                 if (arr[x] > st / sum) {
      |                              ^~
      |                              std
a.cc:14:35: error: 'sum' was not declared in this scope; did you mean 'num'?
   14 |                 if (arr[x] > st / sum) {
      |                                   ^~~
      |                                   num
a.cc:15:30: error: 'cout' is not a member of 'std'
   15 |                         std::cout << -1;
      |                              ^~~~
a.cc:15:30: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:17: error: 'sum' was not declared in this scope; did you mean 'num'?
   18 |                 sum *= arr[x];
      |                 ^~~
      |                 num
a.cc:20:14: error: 'cout' is not a member of 'std'
   20 |         std::cout << sum;
      |              ^~~~
a.cc:20:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:22: error: 'sum' was not declared in this scope; did you mean 'num'?
   20 |         std::cout << sum;
      |                      ^~~
      |                      num