# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1172264 | jill | Cake 3 (JOI19_cake3) | C++20 | 129 ms | 327680 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int nmax = 6e6 + 5;
struct WT {
struct node {
int l, r;
vector<ll> x;
vector<ll> s;
} t[nmax];
ll lo, hi;
int build(vector<ll> seq, ll a, ll b) {
static int idx = 0;
if(seq.empty()) return -1;
int cur = idx++;
if(a == b) return cur;
int mid = (a + b) >> 1;
t[cur].x.resize(seq.size());
t[cur].s.resize(seq.size());
vector<ll> left_seq, right_seq;
for (size_t i = 0; i < seq.size(); i++) {
if(seq[i] <= mid) {
t[cur].x[i] = 0;
t[cur].s[i] = 0;
left_seq.push_back(seq[i]);
} else {
t[cur].x[i] = 1;
t[cur].s[i] = seq[i];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |