procon_lib_rs

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub CoCo-Japan-pan/procon_lib_rs

:heavy_check_mark: verify/yosupo/line_add_get_min/src/main.rs

Depends on

Code

// verification-helper: PROBLEM https://judge.yosupo.jp/problem/line_add_get_min

use cht_offline::{CHTOffline, MinCompare};
use proconio::{fastout, input};

#[derive(Copy, Clone)]
enum Query {
    AddLine(i64, i64),
    GetMin(i64),
}

#[fastout]
fn main() {
    input! {
        n: usize,
        q: usize,
        a_b: [(i64, i64); n],
    }
    let queries = {
        let mut queries = Vec::with_capacity(q);
        for _ in 0..q {
            input! {
                t: u8,
            }
            if t == 0 {
                input! {
                    a: i64,
                    b: i64,
                }
                queries.push(Query::AddLine(a, b));
            } else {
                input! {
                    x: i64,
                }
                queries.push(Query::GetMin(x));
            }
        }
        queries
    };
    let points = queries
        .iter()
        .filter_map(|q| match q {
            Query::AddLine(..) => None,
            Query::GetMin(x) => Some(*x),
        })
        .collect::<Vec<_>>();
    let mut cht = CHTOffline::<MinCompare>::new(points);
    for (a, b) in a_b {
        cht.add_line(a, b);
    }
    for q in queries {
        match q {
            Query::AddLine(a, b) => cht.add_line(a, b),
            Query::GetMin(x) => println!("{}", cht.get(x)),
        }
    }
}
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.13.9/x64/lib/python3.13/site-packages/onlinejudge_verify/documentation/build.py", line 71, in _render_source_code_stat
    bundled_code = language.bundle(stat.path, basedir=basedir, options={'include_paths': [basedir]}).decode()
                   ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.9/x64/lib/python3.13/site-packages/onlinejudge_verify/languages/rust.py", line 288, in bundle
    raise NotImplementedError
NotImplementedError
Back to top page