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

#include<iostream>
using namespaqe std;
int main(){
    int n; cin>>n;
    if(n%2==0){
        cout<<n/2-1<<endl;
    }
    else {
        cout<<n/2<<endl;
    }
}


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespaqe'
    2 | using namespaqe std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:4:12: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |     int n; cin>>n;
      |            ^~~
      |            std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |         cout<<n/2-1<<endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |         cout<<n/2-1<<endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:9:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |         cout<<n/2<<endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:9:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |         cout<<n/2<<endl;
      |                    ^~~~
      |                    std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

#include<stdio.h>
int main(void){
    int n;
    scanf("%d",&n);
    if(n%2==0)  printf("%d",n/2-1)
    else printf("%d",n/2);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:35: error: expected ';' before 'else'
    5 |     if(n%2==0)  printf("%d",n/2-1)
      |                                   ^
      |                                   ;
    6 |     else printf("%d",n/2);
      |     ~~~~
Language: C

#include<stdio.h>
int main(){
  int n(1<=n<=10^6),i;
  scanf("%d",&n);
  i=n/2-1;
  printf("%d\n",i);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:3:9: error: expected declaration specifiers or '...' before numeric constant
    3 |   int n(1<=n<=10^6),i;
      |         ^
main.c:4:15: error: 'n' undeclared (first use in this function)
    4 |   scanf("%d",&n);
      |               ^
main.c:4:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:3: error: 'i' undeclared (first use in this function)
    5 |   i=n/2-1;
      |   ^
Language: Java

import java.util.Scanner;

public class A {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();

		int cnt = 0;
		for(int i = 1;i < N/2;i++){
			cnt++;
		}
		if(N==1 || N==2){
			System.out.println(1);
			return;
		}
		System.out.println(N%2==0 ? cnt : ++cnt);
	}
}

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

#include <iostram>
#include <cmath>
using namespace srd;

int main(){
  int N;
  
  cin >> N;
  
  if(N%2==0)cout << N/2-1 << endl;
  else cout << N/2 << endl;
  
  return 0;
  
}

Compiler output:
a.cc:1:10: fatal error: iostram: No such file or directory
    1 | #include <iostram>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <iostram>
#include <cmath>
using namespace srd;

int main(){
  int N;
  
  if(N%2==0)cout << N/2-1 << endl;
  else cout << N/2 << endl;
  
  return 0;
  
}

Compiler output:
a.cc:1:10: fatal error: iostram: No such file or directory
    1 | #include <iostram>
      |          ^~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

int main(void){
int n,a,i;
  int a=n;
  scanf("%d",&n);
  for(i=1;i!=a;i++){
  a=n-i;
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:7: error: redeclaration of 'a' with no linkage
    5 |   int a=n;
      |       ^
main.c:4:7: note: previous declaration of 'a' with type 'int'
    4 | int n,a,i;
      |       ^
Language: C++

#include iostream

using namespace std;

int main() {
	int n;
  cin >> n;
  cout << (n - 1) / 2 << '\n';
}

Compiler output:
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include iostream
      |          ^~~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include iostream
a.cc:8:3: error: 'cout' was not declared in this scope
    8 |   cout << (n - 1) / 2 << '\n';
      |   ^~~~
a.cc:8:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

int main(){
  int N;
  cin >> N;
  
  count << (N-1)/2 << endl;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
    8 |   count << (N-1)/2 << endl;
      |   ~~~~~~^~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(void){
	int n;
  cin >> n;
  
  if(n % 2){
  	n /= 2
  }else{
    n = n / 2 - 1;
  }
  
  cout << n;
  
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: expected ';' before '}' token
    9 |         n /= 2
      |               ^
      |               ;
   10 |   }else{
      |   ~
Language: C++

#include <iostream>
using namespace std;

int main(){
    ll n;
    cin >> n;
    if (n%2) cout << n/2 << endl; 
    else cout << n/2-1 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'll' was not declared in this scope
    5 |     ll n;
      |     ^~
a.cc:6:12: error: 'n' was not declared in this scope
    6 |     cin >> n;
      |            ^
Language: C++

#include <iostram>
using namespace std;
int main(){
  int n;cin >> n;
  if(n%2==1){
    cout << (n-1)/2<<emdl;
  }else{
    cout << n/2-1<<endl;
  }
}

Compiler output:
a.cc:1:10: fatal error: iostram: No such file or directory
    1 | #include <iostram>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;

int main(){
    ll n;
    cin >> n;
    if (i%2) cout << i/2 << endl; 
    else cout << i/2-1 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'll' was not declared in this scope
    5 |     ll n;
      |     ^~
a.cc:6:12: error: 'n' was not declared in this scope
    6 |     cin >> n;
      |            ^
a.cc:7:9: error: 'i' was not declared in this scope
    7 |     if (i%2) cout << i/2 << endl;
      |         ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  if(N%2 ==0){  
  	cout << N / 2 -1 << endl;
  }else{
    cout << (N+1) /2 -1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:2: error: expected '}' at end of input
   11 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

int main(void){
	int n
  cin >> n;
  
  if(n % 2){
  	n /= 2
  }else{
    n = n / 2 - 1;
  }
  
  cout << n;
  
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
    6 |   cin >> n;
      |   ^~~
a.cc:8:6: error: 'n' was not declared in this scope
    8 |   if(n % 2){
      |      ^
a.cc:14:11: error: 'n' was not declared in this scope
   14 |   cout << n;
      |           ^
Language: C++

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

int main(){
	int a;
	cin >> a;
	int sum = n/2;
	if(sum * 2==n){
		cout << n / 2 -1;
	}
	else{
		cout << n/2;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: 'n' was not declared in this scope
    7 |         int sum = n/2;
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF LLONG_MAX/5
#define all(v) v.begin(),v.end()
#define P pair<int,int>
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
signed main(){
	cin>>n;
	cout<<(n-1)/2<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'n' was not declared in this scope; did you mean 'yn'?
   13 |         cin>>n;
      |              ^
      |              yn
Language: C++

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

int main(){
	int a,b;
	cin >> a;
	int sum = n/2;
	if(sum * 2==n){
		cout << n / 2 -1;
	}
	else{
		cout << n/2
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: 'n' was not declared in this scope
    7 |         int sum = n/2;
      |                   ^
Language: C++

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

 int main(){
    int n;
    cin >>n;
    if(n==1 || n==2){
        cout << 0 << endl;
        return ;
        }
    if(n%2==0){
        n==(n-2)/2;
    }
    else{
        n=n/2;
    }

 }




Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
    9 |         return ;
      |         ^~~~~~
Language: C++

package main

import(
    "fmt"
)

func main() {
    var n int
    fmt.Scan(&n)
    if n % 2 == 0 {
        fmt.Println(n/2-1)
    } else {
        fmt.Println(n/2)
    }
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
Language: C++

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

int main(){
	int a,b;
	cin >> a;
	int sum = n/2;
	if(sum * 2==n / 2){
		cout << n / 2 -1;
	}
	else{
		cout << n/2
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: 'n' was not declared in this scope
    7 |         int sum = n/2;
      |                   ^
Language: C

n = int(input())
if n % 2 == 0:
    print(n//2-1)
else:
    print(n//2)


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n = int(input())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:5: error: expected expression before 'int'
    1 | n = int(input())
      |     ^~~
Language: C++

int main() {
    int N;
    cin >> N;
    cout << (N+1)/2 - 1 << endl;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> N;
      |     ^~~
a.cc:4:5: error: 'cout' was not declared in this scope
    4 |     cout << (N+1)/2 - 1 << endl;
      |     ^~~~
a.cc:4:28: error: 'endl' was not declared in this scope
    4 |     cout << (N+1)/2 - 1 << endl;
      |                            ^~~~
Language: Java


public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if (n % 2 == 1) {
            System.out.println(n / 2);
        } else {
            System.out.println((n - 2) / 2);
        }
    }

}


Compiler output:
Main.java:5: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:5: 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(void){
  int a,b;
  string s;
  cin >> a;
  b = (a / 2) -1
  cout << b;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: expected ';' before 'cout'
    7 |   b = (a / 2) -1
      |                 ^
      |                 ;
    8 |   cout << b;
      |   ~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<functional>
#include<map>
#include<unordered_set>
using namespace std;
long long p = 998244353;
//long long p = 1000000007;
#define int long long
#define vel vector<long long>
#define vvel vector<vel>
#define rep(i,n) for(int i=0;i<n;i++)
#define sor(v) sort(v.begin(),v.end())
#define mmax(a,b) a=max(a,b)
#define mmin(a,b) a=min(a,b)
#define mkp make_pair
#define pin pair<int,int>
#define qin pair<int,pin>
#define V vector
#define Endl endl
#define veb vector<bool>
#define rev(s) reverse(s.begin(),s.end())
#define lower(h,val) lower_bound(h.begin(),h.end(),val)-h.begin()
#define upper(h,val) upper_bound(h.begin(),h.end(),val)-h.begin()
int max_kai = 150000;
vel kai(max_kai, 1);
vel inv_kai;
int rui(int a, int n) {
	if (n == 0) { return 1; }
	int x = rui(a, n / 2);
	x *= x; x %= p;
	if (n % 2 == 1) { x *= a; x %= p; }
	return x;
}
int inv(int a) { return rui(a, p - 2); }
void make_kai() {
	for (int i = 1; i < max_kai; i++) { kai[i] = kai[i - 1] * i; kai[i] %= p; }
	inv_kai = kai;
	rep(i, max_kai) { inv_kai[i] = inv(kai[i]); }
}
int nCr(int n, int r) {
	int a = kai[n] * inv_kai[r]; a %= p;
	a *= inv_kai[n - r]; a %= p;
	return a;
}
vel pa;
int root(int x) {
	if (pa[x] == -1) { return x; }
	int ans = root(pa[x]); pa[x] = ans;
	return ans;
}
void marge(int x, int y) {
	x = root(x);
	y = root(y);
	if (x != y) {pa[x] = y;}
}

signed main(){
	int n; cin >> n;
	if (n % 2 == 0) { cout << (n / 2 - 1) << endl; }
	else { cout << (n - 1) / 2 << endl }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:43: error: expected ';' before '}' token
   67 |         else { cout << (n - 1) / 2 << endl }
      |                                           ^~
      |                                           ;
Language: C

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

int main(){
	int N;
	cin >> N;
	int ans=0,i=1,num;
	while(i){
		if(N-num<=num){
			break;
		}
		ans++;
	}
	cout << ans << endl;
	return 0;
}

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

#include<stdio.h.>

int main(){
    int a;
    scanf("%d", &a);
    printf("%d", (a-1)/2);

    return 0;
}

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

#include <bits/stdd++.h>
#define rgi register int
using namespace std;
int n;
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	cin>>n;
	if(n==0)
		cout<<"0"<<endl;
	if(n&1)
		cout<<(n>>1)<<endl;
	else
		cout<<((n-1)>>1)<<endl;
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: bits/stdd++.h: No such file or directory
    1 | #include <bits/stdd++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

import java.util.*;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		int N = Integer.parseInt(in.readLine());
		if (N % 2 == 1) {
			System.out.println((N / 2));
		} else {
			System.out.println((N / 2 - 1));
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.nio.charset.StandardCharsets;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: expected unqualified-id before 'public'
    6 | public class Main {
      | ^~~~~~
Language: C++

#include <cstdio>
#include <cassert>
#include <algorithm>    
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <bitset>
#define pb push_back
#define mk make_pair
#define eb emplace_back
#define eps 1e-8
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
//#define int long long
using namespace std;

typedef long double ld;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef tuple<int, int, int> tiii;
typedef unsigned long long ull; 
typedef vector<int> vi;
typedef vector<pii> vii;
typedef vector<long double> vd;
const int inf = 1e9;
const long long INF = 1e18;
const int M = 1e9 + 7;
//__int128


signed main() {
  // freopen("in.txt", "r", stdin);
  ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  cout.setf(ios::fixed); cout.precision(10);
  cin >> n;
  cout << (n - 1) / 2 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   41 |   cin >> n;
      |          ^
      |          yn
Language: C++

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <string>
#include <cmath>
#include <complex>
#include <numeric>
#include <cassert>

#include <vector>
#include <array>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <utility>

#define PI 3.14159265358979323846
#define int64 long long
#define uint64 unsigned long long
#define coutfix(i) cout << fixed << setprecision(i)		//coutの浮動小数出力の桁数設定
using namespace std;

const int64 mod = 998244353;

int64 mpow(int64 mm, int64 xx)
{
	if(xx == 0)
	{
		return 1;
	}
	int64 tmp = mpow(mm, xx / 2);
	tmp *= tmp;
	tmp %= mod;
	if(xx % 2 == 1)
	{
		tmp *= mm;
		tmp %= mod;
	}
	return tmp;
}

int main()
{
	int64 nn, tmp, ans = 1;
	cin >> nn;
	vector<int64> dd(nn + 1, 0);
	cin >> tmp;
	if(tmp != 0)
	{
		cout << 0 << endl;
		return 0;
	}
	dd[tmp]++;
	for(int64 ii = 1;ii < nn;ii++)
	{
		cin >> tmp;
		dd[tmp]++;
	}
	for(int64 ii = 1;ii <= nn && != 0;ii++)
	{
		ans *= mpow(dd[ii - 1], dd[ii]);
		ans %= mod;
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:38: error: expected primary-expression before '!=' token
   62 |         for(int64 ii = 1;ii <= nn && != 0;ii++)
      |                                      ^~
Language: C++

#include "bits/stdc++.h"
#include "math.h"
 
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define drep(i,a,b) for(ll i=(a);i>=(b);--i)
#define SIZE(a) ll((a).size())
#define out(a) cout<<(a)<<endl;
const int inf=INT_MAX;
const int MAX = 510000;
const ll MOD = 998244353;

ll modpow(ll x, ll n){
	ll r=1;
	while(n){
		if(n&1) r=r*x%MOD;
		x=x*x%MOD;
		n>>=1;
	}
	return r;
}

int main(){
  ll n;cin>>n;
  vll d(n),dis(n,0);
  rep(i,0,n){
    cin>>d[i];
    dis[d[i]]++;
  }
  if(dis[0]!=1){
    cout<<0<<endl;return 0;
  }
  
  sort(d.begin(),d.end());
  ll ans=1;
  if()
  rep(i,1,d[n-1]+1){
    ans*=modpow(dis[i-1],dis[i]);
    ans%=MOD;
  }
  cout<<ans<<endl;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:44:6: error: expected primary-expression before ')' token
   44 |   if()
      |      ^
Language: Java

import java.util.Scanner;
public class Main{
 public static void main(String args[]){
  boolean flag=false;
  Scanner scan=new Scanner(System.in);
  String s;

  s=scan.next();
  int n=Integer.parseInt(s);

  int d[]=new int[n+10];
  int mx=0,a; 
  for(int i=0;i<n;i++)d[i]=0;

  for(int i=0;i<n;i++){
   s=scan.next();
   a=Integer.parseInt(s);
   d[a]++;
   if(mx<a)mx=a;
  }
  long ans=1;
  for(int i=1;i<=mx;i++){
   for(int j=0;j<d[i];j++){
    ans*=d[i-1];
    ans%=998244353;
   }
  } 
  if(d[i-1]==0)ans=0;
  System.out.println(ans);
 }

 ///////////////////////////////////////////////
 public static boolean prime(long a){
  if(a<=1)return false;
  for(int i=2;i*i<=a;i++){
   if(a%i==0)return false;
  }
  return true;
 }
 public static long llpow(long x,long n){
  long ans=1;
  for(int i=0;i<n;i++)ans*=x;
  return ans;
 }
 public static long max(long a,long b){
  if(a<b)return b;
  else return a;
 }
 public static long min(long a,long b){
  if(a>b)return b;
  else return a;
 }
}



Compiler output:
Main.java:28: error: cannot find symbol
  if(d[i-1]==0)ans=0;
       ^
  symbol:   variable i
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define PI 3.141592653589793
#define MOD 1000000007
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(v) v.begin(), v.end()

typedef long long ll;
typedef long double ld;

int main() {
    ll N, M;
    M = 998244353;
    cin >> N;
    vector<ll> D(N, 0);
    rep(i, N) cin >> D[i];
    if(D[0] != 0){
        cout << 0 << endl;
        return 0;
    }
    sort(all(D),greater<ll>());
    ll cnt = 1;
    vector<ll> num;
    for(int i = 0; i < N - 1; i++){
        if(i != N - 1 && D[i] == 0){
            cout << 0 << endl;
            return 0;             
        }
        if(D[i] == D[i + 1]){
            cnt++;
        }
        else if(D[i] - D[i + 1] == 1){
            num.push_back(cnt);
            cnt = 1;
        }
        else{
            cout << 0 << endl;
            return 0;            
        }
    }
    num.push_back(1);
    ll ans = 1;
    for(int i = 0; i < num.size() - 1; i++){
        ans = (ans * pow(num[i + 1],num[i])) % M;
    }
    cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:46: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'll' {aka 'long long int'} to binary 'operator%'
   44 |         ans = (ans * pow(num[i + 1],num[i])) % M;
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
      |                    |                           |
      |                    |                           ll {aka long long int}
      |                    __gnu_cxx::__promote<double>::__type {aka double}
Language: C++


  #include <bits/stdc++.h>
using namespace std;
#define PI 3.141592653589793
#define MOD 1000000007
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(v) v.begin(), v.end()

typedef long long ll;
typedef long double ld;

int main() {
    ll N, M;
    M = 998244353;
    cin >> N;
    vector<ll> D(N, 0);
    rep(i, N) cin >> D[i];
    if(D[0] != 0){
        cout << 0 << endl;
        return 0;
    }
    sort(all(D),greater<ll>());
    ll cnt = 1;
    vector<ll> num;
    for(int i = 0; i < N - 1; i++){
        if(i != N - 1 && D[i] == 0){
            cout << 0 << endl;
            return 0;             
        }
        if(D[i] == D[i + 1]){
            cnt++;
        }
        else if(D[i] - D[i + 1] == 1){
            num.push_back(cnt);
            cnt = 1;
        }
        else{
            cout << 0 << endl;
            return 0;            
        }
    }
    num.push_back(1);
    ll ans = 1;
    for(int i = 0; i < num.size() - 1; i++){
        ans = (ans * pow(num[i + 1],num[i])) % M;
    }
    cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:46: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'll' {aka 'long long int'} to binary 'operator%'
   45 |         ans = (ans * pow(num[i + 1],num[i])) % M;
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
      |                    |                           |
      |                    |                           ll {aka long long int}
      |                    __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

/*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#define   mod  998244353
#define   int  long long 
#define   ld   long double
#define   pb   push_back
#define   vi  vector<int> 
#define   dbg(x)  cerr << #x << " = " << x << '\n'
#define   sz(x)  (int)x.size()
#define   all(a) (a.begin(),a.end())
#define   ff   first
#define   ss   second
#define   pii  pair<int,int> 
#define   lcm(a,b) (a*b)/__gcd(a,b) 
using namespace std;

inline void solve(){
    int n,mx=0,ans=1; 
    cin>>n; 
    map <int,int> cnt;
    for (int i=1;i<=n;i++){
        int a;cin>>a;
        if ((i==1 and a!=0) or (i>1 and a==0)) ans=0;
        cnt[a]++;
        mx=max(mx,a);
    }
    for (int i=1;i<=mx;i++)
        ans = ans*pow(cnt[i-1],cnt[i])%998244353;
    cout << ans << endl;
}

signed main()
{
    int n=1; // cin>>n;
    while (n--) solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:40:39: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   40 |         ans = ans*pow(cnt[i-1],cnt[i])%998244353;
      |               ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
      |                  |                     |
      |                  |                     int
      |                  __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
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;
}
int vector_finder(std::vector<ll> vec, int number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}
struct edge {
  ll to, cost;
};

ll modpow(ll a, ll n, ll mod) {
  if(n == 0) {
    return 1;
  } else if(n % 2 == 1) {
    return modpow(a, n - 1, mod) * a % mod;
  } else {
    ll t = modpow(a, n / 2, mod);
    return t * t % mod;
  }
}

int main() {
  int N; cin >> N;
  vector<ll> D(N); REP(i, N) cin >> D[i];
  if(D[0] != 0) { // 1番目が0でなければ構築不可能
    cout << 0 << endl;
    return 0;
  }
  // それ以外の検査
  // ソートしてよい
  sort(all(D));
  vector<ll> res; ll cnt = 0;
  REP(i, N) { // 前処理
    cnt++;
    if(D[i] != D[i + 1]) {
      res.push_back(cnt);
      cnt = 0;
    }
  }
  bool flag = false;
  REP(i, N - 1) { // 連番になってなければ構築不可能。
    if(D[i + 1] - D[i] > 1) flag = true;
  }
  if(flag == true || D[1] == 0) {
    cout << 0 << endl;
    return 0;
  }

  // 判定パート
  ll ans = 1;
  const ll MOD = 998244353;
  REP(i, res.size() - 1) {
    ans *= pow(res[i], res[i + 1]) % MOD;
    ans %= MOD;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:83:36: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'const ll' {aka 'const long long int'} to binary 'operator%'
   83 |     ans *= pow(res[i], res[i + 1]) % MOD;
      |            ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~
      |               |                      |
      |               |                      const ll {aka const long long int}
      |               __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

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

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

    ll div = 998244353;

    map<ll, ll> D;
    int max = 0;
    for (int i = 0; i < N; i++) {
        ll tmp;
        cin >> tmp;
        D[tmp]++;
        if (tmp > max) {
            max = tmp;
        }
    }

    ll output = 1;
    if (D[0] != 1) {
        cout << 0 << endl;
        return 0;
    }
    for (int i = 1; i < N; i++) {
        if (D[i] != 0) {
            output *= (powl(D[i - 1], D[i]) % div);
            output %= div;
        } else {
            if (i != max + 1) {
                cout << 0 << endl;
                return 0;
            }
            break;
        }
    }
    cout << output << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:45: error: invalid operands of types 'long double' and 'll' {aka 'long long int'} to binary 'operator%'
   29 |             output *= (powl(D[i - 1], D[i]) % div);
      |                        ~~~~~~~~~~~~~~~~~~~~ ^ ~~~
      |                            |                  |
      |                            long double        ll {aka long long int}
Language: C++


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

int main() {
  int n; cin>>n;
  vector<int> v(n,0);
  rep(i,n){
    int d; cin>>d;
    v[d]++;
  }
  int i=n-1;
  while(v[i]==0){
    v.erase(v.begin()+i);
    i--;
  }
  n=v.size();
  int ans=1;
  rep(j,n-1){
    ans*= pow(v[j],v[j+1]);
    ans%=l;
  }
  if(v[0] !=1){ans=0;}
  cout<<ans<<endl;
}

Compiler output:
a.cc:5:1: error: 'll' does not name a type
    5 | ll l=998244353;
      | ^~
a.cc: In function 'int main()':
a.cc:23:10: error: 'l' was not declared in this scope
   23 |     ans%=l;
      |          ^
Language: C++

#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>

typedef unsigned long long ULLONG;
typedef long long LLONG;
static const LLONG MOD_NUM = 998244353;//1000000007;

template<class _T> static void getval(_T& a) {
	std::cin >> a;
}
template<class _T> static void getval(_T& a, _T& b) {
	std::cin >> a >> b;
}
template<class _T> static void getval(_T& a, _T& b, _T& c) {
	std::cin >> a >> b >> c;
}

static void exec();

int main()
{
	exec();
	fflush(stdout);
	return 0;
}


Compiler output:
a.cc:28:13: warning: 'void exec()' used but never defined
   28 | static void exec();
      |             ^~~~
/usr/bin/ld: /tmp/ccaScznz.o: in function `main':
a.cc:(.text+0x5): undefined reference to `exec()'
collect2: error: ld returned 1 exit status
Language: C++


#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>

typedef unsigned long long ULLONG;
typedef long long LLONG;
static const LLONG MOD_NUM = 998244353;//1000000007;

template<class _T> static void getval(_T& a) {
	std::cin >> a;
}
template<class _T> static void getval(_T& a, _T& b) {
	std::cin >> a >> b;
}
template<class _T> static void getval(_T& a, _T& b, _T& c) {
	std::cin >> a >> b >> c;
}

static void exec();

int main()
{
	exec();
	fflush(stdout);
	return 0;
}


static void exec()
{
	int N;
	getval(N);
	
	int d0;
	getval(d0);

	std::vector<LLONG> count(N, 0);
	for (int i = 1; i < N; i++) {
		int di;
		getval(di);
		count[di]++;
	}

	if (d0) {
		printf("0\n");
		return;
	}
	count[0]++;

	LLONG ans = 1;
	for (int i = 1; i < N; i++) {
		if (count[i] == 0) {
			continue;
		}
		else if (count[i - 1] == 0 && count[i]) {
			printf("0\n");
			return;
		}

		LLONG val = tp_modpow(count[i - 1], count[i], MOD_NUM);
		ans = (ans * val) % MOD_NUM;
	}
	printf("%lld\n", ans);
}


Compiler output:
a.cc: In function 'void exec()':
a.cc:70:29: error: 'tp_modpow' was not declared in this scope
   70 |                 LLONG val = tp_modpow(count[i - 1], count[i], MOD_NUM);
      |                             ^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i= 0; i < (n); i++)
using ll= long long int;
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;
}
ll mod= 998244353;

ll RepeatSquaring(ll N, ll P, ll M){
    if(P==0) return 1;
    if(P%2==0){
        ll t = RepeatSquaring(N, P/2, M);
        return t*t % M;
    }
    return N * RepeatSquaring(N, P-1, M)%M;
}

int main() {
  ll ans= 1;
  ll n;
  cin >> n;
  ll a[n]= {};
  rep(i, n) {
    int g;
    cin >> g;
    a[g]++;
  }
  rep(i,n)if(a[i]==0){cout<< 0 << endl; retunr 0;}
  if(a[0]!=1){cout << 0 <<endl;return 0;}
  
  for(int i=1;i<n;i++){
      ans=ans*RepeatSquaring(a[i],a[i-1],mod)%mod;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:41: error: 'retunr' was not declared in this scope
   40 |   rep(i,n)if(a[i]==0){cout<< 0 << endl; retunr 0;}
      |                                         ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
// nCk を取得
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
ll n;
cin>>n;
ll ca=0;
ll d[n]={};
ll f=0;
for(ll i=0; i<n; i++){
cin>>ca;
d[ca]++;}
ca=1;
if(d[0]==0) cout << 0 << endl;
else{
for(ll i=1; i<n; i++){
if(d[i]==0){
f++;
break;}
else{
for(ll k=0; k<d[i]; k++){
ca=ca*d[i-1];
ca%=998244353}
}}
if(f==1) ca=0;
cout << ca << endl;}}



Compiler output:
a.cc: In function 'int main()':
a.cc:38:14: error: expected ';' before '}' token
   38 | ca%=998244353}
      |              ^
      |              ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
// nCk を取得
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
ll n;
cin>>n;
ll ca=0;
ll d[n]={};
ll f=0;
for(ll i=0; i<n; i++){
cin>>ca;
d[ca]++;}
ca=1;
if(d[0]==0) cout << 0 << endl;
else{
for(ll i=1; i<n; i++){
if(d[i]==0){
f++;
break;}
else{
ca=ca*pow(d[i-1],d[i])%(ll)998244353}}
if(f==1) ca=0;
cout << ca << endl;}



Compiler output:
a.cc: In function 'int main()':
a.cc:36:23: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'll' {aka 'long long int'} to binary 'operator%'
   36 | ca=ca*pow(d[i-1],d[i])%(ll)998244353}}
      |    ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
      |      |                 |
      |      |                 ll {aka long long int}
      |      __gnu_cxx::__promote<double>::__type {aka double}
a.cc:38:21: error: expected '}' at end of input
   38 | cout << ca << endl;}
      |                     ^
a.cc:19:12: note: to match this '{'
   19 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
// nCk を取得
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
ll n;
cin>>n;
ll ca=0;
ll d[n]={};
ll f=0;
for(ll i=0; i<n; i++){
cin>>ca;
d[ca]++;}
ll ca=1;
if(d[0]==0) cout << 0 << endl;
else{
for(ll i=1; i<n; i++){
if(d[i]==0){
f++;
break;}
else{
ca=ca*pow(d[i-1],d[i])%998244353}}
if(f==1) ca=0;
cout << ca << endl;}



Compiler output:
a.cc: In function 'int main()':
a.cc:28:4: error: redeclaration of 'll ca'
   28 | ll ca=1;
      |    ^~
a.cc:22:4: note: 'll ca' previously declared here
   22 | ll ca=0;
      |    ^~
a.cc:36:23: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   36 | ca=ca*pow(d[i-1],d[i])%998244353}}
      |    ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
      |      |                 |
      |      |                 int
      |      __gnu_cxx::__promote<double>::__type {aka double}
a.cc:38:21: error: expected '}' at end of input
   38 | cout << ca << endl;}
      |                     ^
a.cc:19:12: note: to match this '{'
   19 | int main() {
      |            ^
Language: C++

#include<iostream>
#include<algorithm
#include<vector>
using namespace std;

typedef long long int ll;

const int MAX_N =100001;
const ll MOD = 998244353;
int N;

int main(){
  cin >> N;
  vector<ll>vec;
  for(int i = 0 ; i < N; i++){
    int d; cin >> d;
    vec.push_back(d);
  }
  sort(vec.begin(), vec.end());

  ll fact[MAX_N];
  fact[0] = 1;
  for(int i = 1 ; i < MAX_N ; i++){
    fact[i] = (i * fact[i-1]) % MOD;
  }

  ll res = 1;
  ll pre = 0;
  ll count = 1;
  ll pre_count = 1;
  if(vec[0] != 0){
    cout << 0 << endl;
    return 0;
  }
  
  for(int i = 1 ; i < vec.size() ; i++){
    if(pre != vec[i]){
      if(pre + 1 != vec[i]){
        cout << 0 << endl;
        return 0;
      }
      res = (((res * fact[count]) % MOD) * pre_count)%MOD;
      pre = vec[i];
      pre_count = count;
      count = 0;
    }
    count++;
  }
  cout << res << endl;
  return 0;
}


Compiler output:
a.cc:2:19: error: missing terminating > character
    2 | #include<algorithm
      |                   ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;

typedef long long int ll;

const int MAX_N =100001;
const ll MOD = 998244353;
int N;

int main(){
  cin >> N;
  vector<ll>vec;
  for(int i = 0 ; i < N; i++){
    int d; cin >> d;
    vec.push_back(d);
  }
  sort(vec.begin(), vec.end());

  ll fact[MAX_N];
  fact[0] = 1;
  for(int i = 1 ; i < MAX_N ; i++){
    fact[i] = (i * fact[i-1]) % MOD;
  }

  ll res = 1;
  ll pre = 0;
  ll count = 1;
  ll pre_count = 1;
  if(vec[0] != 0){
    cout << 0 << endl;
    return 0;
  }
  
  for(int i = 1 ; i < vec.size() ; i++){
    if(pre != vec[i]){
      if(pre + 1 != vec[i]){
        cout << 0 << endl;
        return 0;
      }
      res = (((res * fact[count]) % MOD) * pre_count)%MOD;
      pre = vec[i];
      pre_count = count;
      count = 0;
    }
    count++;
  }
  cout << res << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   18 |   sort(vec.begin(), vec.end());
      |   ^~~~
      |   short
Language: C++

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

#define MOD (long long)(998244353)
#define INF (1LL<<60)
#define rep(i,n) for(ll i = 0; i < (n); i++)
#define rep1(i,n) for(ll i = 1; 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;
}


// 最大公約数
ll gcd(ll a, ll b)
{
  if(b == 0) return a;
  return gcd(b, a % b);
}

// mod m におけるa の逆元
ll modinv(ll a, ll m) {
  ll b = m, u = 1, v = 0;
  while (b) {
    ll t = a / b;
    a -= t * b; swap(a, b);
    u -= t * v; swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}

// 素因数分解
vector<pair<ll, ll>> prim;
void pf(ll n)
{
  ll s = sqrt(n);
  ll r = 0;
  for(ll i = 2; i <= s; i++) {
    if((n % i) == 0) {
      r = 0;
      do {
	r++;
	n = n / i;
      } while((n % i) == 0);
      prim.push_back({i, r});
    }
  }
  if(n > s) {
    prim.push_back({n, 1});
  }
}

void solve()
{
  ll N; cin >> N;
  // ll x, y, z; cin >> x >> y >> z;
  // ll a, b, c; cin >> a >> b >> c;
  // string s; cin >> s;
  vector<ll> a(N); rep(i, N) cin >> a[i];
  vector<ll> c(100100, 0);
  rep(i,N) {
    c[a[i]]++;
  }
  if(a[0]!=0 || c[0]!=1) {
    cout << 0 << endl;
    return;
  }
    
  ll ans = 1;
  rep(i,N-1) {
    rep(j, c[i+1]) {
      ans*= c[i];
      ans%=MOD;
    }
  }
  // bool ok = false;

  cout << ans << endl;
  // cout << (ok?"Yes":"No") << endl;
}


int main(void)
{
  // ll t; cin >> t; rep(i, t)
  solve();
}









Compiler output:
a.cc: In function 'void pf(ll)':
a.cc:52:10: error: 'sqrt' was not declared in this scope
   52 |   ll s = sqrt(n);
      |          ^~~~
Language: C

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define MOD (long long)(998244353)
#define INF (1LL<<60)
#define rep(i,n) for(ll i = 0; i < (n); i++)
#define rep1(i,n) for(ll i = 1; 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;
}


// 最大公約数
ll gcd(ll a, ll b)
{
  if(b == 0) return a;
  return gcd(b, a % b);
}

// mod m におけるa の逆元
ll modinv(ll a, ll m) {
  ll b = m, u = 1, v = 0;
  while (b) {
    ll t = a / b;
    a -= t * b; swap(a, b);
    u -= t * v; swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}

// 素因数分解
vector<pair<ll, ll>> prim;
void pf(ll n)
{
  ll s = sqrt(n);
  ll r = 0;
  for(ll i = 2; i <= s; i++) {
    if((n % i) == 0) {
      r = 0;
      do {
	r++;
	n = n / i;
      } while((n % i) == 0);
      prim.push_back({i, r});
    }
  }
  if(n > s) {
    prim.push_back({n, 1});
  }
}

void solve()
{
  ll N; cin >> N;
  // ll x, y, z; cin >> x >> y >> z;
  // ll a, b, c; cin >> a >> b >> c;
  // string s; cin >> s;
  vector<ll> a(N); rep(i, N) cin >> a[i];
  vector<ll> c(100100, 0);
  rep(i,N) {
    c[a[i]]++;
  }
  if(a[0]!=0 || c[0]!=1) {
    cout << 0 << endl;
    return;
  }
    
  ll ans = 1;
  rep(i,N-1) {
    rep(j, c[i+1]) {
      ans*= c[i];
      ans%=MOD;
    }
  }
  // bool ok = false;

  cout << ans << endl;
  // cout << (ok?"Yes":"No") << endl;
}


int main(void)
{
  // ll t; cin >> t; rep(i, t)
  solve();
}









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

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

lint gcd(lint x, lint y) {
  if(x == 0) { return y; }
  else { return gcd(y%x,x); }
}

lint lcm(lint x, lint y) { return x/gcd(x,y)*y; }

lint C(lint n, lint k) {
  if(n == k) { return 1; }
  else if(n < k) { return 0; }
  else if(k == 0) { return 1; }
  else if(k == 1) { return n; }
  else return C(n-1,k-1) + C(n-1,k);
}

lint P(lint n, lint k) {
  if(k == 1) { return n; }
  return (n*(P(n-1,k-1)%1000000007)%1000000007);
}


int main() {
  lint n; cin >> n;
  vector<lint> d(n); for(lint i=0;i<n;i++) { cin >> d[i]; }

  if(d[0] != 0) {
    cout << 0 << endl;
    return 0;
  } 

  vector<lint> e(n,0);
  for(lint i=0;i<n;i++) { e[d[i]]++; }

  if(e[0] != 1) {
    cout << 0 << endl;
    return 0;
  }

  lint ans=1;
  for(lint i=2;i<n;i++) { ans = (ans*pow(e[i-1],e[i])%998244353)%= 998244353; }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:54: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   44 |   for(lint i=2;i<n;i++) { ans = (ans*pow(e[i-1],e[i])%998244353)%= 998244353; }
      |                                  ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
      |                                     |                 |
      |                                     |                 int
      |                                     __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

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

int main() {
 ll n; cin >> n;
  vector<ll> cnt(n,0);
 rep(i,n){
  ll a; cin >> a;
  if((i==0 && a!=0) || (i!=0 && a==0)){
    cout << 0 << endl;
    return 0;
  }

  cnt[a]++;
 }
 ll ans=1;
 for(ll i=1;i<n;i++){
   if(cnt[i-1]==0 && cnt[i]!=0){
     cout << 0 << endl;
     return 0;
   }
    ll d=1;
    rep(0,cnt[i])d*=cnt[i-1];
   ans*=d;
   ans%=mod;
 }
 cout << ans%mod << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: expected unqualified-id before numeric constant
   26 |     rep(0,cnt[i])d*=cnt[i-1];
      |         ^
a.cc:3:26: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;i++)
      |                          ^
a.cc:26:9: error: expected ';' before numeric constant
   26 |     rep(0,cnt[i])d*=cnt[i-1];
      |         ^
a.cc:3:26: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;i++)
      |                          ^
a.cc:26:9: error: lvalue required as left operand of assignment
   26 |     rep(0,cnt[i])d*=cnt[i-1];
      |         ^
a.cc:3:26: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;i++)
      |                          ^
a.cc:3:33: error: expected ')' before ';' token
    3 | #define rep(i,n) for(int i=0;i<n;i++)
      |                     ~           ^
a.cc:26:5: note: in expansion of macro 'rep'
   26 |     rep(0,cnt[i])d*=cnt[i-1];
      |     ^~~
a.cc:26:9: error: lvalue required as increment operand
   26 |     rep(0,cnt[i])d*=cnt[i-1];
      |         ^
a.cc:3:34: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                  ^
Language: C++

// #Sazaの1日1AC
#include<bits/stdc++.h>
using namespace std;
const int mod=998244353;
const int INF=mod;
const double PI=3.14159265358979323846;

//マクロ
//型エイリアス
using ll = long long;
using P=pair<int, int>;
using vl=vector<long long>;
using vvl=vector<vector<long long>>;
using vP=vector<pair<long long, long long>>;
//ショートカット
#define rep(i,n) for(int i = 0; i < n; i++)
#define rep2(i,k,n) for(int i = k; i < n; i++) //半開区間
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define mkp make_pair
//入力
#define vin(v,N) for(long long id=0;id<N;id++) cin>>v.at(id)
#define lin(n) long long n;cin>>n
#define chin(x) char x;cin>>x;
#define sin(s) string s;cin>>s;
#define vlin(v,N) vector<long long>v(N);for(long long i=0;i<N;i++)cin>>v.at(i)


//関数
//最大公約数
long long gcd(long long m, long long n){
  long long a=max(m,n);
  long long b=min(m,n);
  long long r=a%b;
  while(r!=0){
    a=b; b=r; r=a%b;
  }
  return b;
}
// 最小公倍数
long long lcd(long long m, long long n){
  return m*n/gcd(m,n);
}
//繰り返し二乗法
long long repeat_squaring(long long x, long long n){
  if(n==0) return 1;
  else if(n%2==0){
    long long t=repeat_squaring(x,n/2);
    return t*t%mod;
  }
  else
    return x*repeat_squaring(x,n-1)%mod;
}
//素因数分解(mapで返す)
map<long long,long long> factor(long long p){
  ll p1=p;
  map<long long,long long>ret;
  for(long long i=2;i*i<=p1;i++){
     while(p%i==0){
      ret[i]++;
      p/=i;
    }
  }
  if(p!=1)
  ret[p]++;
  return ret;
}
//素数判定
bool is_prime(long long N){
  for(long long i=2;i*i<=N;i++){
    if(N%i==0)
      return false;
  }
  return true;
}
//最大値更新
void chmax(long long &a,long long b){
  a=max(a,b);
}
//最小値更新
void chmin(long long &a,long long b){
  a=min(a,b);
}

//構造体

/////////////////⊂('ω'⊂ )))Σ≡GO!/////////////////

#define int long long
#define inta int


inta main(){

  int N; cin >> N;
  vector<int> d(N);
  int max_d = 0;

  
  rep(i, N){
    cin >> d[i];
    max_d = max(d[i], max_d);
  }
  vector<int> a(max_d + 1);
  rep(i, N){
    a[d[i]]++;
  }
  bool NG = false;

  rep(i, max_d+1){
    if(a[i] == 0) NG = true;
  }
  if(a[0] != 1) NG = true;

  int res = 1;
  rep(i, max_d+1){
    res *= repeat_squaring(a[i], a[i+1]);
    //cout << res << endl;
  }
  if(NG){
    cout << 0 << endl;
    return 0;
  }
  cout << res << endl;

  
}



Compiler output:
cc1plus: error: '::main' must return 'int'