QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#115181#6323. Range NEQNTRLoverCompile Error//C++141.1kb2023-06-24 20:45:232023-06-24 20:45:25

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-24 20:45:25]
  • 评测
  • [2023-06-24 20:45:23]
  • 提交

answer

#include<bits/stdc++.h>
#include"atcoder/modint.hpp"
#include"atcoder/convolution.hpp"
using namespace atcoder;
using namespace std;
typedef long long ll;
#define FOR(i, a, b) for(ll i=(a); i<=(b); i++)
#define chkmax(x, a) x = max(x, a)
#define chkmin(x, a) x = min(x, a)

using mint = modint998244353;

vector<mint> fpm(vector<mint>& a, ll n) {
    assert(n >= 1);
    if (n == 1) return a;
    auto ans = fpm(a, n / 2);
    ans = convolution(ans, ans);
    if (n % 2 == 1) ans = convolution(ans, a);
    return ans;
}

void solve() {
    ll n, m; cin >> n >> m;
    vector<mint> fac(n * m + 2); fac[0] = fac[1] = 1;
    for (ll i = 2; i <= n * m + 1; ++i) fac[i] = fac[i - 1] * i;

    vector<mint> f(m + 1);
    for (ll i = 0; i <= m; ++i) f[i] = (i % 2 == 1 ? -1 : 1) * fac[m] * fac[m] / fac[m - i] / fac[m - i] / fac[i]; 

    auto g = fpm(f, n);
    mint ans = 0;
    FOR(i, 0, n * m) ans = ans + fac[n * m - i] * g[i];
    cout << ans.val() << endl;
}


int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    ll T_ = 1;
    // cin >> T_;
    while (T_--) solve();
    return 0;
}

Details

answer.code:2:9: fatal error: atcoder/modint.hpp: No such file or directory
    2 | #include"atcoder/modint.hpp"
      |         ^~~~~~~~~~~~~~~~~~~~
compilation terminated.