This documentation is automatically generated by competitive-verifier/competitive-verifier
// @brief Kth term of Linearly Recurrent Sequence
#define PROBLEM "https://judge.yosupo.jp/problem/kth_term_of_linearly_recurrent_sequence"
#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2")
#include "blazingio/blazingio.min.hpp"
#include "cp-algo/math/poly/recurrence.hpp"
using namespace std;
using namespace cp_algo::math;
const int mod = 998244353;
using base = modint<mod>;
using polyn = poly_t<base>;
void solve() {
int64_t d, k;
cin >> d >> k;
polyn::Vector a(d), c(d);
for(auto &it: a) {cin >> it;}
for(auto &it: c) {cin >> it;}
polyn Q = polyn(1) - polyn(c).mul_xk_inplace(1);
polyn P = (polyn(std::move(a)) * Q).mod_xk_inplace(d);
cout << kth_rec(std::move(P), std::move(Q), k) << endl;
}
signed main() {
//freopen("input.txt", "r", stdin);
ios::sync_with_stdio(0);
cin.tie(0);
int t = 1;
while(t--) {
solve();
}
}
Traceback (most recent call last):
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/resolver.py", line 290, in resolve
bundled_code = language.bundle(path, basedir=basedir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/languages/cplusplus.py", line 243, in bundle
bundler.update(path)
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/languages/cplusplus_bundle.py", line 322, in update
assert len(lines) == len(uncommented_lines)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
| Env | Name | Status | Elapsed | Memory |
|---|---|---|---|---|
| g++ | example_00 |
|
2 ms | 6 MB |
| g++ | max_random_00 |
|
606 ms | 21 MB |
| g++ | max_random_01 |
|
525 ms | 21 MB |
| g++ | max_random_02 |
|
605 ms | 21 MB |
| g++ | near_65536_00 |
|
227 ms | 15 MB |
| g++ | near_65536_01 |
|
516 ms | 20 MB |
| g++ | near_65536_02 |
|
530 ms | 20 MB |
| g++ | random_00 |
|
107 ms | 9 MB |
| g++ | random_01 |
|
519 ms | 21 MB |
| g++ | random_02 |
|
231 ms | 13 MB |
| g++ | small_00 |
|
2 ms | 6 MB |
| g++ | small_01 |
|
2 ms | 6 MB |
| g++ | small_02 |
|
2 ms | 6 MB |
| g++ | small_03 |
|
2 ms | 6 MB |
| g++ | small_04 |
|
2 ms | 6 MB |
| g++ | small_05 |
|
2 ms | 6 MB |
| g++ | small_06 |
|
2 ms | 6 MB |
| g++ | small_07 |
|
2 ms | 6 MB |
| g++ | small_08 |
|
2 ms | 6 MB |
| g++ | small_09 |
|
2 ms | 6 MB |