# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
37851 | Just_Solve_The_Problem | Divide and conquer (IZhO14_divide) | C++11 | 79 ms | 7484 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;
#define ll long long
const int N = (int)1e5 + 7;
const ll inf = (ll)1e18 + 7;
ll pg[N], pd[N];
ll x[N], g[N], d[N], a[N];
ll suf[N];
ll ans = 0;
main () {
int n; scanf ("%d", &n);
for (int i = 1; i <= n; i++) {
scanf ("%lld %lld %lld", x + i, g + i, d + i);
pd[i] = pd[i - 1] + d[i];
pg[i] = pg[i - 1] + g[i];
a[i] = pd[i] - x[i];
}
suf[n + 1] = -inf;
for (int i = n; i >= 1; i--) {
suf[i] = max(suf[i + 1], a[i]);
}
for (int i = 1; i <= n; i++) {
int l = i;
int r = n;
while (r - l > 1) {
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... |