This documentation is automatically generated by competitive-verifier/competitive-verifier
// @brief Inv of Polynomials
#define PROBLEM "https://judge.yosupo.jp/problem/inv_of_polynomials"
#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
//#include <bits/allocator.h>
#pragma GCC target("avx2")
#include <iostream>
#include "blazingio/blazingio.min.hpp"
#include "cp-algo/math/poly/euclid.hpp"
using namespace std;
using namespace cp_algo::math;
const int mod = 998244353;
using base = modint<mod>;
using polyn = poly_t<base>;
void solve() {
int n, m;
cin >> n >> m;
polyn::Vector a(n), b(m);
for(auto &it: a) {cin >> it;}
for(auto &it: b) {cin >> it;}
auto res = inv_mod(polyn(std::move(a)), polyn(b));
if(res) {
cout << res->deg() + 1 << endl;
res->print();
} else {
cout << -1 << 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++ | abnormal_random_00 |
|
5 ms | 6 MB |
| g++ | abnormal_random_01 |
|
5 ms | 6 MB |
| g++ | abnormal_random_02 |
|
4 ms | 6 MB |
| g++ | abnormal_random_03 |
|
5 ms | 6 MB |
| g++ | abnormal_random_04 |
|
5 ms | 6 MB |
| g++ | example_00 |
|
2 ms | 6 MB |
| g++ | example_01 |
|
2 ms | 6 MB |
| g++ | example_02 |
|
2 ms | 6 MB |
| g++ | max_random_00 |
|
371 ms | 11 MB |
| g++ | max_random_01 |
|
372 ms | 11 MB |
| g++ | max_random_02 |
|
372 ms | 11 MB |
| g++ | max_random_03 |
|
374 ms | 11 MB |
| g++ | max_random_04 |
|
371 ms | 11 MB |
| g++ | random_00 |
|
84 ms | 7 MB |
| g++ | random_01 |
|
33 ms | 7 MB |
| g++ | random_02 |
|
65 ms | 7 MB |
| g++ | random_03 |
|
195 ms | 9 MB |
| g++ | random_04 |
|
117 ms | 8 MB |