# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
586858 | JovanB | Tenis (COI19_tenis) | C++17 | 157 ms | 8028 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;
using ll = long long;
using ld = long double;
const int N = 100000;
struct Segment{
ll sum, mn, pos;
} seg[4*N+5];
int n;
void mrg(int node){
seg[node].sum = seg[node*2].sum + seg[node*2+1].sum;
seg[node].mn = min(seg[node*2].mn, seg[node*2].sum + seg[node*2+1].mn);
if(seg[node*2].sum + seg[node*2+1].mn == seg[node].mn) seg[node].pos = seg[node*2+1].pos;
else seg[node].pos = seg[node*2].pos;
}
void init(int node, int l, int r){
if(l == r){
seg[node].mn = -2*l;
seg[node].pos = l;
seg[node].sum = -2*l;
if(l == n) seg[node].mn = 0;
return;
}
int mid = (l+r)/2;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |