This documentation is automatically generated by competitive-verifier/competitive-verifier
// competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/line_add_get_min
#include <bits/stdc++.h>
#include "../geometry/convex-hull-trick.hpp"
#include "../structure/others/binary-grouping.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_;
using Data = geometry::ConvexHullTrick<long long>::Line;
struct Structure {
vector<Data> datas;
geometry::ConvexHullTrick<long long> cht;
virtual void add(const Data &d) {
datas.emplace_back(d);
}
void build() {
cht = geometry::ConvexHullTrick<long long>(datas, true);
}
static Structure merge(const Structure &s1, const Structure &s2) {
Structure new_s;
for (auto &d : s1.datas) {
new_s.add(d);
}
for (auto &d : s2.datas) {
new_s.add(d);
}
new_s.build();
return new_s;
}
long long query(long long x) {
return cht.query(x);
}
size_t size() const { return datas.size(); }
};
int main() {
#ifdef LOCAL
freopen("./data.in", "r", stdin);
#endif
BinaryGrouping<Structure, Data> bg;
int n, q;
cin >> n >> q;
for (int i = 0; i < n; i++) {
long long a, b;
cin >> a >> b;
bg.insert({a, b});
}
while (q--) {
int t;
cin >> t;
if (t == 0) {
long long a, b;
cin >> a >> b;
bg.insert({a, b});
} else {
long long p;
cin >> p;
auto &structures = bg.structures;
long long res = numeric_limits<long long>::max() / 2;
for (auto &s : structures) {
res = min(res, s.query(p));
}
cout << res << endl;
}
}
return 0;
}
Traceback (most recent call last):
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj_resolve/resolver.py", line 181, in resolve
bundled_code = language.bundle(path, basedir=basedir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/verify/languages/cplusplus.py", line 252, in bundle
bundler.update(path)
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 477, in update
raise BundleErrorAt(
competitive_verifier.oj.verify.languages.cplusplus_bundle.BundleErrorAt: test/yosupo-line-add-get-min-2.test.cpp: line 10: unable to process #include in #if / #ifdef / #ifndef other than include guards
Env | Name | Status | Elapsed | Memory |
---|---|---|---|---|
g++ | example_00 |
![]() |
5 ms | 4 MB |
g++ | half_00 |
![]() |
2185 ms | 19 MB |
g++ | hand_max_00 |
![]() |
7324 ms | 26 MB |
g++ | max_random_00 |
![]() |
11889 ms | 35 MB |
g++ | max_random_01 |
![]() |
11897 ms | 35 MB |
g++ | max_random_02 |
![]() |
12038 ms | 34 MB |
g++ | no_output_00 |
![]() |
15228 ms | 35 MB |
g++ | parabola_random_00 |
![]() |
11668 ms | 38 MB |
g++ | parabola_random_01 |
![]() |
11830 ms | 37 MB |
g++ | parabola_random_02 |
![]() |
11770 ms | 38 MB |
g++ | random_00 |
![]() |
7207 ms | 17 MB |
g++ | random_01 |
![]() |
7693 ms | 19 MB |
g++ | random_02 |
![]() |
3553 ms | 10 MB |
g++ | small_00 |
![]() |
4 ms | 4 MB |
g++ | small_01 |
![]() |
4 ms | 4 MB |