# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1122969 | osmanay | Snowball (JOI21_ho_t2) | C++17 | 1 ms | 320 KiB |
//Snowball, OJ. Intervals problem.
//Osman Ay, November 2024.
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int N, Q;
cin >> N >> Q;
vector<long long> X(N + 1);
for (int i = 1; i <= N; i++)
cin >> X[i];
vector<long long> W(Q + 1);
vector<long long> bestSum(Q + 1, 0), maxL(Q + 1, 0), minR(Q + 1, 0);
long long preSum = 0;
for (int i = 1; i <= Q; i++)
{
cin >> W[i];
preSum += W[i];
maxL[i] = max(maxL[i - 1], preSum);
minR[i] = min(minR[i - 1], preSum);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |