1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use crate::segment_tree_lazy_with_instance_homomorphism::*;
pub struct RangeAddRangeSumI64;
impl Ops for RangeAddRangeSumI64 {
type F = i64;
type S = (i64, i64);
fn op(
&self,
a: Self::S,
b: Self::S,
) -> Self::S {
(a.0 + b.0, a.1 + b.1)
}
fn e(&self) -> Self::S {
(0, 0)
}
fn compose(
&self,
f: Self::F,
g: Self::F,
) -> Self::F {
f + g
}
fn id(&self) -> Self::F {
0
}
fn map(
&self,
f: Self::F,
x: Self::S,
) -> Self::S {
(x.0 + f * x.1, x.1)
}
}
#[cfg(test)]
mod tests {
#[test]
fn test() {}
}