library

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

View the Project on GitHub shibh308/library

:heavy_check_mark: verify/redblacktree_lazy.test.cpp

Depends on

Code

#define PROBLEM "http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_I"
#include "bits/stdc++.h"


using namespace std;

using i64 = long long;


#include "../lib/classes/memorypool.cpp"
#include "../lib/classes/redblacktree_lazy.cpp"




signed main(){
    int n, q;
    scanf("%d%d", &n, &q);
    RedBlackTree<int, int> s([](auto x, auto y){return x + y;}, [](auto x, auto y, int z){return y == 100000 ? x : y * z;}, [](auto x, auto y){return y == 100000 ? x : y;}, 0, 100000);
    auto root = s.nil;
    for(int i = 0; i < n; ++i)
        root = s.insert(root, i, 0);
    for(int i = 0; i < q; ++i){
        int t;
        scanf("%d", &t);
        if(t == 0){
            int l, r, x;
            scanf("%d%d%d", &l, &r, &x);
            root = s.range_update(root, l, r + 1, x);
        }
        else{
            int l, r;
            scanf("%d%d", &l, &r);
            auto res = s.range_get(root, l, r + 1);
            root = res.second;
            printf("%d\n", res.first);
        }
    }
}
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.0/x64/lib/python3.9/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.9.0/x64/lib/python3.9/site-packages/onlinejudge_verify/languages/cplusplus.py", line 193, in bundle
    bundler.update(path)
  File "/opt/hostedtoolcache/Python/3.9.0/x64/lib/python3.9/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py", line 399, in update
    self.update(self._resolve(pathlib.Path(included), included_from=path))
  File "/opt/hostedtoolcache/Python/3.9.0/x64/lib/python3.9/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py", line 258, in _resolve
    raise BundleErrorAt(path, -1, "no such header")
onlinejudge_verify.languages.cplusplus_bundle.BundleErrorAt: bits/stdc++.h: line -1: no such header
Back to top page