library2

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

View the Project on GitHub goodstudyqaq/library2

:heavy_check_mark: test/yosupo-segment-add-get-min.test.cpp

Depends on

Code

#include <limits>
#define PROBLEM "https://judge.yosupo.jp/problem/segment_add_get_min"
#include <bits/stdc++.h>

#include "../structure/segment-tree/dynamic-li-chao-segment-tree.hpp"

using namespace std;

#ifdef LOCAL
#include "copypaste/debug.h"
#else
#define debug(...) 42
#endif

struct fast_ios {
    fast_ios() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(10);
    };
} fast_ios_;

int main() {
#ifdef LOCAL
    freopen("./data.in", "r", stdin);
#endif
    int n, q;
    cin >> n >> q;
    const long long inf = numeric_limits<long long>::max() / 2;
    DynamicLiChaoSegmentTree<long long, -1000000000, 1000000000, inf> dlct;

    for (int i = 0; i < n; i++) {
        long long l, r, a, b;
        cin >> l >> r >> a >> b;
        dlct.add_segment(l, r, a, b);
    }

    while (q--) {
        int t;
        cin >> t;
        if (t == 0) {
            long long l, r, a, b;
            cin >> l >> r >> a >> b;
            dlct.add_segment(l, r, a, b);
        } else {
            long long p;
            cin >> p;
            auto ret = dlct.query(p);
            if (ret >= inf) {
                cout << "INFINITY\n";
            } else {
                cout << ret << endl;
            }
        }
    }
}
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/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.12.6/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/cplusplus.py", line 187, in bundle
    bundler.update(path)
  File "/opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py", line 400, in update
    raise BundleErrorAt(path, i + 1, "unable to process #include in #if / #ifdef / #ifndef other than include guards")
onlinejudge_verify.languages.cplusplus_bundle.BundleErrorAt: test/yosupo-segment-add-get-min.test.cpp: line 10: unable to process #include in #if / #ifdef / #ifndef other than include guards
Back to top page