Function floor_sum_range_freq

Source
pub fn floor_sum_range_freq(
    l: i64,
    r: i64,
    a: i64,
    b: i64,
    m: u64,
    range: Range<i64>,
) -> i64
Examples found in repository?
crates/library_checker/src/math/min_of_mod_of_linear.rs (line 12)
6pub fn min_of_mod_of_linear(reader: impl Read, mut writer: impl Write) {
7    let s = read_all_unchecked(reader);
8    let mut scanner = Scanner::new(&s);
9    scan!(scanner, t, query: [(i64, u64, i64, i64)]);
10    for (n, m, a, b) in query.take(t) {
11        let x = binary_search(
12            |&x| floor_sum_range_freq(0, n, a, b, m, 0..x + 1) > 0,
13            m as i64 - 1,
14            -1,
15        );
16        writeln!(writer, "{}", x).ok();
17    }
18}