Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

factorial MOD 998244353

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

const int MOD = 998244353;

void solve() {
    int n; cin >> n;
    if (n & 1) {
        cout << "0
";
        return;
    }
    long long ans = 1;
    for (int i = 1; i <= n ; ++i) {
        ans *= 1LL * i * i % MOD;
        ans %= MOD;
    }
    cout << ans << '
';
}

Source by codeforces.com #
 
PREVIOUS NEXT
Tagged: #factorial #MOD
ADD COMMENT
Topic
Name
6+3 =