# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
733457 | tch1cherin | Snowball (JOI21_ho_t2) | C++17 | 239 ms | 14256 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
template <typename T>
using min_heap = priority_queue<T, vector<T>, greater<T>>;
const long long INF = 1e18;
int main() {
int n, q;
cin >> n >> q;
vector<long long> X(n);
for (auto &v : X) {
cin >> v;
}
X.insert(X.begin(), -INF);
X.insert(X.end(), INF);
min_heap<pair<long long, int>> h;
for (int i = 0; i <= n; i++) {
h.push({X[i + 1] - X[i], i});
}
long long L = 0, R = 0, x = 0;
vector<long long> ans(n + 2);
vector<bool> foundl(n + 2, false), foundr(n + 2, false);
for (int i = 0; i < q; i++) {
long long W;
cin >> W;
x += W;
L = min(L, x);
R = max(R, x);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |