# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
768213 | NK_ | Snowball (JOI21_ho_t2) | C++17 | 269 ms | 10004 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.
// Success consists of going from failure to failure without loss of enthusiasm
#include <bits/stdc++.h>
using namespace std;
#define nl '\n'
using ll = long long;
template<class T> using V = vector<T>;
int main() {
cin.tie(0)->sync_with_stdio(0);
int N, Q; cin >> N >> Q;
V<ll> A(N); for(auto& x : A) cin >> x;
V<ll> MN(Q + 1, 0), MX(Q + 1, 0);
ll cur = 0;
for(int i = 1; i <= Q; i++) {
ll x; cin >> x; cur += x;
MN[i] = min(MN[i-1], cur);
MX[i] = max(MX[i-1], cur);
}
V<ll> L(N), R(N);
L[0] = MN.back() + A[0];
R[N-1] = MX.back() + A[N-1];
for(int i = 0; i < N-1; i++) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |