# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
581930 | AlexLuchianov | Sparklers (JOI17_sparklers) | C++14 | 198 ms | 9452 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 <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
using ll = long long;
int const nmax = 200000;
int const inf = 1000000000;
int v[5 + nmax];
ll arr[2][5 + nmax];
ll prefmin[5 + nmax], suffmin[5 + nmax];
ll prefmax[5 + nmax], suffmax[5 + nmax];
bool solve(int n, int k, int t, int speed) {
ll base = speed * t * 2LL;
int ptr = 0, ptr2 = 0;
arr[0][++ptr] = 0;
arr[1][++ptr2] = 0;
for(int i = k - 1; 1 <= i; i--) {
arr[0][++ptr] = -(v[i + 1] - v[i]);
arr[0][++ptr] = base;
}
for(int i = k + 1; i <= n; i++) {
arr[1][++ptr2] = -(v[i] - v[i - 1]);
arr[1][++ptr2] = base;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |