Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
using namespace std;
#define i64  long long
#define lint long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807
#define MOD_Q 1e9 + 7
#define MOD_A 998244353

long long powM(long long a, long long b){
	if(a==0)return 0;
	else if(b==0)return 1;
	else if(b==1)return a%MOD_A;
 
	if(b%2==0){
		return powM((a*a)%MOD_A, b/2)%MOD_A;
	}else{
		return (a*powM(a,b-1) )%MOD_A;
	}
}
 
void solve()
{
 
  int N;
  cin>>N;
 
  vector<lint> vec(N,0);
  lint MAX = 0;
 
  for (int i = 0; i < N; i++)
  {
    lint A;
    cin>>A;
    vec[A]++;
    MAX = max(MAX,A);
    if((i==0)&&(A!=0))
    {
      cout<<0<<endl;
      return;
    }
  }
  
  lint count = 1;
  if(vec[0] != 1)
  {
    cout<<0<<endl;
    return;
  }
  for (int i = 0; i < MAX; i++)
  {
   if((vec[i] ==0)&&(vec[i+1]!=0))
   {
     cout<<0<<endl;
     return;
   }
    lint A;
    A = (lint)(powM(vec[i],vec[i+1])) % (MOD_A);
    // cout<<A<<endl;
 
    count = (count * A)%(MOD_A);
  }
 
  cout<<count%(MOD_A)<<endl;
  
 
  return;
}
 
int main(int argc, const char *argv[])
{
 
  solve();
 
  return 0;
}#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
using namespace std;
#define i64  long long
#define lint long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807
#define MOD_Q 1e9 + 7
#define MOD_A 998244353

long long powM(long long a, long long b){
	if(a==0)return 0;
	else if(b==0)return 1;
	else if(b==1)return a%MOD_A;
 
	if(b%2==0){
		return powM((a*a)%MOD_A, b/2)%MOD_A;
	}else{
		return (a*powM(a,b-1) )%MOD_A;
	}
}
 
void solve()
{
 
  int N;
  cin>>N;
 
  vector<lint> vec(N,0);
  lint MAX = 0;
 
  for (int i = 0; i < N; i++)
  {
    lint A;
    cin>>A;
    vec[A]++;
    MAX = max(MAX,A);
    if((i==0)&&(A!=0))
    {
      cout<<0<<endl;
      return;
    }
  }
  
  lint count = 1;
  if(vec[0] != 1)
  {
    cout<<0<<endl;
    return;
  }
  for (int i = 0; i < MAX; i++)
  {
   if((vec[i] ==0)&&(vec[i+1]!=0))
   {
     cout<<0<<endl;
     return;
   }
    lint A;
    A = (lint)(powM(vec[i],vec[i+1])) % (MOD_A);
    // cout<<A<<endl;
 
    count = (count * A)%(MOD_A);
  }
 
  cout<<count%(MOD_A)<<endl;
  
 
  return;
}
 
int main(int argc, const char *argv[])
{
 
  solve();
 
  return 0;
}

Compiler output:
a.cc:94:2: error: stray '#' in program
   94 | }#include <iostream>
      |  ^
a.cc:94:3: error: 'include' does not name a type
   94 | }#include <iostream>
      |   ^~~~~~~
a.cc:121:11: error: redefinition of 'long long int powM(long long int, long long int)'
  121 | long long powM(long long a, long long b){
      |           ^~~~
a.cc:28:11: note: 'long long int powM(long long int, long long int)' previously defined here
   28 | long long powM(long long a, long long b){
      |           ^~~~
a.cc:133:6: error: redefinition of 'void solve()'
  133 | void solve()
      |      ^~~~~
a.cc:40:6: note: 'void solve()' previously defined here
   40 | void solve()
      |      ^~~~~
a.cc:181:5: error: redefinition of 'int main(int, const char**)'
  181 | int main(int argc, const char *argv[])
      |     ^~~~
a.cc:88:5: note: 'int main(int, const char**)' previously defined here
   88 | int main(int argc, const char *argv[])
      |     ^~~~