byslib-python

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

View the Project on GitHub bayashi-cl/byslib-python

:heavy_check_mark: tests/data/lazysegtree/range_update_query.test.py

Depends on

Code

# verification-helper: PROBLEM https://onlinejudge.u-aizu.ac.jp/courses/library/3/DSL/all/DSL_2_F
import sys

from byslib.core.const import IINF, MOD
from byslib.core.fastio import debug, readline, sinput
from byslib.data.lazy_segment_tree import LazySegmentTree


def main() -> None:
    id_S: int = 2**31 - 1
    id_F = -1

    def op(a: int, b: int) -> int:
        return min(a, b)

    def mp(a: int, b: int) -> int:
        return b if a == -1 else a

    def cp(f: int, g: int) -> int:
        return g if f == -1 else f

    n, q = map(int, readline().split())
    a = [id_S] * n
    seg = LazySegmentTree(op, id_S, mp, cp, id_F, a)
    for _ in range(q):
        head, *body = map(int, readline().split())
        if head == 0:
            s, t, x = body
            seg.apply(s, t + 1, x)
        else:
            s, t = body
            print(seg.query(s, t + 1))


if __name__ == "__main__":
    sys.setrecursionlimit(10**6)
    main()
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/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], 'release': True}).decode()
  File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/onlinejudge_verify/languages/python.py", line 80, in bundle
    raise NotImplementedError
NotImplementedError
Back to top page