This documentation is automatically generated by competitive-verifier/competitive-verifier
// competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/number_of_subsequences
#include <algorithm>
#include <iostream>
#include <vector>
#include "algorithm/compress.hpp"
#include "math/modint.hpp"
using Mint = modint998;
int main(void) {
int n;
std::cin >> n;
std::vector<int> a(n);
for (auto &e : a) std::cin >> e;
a = compress(a);
Mint ans = 0;
std::vector<Mint> dp(*std::max_element(a.begin(), a.end()) + 1);
for (auto x : a) {
auto t = ans - dp[x] + 1;
ans += t, dp[x] += t;
}
std::cout << ans << '\n';
return 0;
}
Traceback (most recent call last):
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/resolver.py", line 291, in resolve
bundled_code = language.bundle(path, basedir=basedir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/verify/languages/cplusplus.py", line 242, in bundle
bundler.update(path)
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 479, in update
self._resolve(pathlib.Path(included), included_from=path)
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 286, in _resolve
raise BundleErrorAt(path, -1, "no such header")
competitive_verifier.oj.verify.languages.cplusplus_bundle.BundleErrorAt: algorithm/compress.hpp: line -1: no such header
| Env | Name | Status | Elapsed | Memory |
|---|---|---|---|---|
| g++ | all_same_00 |
|
117 ms | 8 MB |
| g++ | all_same_01 |
|
139 ms | 9 MB |
| g++ | example_00 |
|
2 ms | 4 MB |
| g++ | example_01 |
|
2 ms | 4 MB |
| g++ | mini_00 |
|
2 ms | 3 MB |
| g++ | narrow_max_00 |
|
205 ms | 9 MB |
| g++ | narrow_max_01 |
|
199 ms | 9 MB |
| g++ | narrow_random_00 |
|
154 ms | 8 MB |
| g++ | narrow_random_01 |
|
184 ms | 9 MB |
| g++ | small_random_00 |
|
2 ms | 4 MB |
| g++ | small_random_01 |
|
2 ms | 3 MB |
| g++ | small_random_02 |
|
2 ms | 3 MB |
| g++ | wide_max_00 |
|
241 ms | 9 MB |
| g++ | wide_max_01 |
|
239 ms | 9 MB |
| g++ | wide_random_00 |
|
189 ms | 8 MB |
| g++ | wide_random_01 |
|
222 ms | 9 MB |