QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#815133 | #9886. Long Sequence Inversion 2 | ucup-team1766# | Compile Error | / | / | C++23 | 1021b | 2024-12-15 05:26:49 | 2024-12-15 05:26:50 |
Judging History
This is the latest submission verdict.
- [2024-12-15 05:26:50]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-12-15 05:26:49]
- Submitted
answer
#include <bits/stdc++.h>
#include <atcoder/fenwicktree>
#include <atcoder/modint>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
int main() {
cin.tie(0)->sync_with_stdio(0);
int l, b; cin >> l >> b;
vector<int> p(l); for (int i = l-1; i >= 0; i--) cin >> p[i];
vector v(l, vector<int>(b));
for (auto &x : v) for (auto &y : x) cin >> y;
fenwick_tree<int> unused(l); for (int i = 0; i < l; i++) unused.add(i, 1);
mint ans;
mint f = 1;
for (int i : p) {
unused.add(i, -1);
mint po = mint(b).pow(unused.sum(i, l));
mint rest = mint(b).pow(unused.sum(0, i));
mint sum = po*(po-1)/2;
fenwick_tree<int> fw(b); for (int j = 0; j < b; j++) fw.add(j, 1);
for (int j = 0; j < b; j++) {
fw.add(v.back()[j], -1);
int less = fw.sum(0, v.back()[j]);
ans += less * (sum + po) * rest * rest * f;
int more = fw.sum(v.back()[j], b);
ans += more * sum * rest * rest * f;
// cout << ans.val() << '\n';
}
v.pop_back();
f *= b;
}
cout << ans.val() << '\n';
}
详细
answer.code:2:10: fatal error: atcoder/fenwicktree: No such file or directory 2 | #include <atcoder/fenwicktree> | ^~~~~~~~~~~~~~~~~~~~~ compilation terminated.