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"
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2")
#include "cp-algo/math/poly.hpp"
#include <bits/stdc++.h>
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);
copy_n(istream_iterator<base>(cin), d, begin(a));
copy_n(istream_iterator<base>(cin), d, begin(c));
polyn Q = polyn(1) - polyn(c).mul_xk_inplace(1);
polyn P = (polyn(a) * Q).mod_xk_inplace(d);
cout << polyn::kth_rec_inplace(P, 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_resolve/resolver.py", line 181, 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 252, in bundle
bundler.update(path)
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 327, in update
assert len(lines) == len(uncommented_lines)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
| Env | Name | Status | Elapsed | Memory |
|---|---|---|---|---|
| g++ | example_00 |
|
5 ms | 4 MB |
| g++ | max_random_00 |
|
734 ms | 20 MB |
| g++ | max_random_01 |
|
735 ms | 20 MB |
| g++ | max_random_02 |
|
729 ms | 20 MB |
| g++ | near_65536_00 |
|
364 ms | 14 MB |
| g++ | near_65536_01 |
|
712 ms | 18 MB |
| g++ | near_65536_02 |
|
716 ms | 18 MB |
| g++ | random_00 |
|
175 ms | 7 MB |
| g++ | random_01 |
|
726 ms | 19 MB |
| g++ | random_02 |
|
355 ms | 14 MB |
| g++ | small_00 |
|
5 ms | 4 MB |
| g++ | small_01 |
|
5 ms | 4 MB |
| g++ | small_02 |
|
5 ms | 4 MB |
| g++ | small_03 |
|
5 ms | 4 MB |
| g++ | small_04 |
|
5 ms | 4 MB |
| g++ | small_05 |
|
5 ms | 4 MB |
| g++ | small_06 |
|
5 ms | 4 MB |
| g++ | small_07 |
|
5 ms | 4 MB |
| g++ | small_08 |
|
5 ms | 4 MB |
| g++ | small_09 |
|
4 ms | 4 MB |