Thanks to visit codestin.com
Credit goes to hitonanode.github.io

cplib-cpp

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

View the Project on GitHub hitonanode/cplib-cpp

:warning: segmenttree/trees/acl_range-bitwiseandor-range-max.hpp

Depends on

Code

#pragma once
#include "../acl_beats.hpp"

// CUT begin
// Verified: https://csacademy.com/contest/round-70/task/and-or-max
namespace RangeBitwiseAndOrRangeMax {
using UINT = uint32_t;
constexpr UINT digit = 20;
constexpr int mask = (1 << digit) - 1;

struct S {
    UINT max;
    UINT upper;
    UINT lower;
    bool fail;
    S(UINT x = 0) : max(x), upper(x), lower(x), fail(false) {}
};

S e() { return S(); }

S op(S l, S r) {
    l.max = std::max(l.max, r.max);
    l.upper |= r.upper;
    l.lower &= r.lower;
    return l;
}

struct F {
    UINT bit_and;
    UINT bit_or;
    F() : bit_and(mask), bit_or(0) {}
    F(UINT a, UINT o) : bit_and(a), bit_or(o) {}
    static F b_and(UINT a) noexcept { return {a, 0}; }
    static F b_or(UINT a) noexcept { return {mask, a}; }
};

F composition(F fnew, F fold) {
    return F{fnew.bit_and & fold.bit_and, fnew.bit_or | (fnew.bit_and & fold.bit_or)};
}

F id() { return F(); }

S mapping(F f, S x) {
    if ((x.upper - x.lower) & (~f.bit_and | f.bit_or)) {
        x.fail = true;
        return x;
    }
    x.upper = (x.upper & f.bit_and) | f.bit_or;
    x.lower = (x.lower & f.bit_and) | f.bit_or;
    x.max = (x.max & f.bit_and) | f.bit_or;
    return x;
}
using segtree = segtree_beats<S, op, e, F, mapping, composition, id>;
} // namespace RangeBitwiseAndOrRangeMax
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.13.7/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.7/x64/lib/python3.13/site-packages/onlinejudge_verify/languages/cplusplus.py", line 187, in bundle
    bundler.update(path)
    ~~~~~~~~~~~~~~^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py", line 401, in update
    self.update(self._resolve(pathlib.Path(included), included_from=path))
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py", line 401, in update
    self.update(self._resolve(pathlib.Path(included), included_from=path))
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py", line 355, in update
    raise BundleErrorAt(path, i + 1, "found codes out of include guard")
onlinejudge_verify.languages.cplusplus_bundle.BundleErrorAt: segmenttree/acl_lazysegtree.hpp: line 56: found codes out of include guard
Back to top page