QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#115181 | #6323. Range NEQ | NTRLover | Compile Error | / | / | C++14 | 1.1kb | 2023-06-24 20:45:23 | 2023-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]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [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;
}
詳細信息
answer.code:2:9: fatal error: atcoder/modint.hpp: No such file or directory 2 | #include"atcoder/modint.hpp" | ^~~~~~~~~~~~~~~~~~~~ compilation terminated.