Skip to content

Commit 58c7a9e

Browse files
committed
Add examples/library-checker-convolution-mod.rs
1 parent b798acf commit 58c7a9e

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#[macro_use]
2+
extern crate input as _;
3+
4+
use ac_library_rs::{convolution, modint::ModInt998244353 as Mint};
5+
use std::fmt;
6+
7+
fn main() {
8+
input! {
9+
n: usize,
10+
m: usize,
11+
a: [Mint; n],
12+
b: [Mint; m],
13+
}
14+
15+
print_oneline(convolution::convolution(&a, &b));
16+
}
17+
18+
fn print_oneline<I: IntoIterator<Item = T>, T: fmt::Display>(values: I) {
19+
println!(
20+
"{}",
21+
values
22+
.into_iter()
23+
.map(|v| v.to_string())
24+
.collect::<Vec<_>>()
25+
.join(" "),
26+
)
27+
}

0 commit comments

Comments
 (0)